コード例 #1
0
        public MainForm(List <TEC> tec)
        {
            this.tec = tec;
            InitializeComponent();
            oldSelectedIndex = 0;

            lockEvent = new object();

            logPath = System.Environment.CurrentDirectory;
            log     = new Logging(System.Environment.CurrentDirectory + @"\logDB.txt", false, null, null);

            firstStart = true;

            delegateStartWait = new DelegateFunc(StartWait);
            delegateStopWait  = new DelegateFunc(StopWait);

            waitForm                     = new WaitForm();
            delegateStopWaitForm         = new DelegateFunc(waitForm.StopWaitForm);
            delegateEvent                = new DelegateFunc(EventRaised);
            delegateUpdateActiveGui      = new DelegateFunc(UpdateActiveGui);
            delegateHideGraphicsSettings = new DelegateFunc(HideGraphicsSettings);

            adminPanel              = new Admin(tec, stsStrip);
            changeMode              = new ChangeMode(tec);
            passwordForm            = new Password(adminPanel);
            setPasswordForm         = new SetPassword(adminPanel);
            passwordSettingsForm    = new PasswordSettings(adminPanel);
            setPasswordSettingsForm = new SetPasswordSettings(adminPanel);
            graphicsSettingsForm    = new GraphicsSettings(this, delegateUpdateActiveGui, delegateHideGraphicsSettings);
            parametersForm          = new Parameters();

            adminPanel.SetDelegate(delegateStartWait, delegateStopWait, delegateEvent);
            connSettForm = new ConnectionSettingsView(tec, adminPanel);

            tecViews         = new List <TecView>();
            selectedTecViews = new List <TecView>();
            lockValue        = new object();
            waitCounter      = 0;

            prevStateIsAdmin = false;
            prevStateIsPPBR  = false;

            // создаём все tecview
            foreach (TEC t in tec)
            {
                int index_gtp;
                tecView = new TecView(t, -1, adminPanel, stsStrip, graphicsSettingsForm, parametersForm);
                tecView.SetDelegate(delegateStartWait, delegateStopWait, delegateEvent);
                tecViews.Add(tecView);
                if (t.GTP.Count > 1)
                {
                    index_gtp = 0;
                    foreach (GTP g in t.GTP)
                    {
                        tecView = new TecView(t, index_gtp, adminPanel, stsStrip, graphicsSettingsForm, parametersForm);
                        tecView.SetDelegate(delegateStartWait, delegateStopWait, delegateEvent);
                        tecViews.Add(tecView);
                        index_gtp++;
                    }
                }
            }

            //Form1 f = new Form1();
            //f.Show();

            timer.Start();
        }
コード例 #2
0
        public static void ThreadProc(object data)
        {
            WaitForm wf = (WaitForm)data;

            wf.StartWaitForm();
        }