Example #1
0
        public VsScanner()
        {
            InitializeComponent();

            // form load handler
            this.Load += new EventHandler(VsMonitor_Load);
            this.Resize += new EventHandler(VsMonitor_Resize);
            this.FormClosing += new FormClosingEventHandler(VsMonitor_FormClosing);

            try
            {
                // new object
                vsCoreMonitor = new VsCoreServer(Path.GetDirectoryName(Application.ExecutablePath));

                // allow to save all configs to files
                vsCoreMonitor.SaveConfigToFile = true;

                // Initial application core
                vsCoreMonitor.VsMonitorInitial();

                VsSplasher.Status = "Load application setting...";
                System.Threading.Thread.Sleep(1500);

                VsSplasher.Close();
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);
            }
        }
Example #2
0
        public VsLive()
        {
            try
            {
                InitializeComponent();

                Vs.Monitor.VsSplasher.Status = "Load application setting...";
                System.Threading.Thread.Sleep(1000);

                Vs.Monitor.VsSplasher.LoginSerivce();

                while (Vs.Monitor.VsSplasher.Blocked) System.Threading.Thread.Sleep(100);


                if (!Vs.Monitor.VsSplasher.Connected)
                {
                    this.Hide();
                    bCancel = true;

                    // this.Close();
                    //VsMonitor_Close();

                    return;
                }
                else
                {
                    //VsSplasher.Close();

                    // form load handler
                    this.Load += new EventHandler(VsMonitor_Load);
                    this.Resize += new EventHandler(VsMonitor_Resize);
                    this.FormClosing += new FormClosingEventHandler(VsMonitor_FormClosing);


                    //Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);

                    // new object
                    string configPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "OpenVss\\VsClient\\"); ;
                    vsCoreMonitor = new VsCoreServer(Path.GetDirectoryName(Application.ExecutablePath));

                    // allow to save all configs to files
                    vsCoreMonitor.SaveConfigToFile = true;

                    // Initial application core
                    vsCoreMonitor.VsMonitorInitial(configPath);
                }
                VsSplasher.Close();
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);
            }
        }