public DevManDataForm() { InitializeComponent(); mutex = new Mutex(); _app = AsyApplication.CreateInstance(); }
/// <summary> /// пробуем отсоединиться и соединиться /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void accept_Click(object sender, EventArgs e) { Uri last = DevManClient.Uri; try { if (textBoxTotalAddress.Text != string.Empty) { if (last.OriginalString != textBoxTotalAddress.Text) { Uri newUri = null; try { newUri = new Uri(textBoxTotalAddress.Text); AsyApplication _app = AsyApplication.CreateInstance(); if (_app != null) { _app.Commutator.DevManUri = newUri; } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
static void Main() { try { mutex = new Mutex(true, identifier, out isNotRunning); if (isNotRunning) { app = AsyApplication.CreateInstance(); if (app != null) { app.Load(); app.Connect(); System.Windows.Forms.Application.ApplicationExit += new EventHandler(Application_ApplicationExit); System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); System.Windows.Forms.Application.Run(new mainForm()); } } else { MessageBox.Show("Приложение уже запущено", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch { } }
/// <summary> /// инициализирует новый экземпляр класса /// </summary> public ParametersTunerForm() { InitializeComponent(); _app = AsyApplication.CreateInstance(); if (_app == null) { MessageBox.Show("Не удалось получить доступ к параметрам приложения"); } }
private AsyApplication _app = null; // основное приложение public mainForm() { InitializeComponent(); _app = AsyApplication.CreateInstance(); _app.OnTec += new EventHandler(_app_OnTec); dStatuser = new devMnStatuser(DevStatuse); DevManClient.onConnected += new EventHandler(DevManClient_onConnected); DevManClient.onDisconnected += new EventHandler(DevManClient_onDisconnected); setter = new setterText(setterTextF); }
public SelectParameterForm() { InitializeComponent(); _app = AsyApplication.CreateInstance(); }