Exemplo n.º 1
0
        public static OptionsControl Load(out bool ProgramIsNew)
        {
            try
            {
                if (File.Exists(Paths.GetOptionsFilePath()))
                {
                    object deserializedOptionsObj;
                    var    formatter = new BinaryFormatter();
                    using (var fileStream = new FileStream(Paths.GetOptionsFilePath(), FileMode.Open, FileAccess.Read,
                                                           FileShare.ReadWrite))
                    {
                        deserializedOptionsObj = formatter.Deserialize(fileStream);
                    }

                    var oc = (OptionsControl)deserializedOptionsObj;
                    oc.FillNullToDefaults();
                    ProgramIsNew = false;
                    return(oc);
                }
            }
            catch (Exception)
            {
            }

            var oco = new OptionsControl();

            oco.ReCreateCryptoKey();
#if DEBUG
            ProgramIsNew = false;
#else
            ProgramIsNew = true;
#endif
            return(oco);
        }
        private OptionsControl GetControl(string name)
        {
            string         findName = string.Concat("pnl", name.Replace(" ", string.Empty));
            OptionsControl panel    = this.FindName(findName) as OptionsControl;

            return(panel);
        }
Exemplo n.º 3
0
 void Start()
 {
     ws_main_language    = new WS_MAIN_LANGUAGE();
     ws_options_language = new WS_OPTIONS_LANGUAGE();
     _menuControl        = this.GetComponent <MenuControl> ();
     _optionsControl     = this.GetComponent <OptionsControl> ();
 }
        private void lstItems_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBox list = sender as ListBox;

            if (this.IsInitialized && list != null)
            {
                ListBoxItem selected = list.SelectedItem as ListBoxItem;
                if (selected != null)
                {
                    string value = (string)selected.Content;
                    this.lblOptions.Content = string.Concat(value, " Options");

                    OptionsControl panel = this.GetControl(value);
                    if (panel != null)
                    {
                        if (panel.Configuration == null)
                        {
                            panel.SetConfiguration(_configuration);
                        }
                        if (_openPanel != null)
                        {
                            _openPanel.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        panel.Visibility = System.Windows.Visibility.Visible;
                        _openPanel       = panel;
                    }
                }
            }
        }
Exemplo n.º 5
0
 public static void Initialize()
 {
     overview = new OptionsOverview();
     graphics = new OptionsGraphics();
     sound    = new OptionsSound();
     controls = new OptionsControl();
     general  = new OptionsGeneral();
 }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;
     mc           = FindObjectOfType <MenuControl> ();
     oc           = FindObjectOfType <OptionsControl> ();
     InputManager = FindObjectOfType <CustomInput>();
     isAc         = mc.isActiveCanvas;
 }
