Example #1
0
        private void resizePanels()
        {
            Size screenSize;

            if (_inputPanel != null && _inputPanel.Enabled)
            {
                screenSize = new System.Drawing.Size(
                    _inputPanel.VisibleDesktop.Width,
                    _inputPanel.VisibleDesktop.Height);
            }
            else
            {
                screenSize = this.ClientSize;
            }

            this.logPanel.Size = screenSize;
            this.logBox.Size   = new System.Drawing.Size(this.logPanel.Size.Width,
                                                         this.logPanel.Size.Height -
                                                         this.logBox.Location.Y);

            IEnumerator en = _appliances.GetEnumerator();

            while (en.MoveNext())
            {
                Appliance     a    = (Appliance)en.Current;
                UIGenerator   ui   = a.GetUIGenerator();
                InterfaceNode root = ui.InterfaceRoot;

                ui.Size = screenSize;

                root.SetSize(ui.Size.Width, ui.Size.Height);
                root.DoLayout(ui.LayoutVars);
            }
        }
Example #2
0
        public void SetCurrentAppliance(Appliance a)
        {
            if (_currentAppliance != null)
            {
                this.Controls.Remove(_currentAppliance.GetUIGenerator());
                _currentAppliance.GetMenuItem().Checked = false;
            }
            else
            {
                disconnectItem.Enabled = true;
            }

            _currentAppliance = a;
            _currentAppliance.GetMenuItem().Checked = true;
            this.Controls.Add(_currentAppliance.GetUIGenerator());
            _currentAppliance.GetUIGenerator().BringToFront();
            HideLogPanel();
        }
Example #3
0
        public void AddActiveAppliance(Appliance a)
        {
            _appliances.Add(a);

            DeviceSwitcher d = new DeviceSwitcher(a);

            a.GetMenuItem().Click += new EventHandler(d.DeviceMenuClicked);
            deviceMenu.MenuItems.Add(a.GetMenuItem());

            a.SetUIGenerator(new UIGeneration.UIGenerator(_rulePhases,
                                                          _smartCIOManager,
                                                          _registry));

            a.GetUIGenerator().Size     = this.Size;
            a.GetUIGenerator().Location = new System.Drawing.Point(0, 0);

            a.GetUIGenerator().GenerateUI(a);

            SetCurrentAppliance(a);
        }
Example #4
0
        public void RemoveAppliance(Appliance a)
        {
            _appliances.Remove(a);
            if (_appliances.Count > 0)
            {
                SetCurrentAppliance((Appliance)_appliances[0]);
            }
            else
            {
                _currentAppliance = null;
                this.Controls.Remove(a.GetUIGenerator());
                disconnectItem.Enabled = false;
                ShowLogPanel();
            }

            deviceMenu.MenuItems.Remove(a.GetMenuItem());
        }