private void CommonCustomClassifyMenuPlugin_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem tsmi = sender as ToolStripMenuItem;

            if (tsmi != null)
            {
                CommonCustomClassify _Classify = tsmi.Tag as CommonCustomClassify;
                foreach (ViewBase _View in this.m_Application.Views)
                {
                    if (_View is ControlView)
                    {
                        ControlView _ControlView = _View as ControlView;
                        if (_ControlView.GetControl() is CommonCustomClassifyListControlView)
                        {
                            CommonCustomClassifyListControlView _CommonCustomClassifyListControlView = _ControlView.GetControl() as CommonCustomClassifyListControlView;
                            if (_CommonCustomClassifyListControlView.Classify != null && _CommonCustomClassifyListControlView.Classify.Equals(_Classify))
                            {
                                _ControlView.Focus();
                                return;
                            }
                        }
                    }
                }

                CommonCustomClassifyListControlView ctlControlView = new CommonCustomClassifyListControlView();
                ctlControlView.SetApplication(this.m_Application);
                ctlControlView.Classify = _Classify;

                ControlView view = new ControlView(this.m_Application, ctlControlView, _Classify.Name, _Classify.GetIcon16());
                this.m_Application.Views.Load(view, ViewDockOptions.Left);
            }
        }
        private void DeviceSearchMenuItem_Click(object sender, EventArgs e)
        {
            foreach (ViewBase _View in this.m_Application.Views)
            {
                if (_View is ControlView)
                {
                    ControlView _ControlView = _View as ControlView;
                    if (_ControlView.GetControl() is DeviceSearchControlView)
                    {
                        _ControlView.Focus();
                        return;
                    }
                }
            }

            DeviceSearchControlView ctlDeviceSearch = new DeviceSearchControlView();

            ctlDeviceSearch.SetAccount(this.m_Account);
            ctlDeviceSearch.SetApplication(this.m_Application);
            ControlView view = new ControlView(this.m_Application, ctlDeviceSearch, "设备搜索", Properties.Resources.DeviceSearch16);

            this.m_Application.Views.Load(view, ViewDockOptions.Left);
        }
Beispiel #3
0
        private void DeviceListMenuItem_Click(object sender, EventArgs e)
        {
            foreach (ViewBase _View in this.m_Application.Views)
            {
                if (_View is ControlView)
                {
                    ControlView _ControlView = _View as ControlView;
                    if (_ControlView.GetControl() is DeviceListControlView)
                    {
                        _ControlView.Focus();
                        return;
                    }
                }
            }

            DeviceListControlView ctlDeviceList = new DeviceListControlView();

            ctlDeviceList.SetAccount(this.m_Account);
            ctlDeviceList.SetApplication(this.m_Application);
            ControlView view = new ControlView(this.m_Application, ctlDeviceList, "设备列表", null);

            this.m_Application.Views.Load(view, ViewDockOptions.Left);
        }