Exemplo n.º 7
0
 private void AddOption(object sender, EventArgs e)
 {
     try
     {
         if (chkMulipleChoice.Checked)
         {
             if (pan_options.Controls.Count > 0)
             {
                 OptionsControl ctrl = new OptionsControl()
                 {
                     Name     = "option" + (pan_options.Controls.Count - 1),
                     Letter   = (char)(Convert.ToInt32(((OptionsControl)pan_options.Controls[pan_options.Controls.Count - 1]).Letter) + 1),
                     Location = new Point(2, 2 + (pan_options.Controls.Count * 36))
                 };
                 pan_options.Controls.Add(ctrl);
             }
             else
             {
                 OptionsControl ctrl = new OptionsControl()
                 {
                     Location = new Point(2, 2),
                     Name     = "option0",
                     Letter   = 'A'
                 };
                 pan_options.Controls.Add(ctrl);
             }
         }
         else
         {
             if (pan_options.Controls.Count > 0)
             {
                 OptionControl ctrl = new OptionControl()
                 {
                     Name     = "option" + (pan_options.Controls.Count - 1),
                     Letter   = (char)(Convert.ToInt32(((OptionControl)pan_options.Controls[pan_options.Controls.Count - 1]).Letter) + 1),
                     Location = new Point(2, 2 + (pan_options.Controls.Count * 36))
                 };
                 pan_options.Controls.Add(ctrl);
             }
             else
             {
                 OptionControl ctrl = new OptionControl()
                 {
                     Location = new Point(2, 2),
                     Name     = "option0",
                     Letter   = 'A'
                 };
                 pan_options.Controls.Add(ctrl);
             }
         }
         //
         QuestionChanged(sender, e);
     }
     catch (Exception)
     {
         MessageBox.Show("Sorry, you cannot mix option types. First remove the existing options then replace them.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 8
0
        public override void SaveSettingsToStorage()
        {
            if (OptionsControl != null)
            {
                OptionsControl.ApplyChanges();
            }

            base.SaveSettingsToStorage();
        }
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     foreach (ListBoxItem item in this.lstItems.Items)
     {
         OptionsControl panel = this.GetControl((string)item.Content);
         if (panel != null)
         {
             panel.Save();
         }
     }
     _configuration.Save();
     this.Close();
 }
        private void InitializeControls()
        {
            TaskControl LiferegTaskControl = InitializeDataControl();

            LiferegTaskControl.SetTree("TreeNodeData", RMString.GetString("STreeNodeData"));
            TaskControlList.Add(LiferegTaskControl);

            LiferegTaskControl = new ModelControl();
            LiferegTaskControl.SetTree("TreeNodeModel", RMString.GetString("STreeNodeModel"));
            TaskControlList.Add(LiferegTaskControl);

            LiferegTaskControl = new PlotControl();
            LiferegTaskControl.SetTree("TreeNodePlot", RMString.GetString("STreeNodePlot"));
            TaskControlList.Add(LiferegTaskControl);

            LiferegTaskControl = new OutputControl();
            LiferegTaskControl.SetTree("TreeNodeOutput", RMString.GetString("STreeNodeOutput"));
            TaskControlList.Add(LiferegTaskControl);

            LiferegTaskControl = new OptionsControl();
            LiferegTaskControl.SetTree("TreeNodeOptions", RMString.GetString("STreeNodeOptions"));
            TaskControlList.Add(LiferegTaskControl);
        }
Exemplo n.º 11
0
 protected override void OnActivate(CancelEventArgs e)
 {
     base.OnActivate(e);
     OptionsControl.Font = VsShellUtilities.GetEnvironmentFont(this);
     OptionsControl.OnActivated();
 }
Exemplo n.º 12
0
 private void AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (trv_view_exam.SelectedNode.GetType() == typeof(ExamNode))
     {
         newQuestionToolStripButton.Enabled = false;
         //
         if (splitContainer2.Panel2.Controls.Contains(pan_display_questions))
         {
             splitContainer2.Panel2.Controls.Remove(pan_display_questions);
             splitContainer2.Panel2.Controls.Add(pan_exam_properties);
         }
         else if (splitContainer2.Panel2.Controls.Contains(pan_splash))
         {
             splitContainer2.Panel2.Controls.Remove(pan_splash);
             splitContainer2.Panel2.Controls.Add(pan_exam_properties);
         }
     }
     else if (trv_view_exam.SelectedNode.GetType() == typeof(SectionNode))
     {
         newQuestionToolStripButton.Enabled = true;
         //
         if (splitContainer2.Panel2.Controls.Contains(pan_exam_properties))
         {
             splitContainer2.Panel2.Controls.Remove(pan_exam_properties);
             splitContainer2.Panel2.Controls.Add(pan_display_questions);
         }
         else if (splitContainer2.Panel2.Controls.Contains(pan_splash))
         {
             splitContainer2.Panel2.Controls.Remove(pan_splash);
             splitContainer2.Panel2.Controls.Add(pan_display_questions);
         }
         pan_display_questions.Enabled = false;
     }
     else
     {
         newQuestionToolStripButton.Enabled = true;
         //
         if (splitContainer2.Panel2.Controls.Contains(pan_exam_properties))
         {
             splitContainer2.Panel2.Controls.Remove(pan_exam_properties);
             splitContainer2.Panel2.Controls.Add(pan_display_questions);
         }
         else if (splitContainer2.Panel2.Controls.Contains(pan_splash))
         {
             splitContainer2.Panel2.Controls.Remove(pan_splash);
             splitContainer2.Panel2.Controls.Add(pan_display_questions);
         }
         pan_display_questions.Enabled = true;
         //
         Question question = ((QuestionNode)trv_view_exam.SelectedNode).Question;
         txt_explanation.Text      = question.Explanation;
         txt_question_text.Text    = question.Text;
         lbl_section_question.Text = "Section: " + trv_view_exam.SelectedNode.Parent.Text + " Question " + question.No;
         pct_image.Image           = question.Image;
         //
         chkMulipleChoice.Checked = question.IsMultipleChoice;
         //
         pan_options.Controls.Clear();
         //
         int i = 0;
         if (question.IsMultipleChoice)
         {
             foreach (var option in question.Options)
             {
                 OptionsControl ctrl = new OptionsControl()
                 {
                     Letter   = option.Alphabet,
                     Text     = option.Text,
                     Location = new Point(2, i * 36)
                 };
                 if (question.Answers.Contains(option.Alphabet))
                 {
                     ctrl.Checked = true;
                 }
                 pan_options.Controls.Add(ctrl);
                 i++;
             }
         }
         else
         {
             foreach (var option in question.Options)
             {
                 OptionControl ctrl = new OptionControl()
                 {
                     Letter   = option.Alphabet,
                     Text     = option.Text,
                     Location = new Point(2, i * 36)
                 };
                 if (option.Alphabet == question.Answer)
                 {
                     ctrl.Checked = true;
                 }
                 pan_options.Controls.Add(ctrl);
                 i++;
             }
         }
     }
     //
     ReconnectHandlers();
 }
Exemplo n.º 13
0
        private void Redo(object sender, EventArgs e)
        {
            ChangeRepresentationObject redoObject = undoRedo.Redo();

            if (redoObject == null)
            {
                return;
            }
            else
            {
                switch (redoObject.Action)
                {
                case ActionType.Add:
                    SectionNode sectionNode = trv_view_exam.Nodes[0].Nodes.Cast <SectionNode>().FirstOrDefault(s => s.Title == redoObject.SectionTitle);
                    if (sectionNode == null)
                    {
                        sectionNode = new SectionNode(redoObject.SectionTitle)
                        {
                            ContextMenuStrip = cms_section
                        };
                        //
                        QuestionNode questionNode = new QuestionNode(redoObject.Question)
                        {
                            ContextMenuStrip = cms_question
                        };
                        sectionNode.Nodes.Add(questionNode);
                        //
                        trv_view_exam.Nodes[0].Nodes.Add(sectionNode);
                        trv_view_exam.ExpandAll();
                    }
                    else
                    {
                        sectionNode.ContextMenuStrip = cms_section;
                        //
                        QuestionNode questionNode = new QuestionNode(redoObject.Question)
                        {
                            ContextMenuStrip = cms_question
                        };
                        sectionNode.Nodes.Add(questionNode);
                        //
                        trv_view_exam.ExpandAll();
                    }
                    //
                    int i = 1;
                    foreach (QuestionNode questionNode_ in sectionNode.Nodes)
                    {
                        questionNode_.Text        = "Question " + i;
                        questionNode_.Question.No = i;
                        i++;
                    }
                    break;

                case ActionType.Delete:
                    SectionNode _sectionNode = trv_view_exam.Nodes[0].Nodes.Cast <SectionNode>().FirstOrDefault(s => s.Title == redoObject.SectionTitle);
                    if (_sectionNode != null)
                    {
                        if (_sectionNode.Nodes.Count >= redoObject.Question.No)
                        {
                            exam.Sections.First(s => s.Title == redoObject.SectionTitle).Questions.RemoveAt(redoObject.Question.No - 1);
                            _sectionNode.Nodes.RemoveAt(redoObject.Question.No - 1);
                        }
                    }
                    //
                    int j = 1;
                    foreach (QuestionNode questionNode_ in _sectionNode.Nodes)
                    {
                        questionNode_.Text        = "Question " + j;
                        questionNode_.Question.No = j;
                        j++;
                    }
                    break;

                case ActionType.Modify:
                    SectionNode sectionNode_ = trv_view_exam.Nodes[0].Nodes.Cast <SectionNode>().FirstOrDefault(s => s.Title == redoObject.SectionTitle);
                    if (sectionNode_ != null)
                    {
                        QuestionNode questionNode = (QuestionNode)sectionNode_.Nodes[redoObject.Question.No - 1];
                        questionNode.Question = redoObject.Question;
                        //
                        txt_explanation.Text      = redoObject.Question.Explanation;
                        txt_question_text.Text    = redoObject.Question.Text;
                        lbl_section_question.Text = "Section: " + trv_view_exam.SelectedNode.Parent.Text + " Question " + redoObject.Question.No;
                        pct_image.Image           = redoObject.Question.Image;
                        //
                        pan_options.Controls.Clear();
                        //
                        int k = 0;
                        if (redoObject.Question.IsMultipleChoice)
                        {
                            foreach (var option in redoObject.Question.Options)
                            {
                                OptionsControl ctrl = new OptionsControl()
                                {
                                    Letter   = option.Alphabet,
                                    Text     = option.Text,
                                    Location = new Point(2, k * 36)
                                };
                                if (redoObject.Question.Answers.Contains(option.Alphabet))
                                {
                                    ctrl.Checked = true;
                                }
                                pan_options.Controls.Add(ctrl);
                                k++;
                            }
                        }
                        else
                        {
                            foreach (var option in redoObject.Question.Options)
                            {
                                OptionControl ctrl = new OptionControl()
                                {
                                    Letter   = option.Alphabet,
                                    Text     = option.Text,
                                    Location = new Point(2, k * 36)
                                };
                                if (option.Alphabet == redoObject.Question.Answer)
                                {
                                    ctrl.Checked = true;
                                }
                                pan_options.Controls.Add(ctrl);
                                k++;
                            }
                        }
                    }
                    break;
                }
            }
        }
Exemplo n.º 14
0
    // Update is called once per frame
    void Update()
    {
        GameObject     newgameObject = GameObject.Find("text_NewGame");
        NewGameControl newGameItem   = newgameObject.GetComponent <NewGameControl>();

        GameObject     optionobject = GameObject.Find("Text_OPTION");
        OptionsControl optionItem   = optionobject.GetComponent <OptionsControl>();

        GameObject  exitobject = GameObject.Find("text_Exit");
        ExitControl exitItem   = exitobject.GetComponent <ExitControl>();

        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            if (!newGameItem.selected && !optionItem.selected && !exitItem.selected)
            {
                newGameItem.selected = true;
            }
            else if (newGameItem.selected && !optionItem.selected && !exitItem.selected)
            {
                newGameItem.renderer.material.color = new Color(255, 255, 255, 255);
                newGameItem.selected = false;
                optionItem.selected  = true;
            }
            else if (!newGameItem.selected && optionItem.selected && !exitItem.selected)
            {
                optionItem.renderer.material.color = new Color(255, 255, 255, 255);
                optionItem.selected = false;
                exitItem.selected   = true;
            }
            else if (!newGameItem.selected && !optionItem.selected && exitItem.selected)
            {
                exitItem.renderer.material.color = new Color(255, 255, 255, 255);
                exitItem.selected    = false;
                newGameItem.selected = true;
            }
        }
        else if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            if (!newGameItem.selected && !optionItem.selected && !exitItem.selected)
            {
                exitItem.selected = true;
            }
            else if (newGameItem.selected && !optionItem.selected && !exitItem.selected)
            {
                newGameItem.renderer.material.color = new Color(255, 255, 255, 255);
                newGameItem.selected = false;
                exitItem.selected    = true;
            }
            else if (!newGameItem.selected && optionItem.selected && !exitItem.selected)
            {
                optionItem.renderer.material.color = new Color(255, 255, 255, 255);
                optionItem.selected  = false;
                newGameItem.selected = true;
            }
            else if (!newGameItem.selected && !optionItem.selected && exitItem.selected)
            {
                exitItem.renderer.material.color = new Color(255, 255, 255, 255);
                exitItem.selected   = false;
                optionItem.selected = true;
            }
        }
    }
