コード例 #1
0
 private void FormMergeMca_Load(object sender, EventArgs e)
 {
     lblCount.Text      = "";
     lblLines.Text      = "";
     tslblStatus.Text   = "等待数据";
     btnCombine.Enabled = false;
     myPerformStep      = new PerformStep(progressAdd);
     myProgressInit     = new ProgressInit(progressSetMax);
     myShowCount        = new ShowCount(showCount);
     myShowStatus       = new ShowStatus(showStatus);
     myAddListView      = new AddListView(addListView);
 }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: pavkh/WatchTower
        private void MainWindow_Load(object sender, EventArgs e)
        {
            this.progressBar1.Maximum = Properties.Settings.Default.Timer;
            this.progressBar1.Step = Properties.Settings.Default.Timer / 1000;

            statusSet = new StatusSet(setStatus);
            performStep = new PerformStep(performStepM);
            char[] delimiterChars = { ';', ':' };
            List<string> fileRows = new List<string>();

            try
            {
                StreamReader sReader = File.OpenText("config.ini");
                string read = null;
                while ((read = sReader.ReadLine()) != null)
                {
                    fileRows.Add(read);
                }

            }
            catch (Exception)
            {

                MessageBox.Show("Не найден файл config.ini");
                this.Close();

            }
            if (fileRows.Count == 0)
            {
                MessageBox.Show("Файл настроек пуст");
                this.Close();
            }
            Element[] elem = new Element[fileRows.Count];
            int i = 0;
            foreach (string str in fileRows)
            {

                string[] stringParts = str.Split(delimiterChars);
                elem[i] = new Element(stringParts[0], stringParts[1]);
                elem[i].Location = new Point(0, elem[i].Height*i);
                panel1.Controls.Add(elem[i]);
                i++;
            }
            Watcher watcher = new Watcher(fileRows);
            watcher.parent = this;
            Thread watchDuty = new Thread(new ThreadStart(watcher.watch));
            watchDuty.Start();
        }
コード例 #3
0
ファイル: MainWindow.cs プロジェクト: pavkh/WatchTower
        private void MainWindow_Load(object sender, EventArgs e)
        {
            this.progressBar1.Maximum = Properties.Settings.Default.Timer;
            this.progressBar1.Step    = Properties.Settings.Default.Timer / 1000;

            statusSet   = new StatusSet(setStatus);
            performStep = new PerformStep(performStepM);
            char[]        delimiterChars = { ';', ':' };
            List <string> fileRows       = new List <string>();

            try
            {
                StreamReader sReader = File.OpenText("config.ini");
                string       read    = null;
                while ((read = sReader.ReadLine()) != null)
                {
                    fileRows.Add(read);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Не найден файл config.ini");
                this.Close();
            }
            if (fileRows.Count == 0)
            {
                MessageBox.Show("Файл настроек пуст");
                this.Close();
            }
            Element[] elem = new Element[fileRows.Count];
            int       i    = 0;

            foreach (string str in fileRows)
            {
                string[] stringParts = str.Split(delimiterChars);
                elem[i]          = new Element(stringParts[0], stringParts[1]);
                elem[i].Location = new Point(0, elem[i].Height * i);
                panel1.Controls.Add(elem[i]);
                i++;
            }
            Watcher watcher = new Watcher(fileRows);

            watcher.parent = this;
            Thread watchDuty = new Thread(new ThreadStart(watcher.watch));

            watchDuty.Start();
        }
コード例 #4
0
 protected void OnResetRequest() => PerformStep?.Invoke(this, new EventArgs());