Exemple #1
0
        public DevManDataForm()
        {
            InitializeComponent();

            mutex = new Mutex();
            _app  = AsyApplication.CreateInstance();
        }
Exemple #2
0
        /// <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);
            }
        }
Exemple #3
0
        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 { }
        }
Exemple #4
0
        /// <summary>
        /// инициализирует новый экземпляр класса
        /// </summary>
        public ParametersTunerForm()
        {
            InitializeComponent();

            _app = AsyApplication.CreateInstance();
            if (_app == null)
            {
                MessageBox.Show("Не удалось получить доступ к параметрам приложения");
            }
        }
Exemple #5
0
        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);
        }
Exemple #6
0
 public SelectParameterForm()
 {
     InitializeComponent();
     _app = AsyApplication.CreateInstance();
 }