Exemplo n.º 15
0
    public void OnEnable()
    {
        optionsControl = (OptionsControl)target;
        script         = new SerializedObject(target);

        // Objects Settings
        canvasScaler  = script.FindProperty("canvasScaler");
        panelsOptions = script.FindProperty("panelsOptions");
        buttons       = script.FindProperty("buttons");
        colorNormal   = script.FindProperty("colorNormal");
        colorSelected = script.FindProperty("colorSelected");
        //customInput = script.FindProperty ("customInput");
        InitSettings = script.FindProperty("InitSettings");

        this.panelsOptions2 = new ReorderableList(script, panelsOptions);
        this.buttons2       = new ReorderableList(script, buttons);


        this.panelsOptions2.drawElementCallback = RectNewOptions;
        this.panelsOptions2.drawHeaderCallback  = (Rect rect) => {
            EditorGUI.LabelField(rect, "Panels Options");
        };

        this.buttons2.drawElementCallback = RectNewButton;
        this.buttons2.drawHeaderCallback  = (Rect rect) => {
            EditorGUI.LabelField(rect, "Buttons");
        };

        // Amounts
        amounts       = script.FindProperty("amounts");
        this.amounts2 = new ReorderableList(script, amounts);
        this.amounts2.drawElementCallback = RectNewAmounts;
        this.amounts2.drawHeaderCallback  = (Rect rect) => {
            EditorGUI.LabelField(rect, "Amounts Text");
        };

        // Sliders
        sliders       = script.FindProperty("sliders");
        this.sliders2 = new ReorderableList(script, sliders);
        this.sliders2.drawElementCallback = RectNewSliders;
        this.sliders2.drawHeaderCallback  = (Rect rect) => {
            EditorGUI.LabelField(rect, "Sliders");
        };

        // Dropdowns
        dropdowns       = script.FindProperty("dropdowns");
        this.dropdowns2 = new ReorderableList(script, dropdowns);
        this.dropdowns2.drawElementCallback = RectNewDropdowns;
        this.dropdowns2.drawHeaderCallback  = (Rect rect) => {
            EditorGUI.LabelField(rect, "Dropdowns");
        };

        // Toggles
        toggles       = script.FindProperty("toggles");
        this.toggles2 = new ReorderableList(script, toggles);
        this.toggles2.drawElementCallback = RectNewToggles;
        this.toggles2.drawHeaderCallback  = (Rect rect) => {
            EditorGUI.LabelField(rect, "Toggles");
        };

        // Resolutions
        resolutions       = script.FindProperty("resolutions");
        this.resolutions2 = new ReorderableList(script, resolutions);
        this.resolutions2.drawElementCallback = RectNewResolutions;
        this.resolutions2.drawHeaderCallback  = (Rect rect) => {
            EditorGUI.LabelField(rect, "Resolutions");
        };
    }
