COmpilazione progetto Iob.Net con apertura UI ext+varie

This commit is contained in:
Samuele E. Locatelli
2020-09-26 16:44:51 +02:00
parent 9dae728914
commit e302e8b852
30 changed files with 1278 additions and 70 deletions
+66
View File
@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Iob.Net.UI
{
public partial class IobControlWindow : Form
{
#region Private Fields
private static IobControlWindow ctrlwindow = null;
private bool _closing = false;
#endregion Private Fields
#region Public Constructors
public IobControlWindow()
{
InitializeComponent();
}
#endregion Public Constructors
#region Public Methods
public static void Start()
{ // Open WinForm
Thread th = new Thread(() =>
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
ctrlwindow = new IobControlWindow();
Application.Run(ctrlwindow);
});
th.SetApartmentState(ApartmentState.STA);
th.Start();
}
public static void Stop()
{ // Close WinForm
if (ctrlwindow != null)
{
ctrlwindow.Invoke((ThreadStart)delegate ()
{
ctrlwindow._closing = true;
ctrlwindow.Close();
ctrlwindow = null;
});
}
}
#endregion Public Methods
}
}