Exemple #1
0
        private void MenuConfigurator_Click(object sender, EventArgs e)
        {
            RunMethodAsynchronously runasync = new RunMethodAsynchronously(delegate(object[] o)
            {
                string configurationApplication = Path.Combine(Application.StartupPath, "CAS.OPCViewer.exe");
                string arguments = "";
                if (remoterserver != null)
                {
                    arguments = remoterserver.GetConfigurationFileName();
                }
                if (!string.IsNullOrEmpty(arguments))
                {
                    arguments = string.Format("\"{0}\"", arguments);
                }
                try
                {
                    System.Diagnostics.Process.Start(configurationApplication, arguments);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(configurationApplication, "Cannot start the configuration application: \r\n" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                };
            }
                                                                           );

            runasync.RunAsync();
        }
        private void menu_Report_Click(object sender, EventArgs e)
        {
            RunMethodAsynchronously runasync = new RunMethodAsynchronously(delegate(object[] o)
            {
                Lib.RTLib.Utils.ReportGenerator.DisplayReport(m_remoterServer.GetReport());
            });

            runasync.RunAsync();
        }
        public void RunMethodAsynchronouslyTimeOutTestMethod()
        {
            RunMethodAsynchronously runasync = new RunMethodAsynchronously(delegate(object[] param) { WaitAndCheckConsistency((int)param[0], (int)param[1]); });

            runasync.RunAsync(new object[] { 5, 5 });
            bool _res = false;

            lock (this)
                _res = m_MEthodFinished.Wait(this, 500);
            Assert.IsFalse(_res, "Calling asynchronous method filed.");
        }
Exemple #4
0
 private void RaportGenerator_Click(object sender, System.EventArgs e)
 {
     if (remoterserver != null)
     {
         RunMethodAsynchronously runasync = new RunMethodAsynchronously(delegate(object[] o)
         {
             CAS.Lib.RTLib.Utils.ReportGenerator.DisplayReport(remoterserver.GetReport());
         });
         runasync.RunAsync();
     }
     else
     {
         MessageBox.Show(Resources.tx_DataPorter_MainForm_connecttodoreport);
     }
 }
Exemple #5
0
        private static void StartAppAsync(string appname, string longappname)
        {
            RunMethodAsynchronously runasync = new RunMethodAsynchronously(delegate(object[] o)
            {
                try
                {
                    System.Diagnostics.Process.Start(appname);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Cannot start the " + longappname + " :" + ex.Message, appname, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                };
            }
                                                                           );

            runasync.RunAsync();
        }
Exemple #6
0
        private void Help_Click(object sender, System.EventArgs e)
        {
            RunMethodAsynchronously runasync = new RunMethodAsynchronously(delegate(object[] o)
            {
                try
                {
                    Process.Start(Resources.OnlineDocumentation_url);
                }
                catch (Exception)
                {
                    MessageBox.Show("Online Documentation", "Cannot start Online Documentation", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                };
            }
                                                                           );

            runasync.RunAsync();
        }
        private void MainForm_Load(object sender, System.EventArgs e)
        {
            RunMethodAsynchronously runasync = new RunMethodAsynchronously(delegate(object[] param)
            {
                SplashScreen SplashScreenObj = new SplashScreen();
                SplashScreenObj.Show();
                SplashScreenObj.Refresh();
                int time = 1000;
                if (param != null)
                {
                    time = (int)param[0];
                }
                System.Threading.Thread.Sleep(time);
                SplashScreenObj.Close();
            });

            runasync.RunAsync(new object[] { 2000 });
        }
Exemple #8
0
        private void dCOMConfiguratorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //dcomcnfg
            RunMethodAsynchronously runasync = new RunMethodAsynchronously(delegate(object[] o)
            {
                try
                {
                    System.Diagnostics.Process.Start("dcomcnfg");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("dcomcnfg", "Cannot start the DCOM configuration console:" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                };
            }
                                                                           );

            runasync.RunAsync();
        }
Exemple #9
0
        private void oPCUAViewerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string appname     = AppDomain.CurrentDomain.BaseDirectory + "CAS.OPC.UA.Viewer.exe";
            string longappname = "OPC UA Viewer - OPC UA client";
            RunMethodAsynchronously runasync = new RunMethodAsynchronously
                                                   (delegate(object[] o)
            {
                try
                {
                    System.Diagnostics.Process.Start(appname);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(appname, "Cannot start the " + longappname + " :" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                };
            }
                                                   );

            runasync.RunAsync();
        }