Exemplo n.º 16
0
        public ParentForm(LuiConfig config)
        {
            Config = config;

            SuspendLayout();

            // Dispose resources when the form is closed;
            FormClosed += (s, e) => Config.Dispose();

            AutoScaleMode = AutoScaleMode.Dpi;
            StartPosition = FormStartPosition.WindowsDefaultLocation;
            Margin        = new Padding(2, 2, 2, 2);
            Name          = "ParentForm";
            Text          = "LUI " + Assembly.GetExecutingAssembly().GetName().Version;

            #region Setup tabs

            Tabs = new TabControl();
            Tabs.SuspendLayout();
            Tabs.Location      = new Point(0, 0);
            Tabs.Margin        = new Padding(2, 2, 2, 2);
            Tabs.Name          = "Tabs";
            Tabs.SelectedIndex = 0;
            //Tabs.Anchor = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            Tabs.Dock     = DockStyle.Fill;
            Tabs.TabIndex = 0;

            HomePage         = new TabPage();
            AbsPage          = new TabPage();
            TAAlignPage      = new TabPage();
            TRODPage         = new TabPage();
            LDAlignPage      = new TabPage();
            LDExtinctionPage = new TabPage();
            TRLDPage         = new TabPage();
            ResidualsPage    = new TabPage();
            CalibrationPage  = new TabPage();
            OptionsPage      = new TabPage();

            #region page properties
            HomePage.BackColor = SystemColors.Control;
            HomePage.Margin    = new Padding(2, 2, 2, 2);
            HomePage.Name      = "HomePage";
            HomePage.TabIndex  = 2;
            HomePage.Text      = "Home";

            AbsPage.BackColor = SystemColors.Control;
            AbsPage.Margin    = new Padding(2, 2, 2, 2);
            AbsPage.Name      = "AbsPage";
            AbsPage.TabIndex  = 3;
            AbsPage.Text      = "Absorbance";

            TAAlignPage.BackColor = SystemColors.Control;
            TAAlignPage.Margin    = new Padding(2, 2, 2, 2);
            TAAlignPage.Name      = "TAAlignPage";
            TAAlignPage.TabIndex  = 5;
            TAAlignPage.Text      = "TA Align";

            TRODPage.BackColor = SystemColors.Control;
            TRODPage.Margin    = new Padding(2, 2, 2, 2);
            TRODPage.Name      = "TRODPage";
            TRODPage.Padding   = new Padding(2, 2, 2, 2);
            TRODPage.TabIndex  = 0;
            TRODPage.Text      = "TROD";

            LDAlignPage.BackColor = SystemColors.Control;
            LDAlignPage.Margin    = new Padding(2, 2, 2, 2);
            LDAlignPage.Name      = "LDAlignPage";
            LDAlignPage.Padding   = new Padding(2, 2, 2, 2);
            LDAlignPage.TabIndex  = 0;
            LDAlignPage.Text      = "LD Align";

            TRLDPage.BackColor = SystemColors.Control;
            TRLDPage.Margin    = new Padding(2, 2, 2, 2);
            TRLDPage.Name      = "TRLDPage";
            TRLDPage.Padding   = new Padding(2, 2, 2, 2);
            TRLDPage.TabIndex  = 0;
            TRLDPage.Text      = "TRLD";

            LDExtinctionPage.BackColor = SystemColors.Control;
            LDExtinctionPage.Margin    = new Padding(2, 2, 2, 2);
            LDExtinctionPage.Name      = "LDExtinctionPage";
            LDExtinctionPage.Padding   = new Padding(2, 2, 2, 2);
            LDExtinctionPage.TabIndex  = 0;
            LDExtinctionPage.Text      = "Extinction";

            ResidualsPage.BackColor = SystemColors.Control;
            ResidualsPage.Margin    = new Padding(2, 2, 2, 2);
            ResidualsPage.Name      = "ResidualsPage";
            ResidualsPage.TabIndex  = 4;
            ResidualsPage.Text      = "Residuals";

            CalibrationPage.BackColor = SystemColors.Control;
            CalibrationPage.Margin    = new Padding(2, 2, 2, 2);
            CalibrationPage.Name      = "CalibrationPage";
            CalibrationPage.Padding   = new Padding(2, 2, 2, 2);
            CalibrationPage.TabIndex  = 1;
            CalibrationPage.Text      = "WL Cal";

            OptionsPage.BackColor = SystemColors.Control;
            OptionsPage.Margin    = new Padding(2, 2, 2, 2);
            OptionsPage.Name      = "OptionsPage";
            OptionsPage.TabIndex  = 7;
            OptionsPage.Text      = "Options";

            Tabs.TabPages.Add(HomePage);
            Tabs.TabPages.Add(AbsPage);
            Tabs.TabPages.Add(TAAlignPage);
            Tabs.TabPages.Add(TRODPage);
            Tabs.TabPages.Add(LDAlignPage);
            Tabs.TabPages.Add(TRLDPage);
            Tabs.TabPages.Add(LDExtinctionPage);
            Tabs.TabPages.Add(ResidualsPage);
            Tabs.TabPages.Add(CalibrationPage);
            Tabs.TabPages.Add(OptionsPage);
            #endregion

            Controls.Add(Tabs);

            Tabs.DrawMode   = TabDrawMode.OwnerDrawFixed;
            Tabs.DrawItem  += HandleTabDrawItem;
            Tabs.Selecting += HandleTabSelecting;
            Tabs.Selected  += HandleTabSelected;

            #endregion Setup tabs

            OptionsControl = new OptionsControl(Config)
            {
                Dock = DockStyle.Fill
            };

            #region add controls
            HomePage.Controls.Add(new Panel()); // Just a placeholder.

            AbsControl = new AbsorbanceControl(Config);
            AbsPage.Controls.Add(AbsControl);

            TAAlignControl = new TaalignControl(Config);
            TAAlignPage.Controls.Add(TAAlignControl);

            TRODControl = new TrodControl(Config);
            TRODPage.Controls.Add(TRODControl);

            LDAlignControl = new LdalignControl(Config);
            LDAlignPage.Controls.Add(LDAlignControl);

            TRLDControl = new TrldControl(Config);
            TRLDPage.Controls.Add(TRLDControl);

            LDExtinctionControl = new LdextinctionControl(Config);
            LDExtinctionPage.Controls.Add(LDExtinctionControl);

            CalibrateControl = new CalibrateControl(Config);
            CalibrationPage.Controls.Add(CalibrateControl);

            ResidualsControl = new ResidualsControl(Config);
            ResidualsPage.Controls.Add(ResidualsControl);

            OptionsPage.Controls.Add(OptionsControl);
            OptionsControl.OptionsApplied += HandleOptionsApplied;
            #endregion

            foreach (TabPage page in Tabs.TabPages)
            {
                if (page != HomePage && page != OptionsPage)
                {
                    page.Enabled = false;
                }
                if (page.Controls[0] is LuiTab luiTab)
                {
                    luiTab.Load         += (se, ev) => CalibrateControl.CalibrationChanged += luiTab.HandleCalibrationChanged;
                    FormClosing         += luiTab.HandleExit;
                    luiTab.TaskStarted  += HandleTaskStarted;
                    luiTab.TaskFinished += HandleTaskFinished;
                }
            }

            Tabs.SelectedTab = HomePage;

            Resize += HandleResize;

            Tabs.ResumeLayout();
            ResumeLayout();
        }
Exemplo n.º 17
0
 protected override void OnApply(PageApplyEventArgs e)
 {
     base.OnApply(e);
     OptionsControl.OnApply();
 }