public FrmOptions(FrmMqttMain Mainform) { InitializeComponent(); parentform = Mainform; g_TriggerFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "triggers.json"); LoadSettings(); if (txtmqtttopic.TextLength == 0) { txtmqtttopic.Text = System.Environment.MachineName; } if (txtMqttTimerInterval.TextLength == 0) { txtMqttTimerInterval.Text = "60000"; } LoadTriggerlist(); dataGridView1.DataSource = MqttTriggerList; dataGridView1.Columns[0].Visible = false; if (txtmqtttopic.Text.Contains("#") == true) { txtmqtttopic.Text = txtmqtttopic.Text.Replace("/#", ""); Properties.Settings.Default["mqtttopic"] = txtmqtttopic.Text; Properties.Settings.Default.Save(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FrmMqttMain form1 = new FrmMqttMain(); Application.ThreadException += new ThreadExceptionEventHandler(form1.UnhandledThreadExceptionHandler); Application.Run(form1); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var container = ContainerConfig.Configure(); using (var scope = container.BeginLifetimeScope()) { FrmMqttMain form1 = scope.Resolve <FrmMqttMain>(); Application.ThreadException += new ThreadExceptionEventHandler(form1.UnhandledThreadExceptionHandler); Application.Run(form1); } }
public FrmOptions(FrmMqttMain Mainform) { InitializeComponent(); ParentForm = Mainform; TriggerFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "triggers.json"); LoadSettings(); if (txtmqtttopic.TextLength == 0) { txtmqtttopic.Text = System.Environment.MachineName; } if (txtMqttTimerInterval.TextLength == 0) { txtMqttTimerInterval.Text = "60000"; } if (txtmqtttopic.Text.Contains("#") == true) { txtmqtttopic.Text = txtmqtttopic.Text.Replace("/#", ""); Properties.Settings.Default["mqtttopic"] = txtmqtttopic.Text; Properties.Settings.Default.Save(); } LoadAudioDevices(); }