public MainWindow()
        {
            InitializeComponent();

            // initialize popup forms
            CrossThreadDialogs.InitializeDialogs(this);

            // add version to form title
            Text += $@" V{Version.String}";

            // initialize settings
            _applicationSettings.ReadSettings();
            _applicationSettings.FormSettings.LoadLocation(this);
            UserModeRemember.Checked = _applicationSettings.RememberUserMode;

            // initialize the VisiLEDComPort
            _visiLedThreadedComPort = new VisiLEDThreadedComPort("VisiLEDComPort", _closingWorker);
            _visiLedThreadedComPort.RegisterConnectionUpdate(MessageBroker.MessageContext.NewThreadToGui, UpdateConnectionButton);
            UpdateConnectionButton(new ThreadedComPortBase.ConnectionUpdateArgs());

            // initialize docking
            _docking = new Docking(this, dockPanel, menuStrip1);
            _docking.AddForm(new CommonControls(_docking, _visiLedThreadedComPort));
            _docking.AddForm(new CommDialog(_visiLedThreadedComPort));
            _docking.AddForm(new ChannelControls("Channel A", Channel.A, _visiLedThreadedComPort));
            _docking.AddForm(new ChannelControls("Channel B", Channel.B, _visiLedThreadedComPort));
            _docking.LoadLayout();

            // initialize forms from settings
            SetUserMode(_applicationSettings.RememberUserMode ? _applicationSettings.UserMode : UserModes.Simple);
            ChangeFontAll(_applicationSettings.FontSize);

            // Handlers
            FormClosing += MainWindow_FormClosing;
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            // initialize popup forms
            CrossThreadDialogs.InitializeDialogs(this);

            // add version to form title
            base.Text += $@" V{Version.String}";

            // initialize settings
            _applicationSettings.ReadSettings();
            _applicationSettings.FormSettings.LoadLocation(this);

            // initialize the KL2500LED ComPort
            _KL2500LEDThreadedComPort = new KL2500LEDThreadedComPort("KL2500LED ComPort", _closingWorker);
            _KL2500LEDThreadedComPort.RegisterConnectionUpdate(MessageBroker.MessageContext.NewThreadToGui, UpdateConnectionButton);
            UpdateConnectionButton(new ThreadedComPortBase.ConnectionUpdateArgs());

            // initialize docking
            _docking = new Docking(this, dockPanel, menuStrip1);
            _docking.AddForm(new MainControls(_docking, _KL2500LEDThreadedComPort));
            _docking.AddForm(new SystemInfo(_docking, _KL2500LEDThreadedComPort));
            _docking.AddForm(new MemorySettings(_docking, _KL2500LEDThreadedComPort));
            _docking.AddForm(new CommDialog(_KL2500LEDThreadedComPort));
            if (!_docking.LoadLayout())
            {
                _docking.LoadLayout(Layouts.Layouts.GetStream("ApplicationLayout.xml"));
            }

            //_docking.ShowDockedForm("Main Controls");
            //_docking.ShowDockedForm("System Info");
            //_docking.ShowDockedForm("Memory Settings");
            //_docking.ShowDockedForm("Comm Dialog");

            // initialize forms from settings
            ChangeFontAll(_applicationSettings.FontSize);

            // Handlers
            FormClosing += MainWindow_FormClosing;
        }