Пример #1
0
        protected ITallyEditPanel GetEditView(TallySetupStratum_Base stratum)
        {
            if (stratum == null)
            {
                return(null);
            }
            if (stratum is TallySetupStratum)
            {
                if (_standardTallyEditPanel == null)
                {
                    _standardTallyEditPanel            = new TallyEditPanel();
                    _standardTallyEditPanel.GetHotKeys = this._tallyEditPanel_GetHotKeys;
                    _standardTallyEditPanel.Dock       = DockStyle.Fill;
                }

                _standardTallyEditPanel.Stratum = (TallySetupStratum)stratum;
                return(_standardTallyEditPanel);
            }
            else if (stratum is FixCNTTallySetupStratum)
            {
                if (_myfixCNTTallyEditPanel == null)
                {
                    _myfixCNTTallyEditPanel      = new FixCNTTallyEditPanel();
                    _myfixCNTTallyEditPanel.Dock = DockStyle.Fill;
                }
                _myfixCNTTallyEditPanel.Stratum = (FixCNTTallySetupStratum)stratum;
                return(_myfixCNTTallyEditPanel);
            }
            else
            {
                throw new InvalidOperationException();
            }
        }
        protected ITallyEditPanel GetEditView(TallySetupStratum_Base stratum)
        {
            if (stratum == null) { return null; }
            if (stratum is TallySetupStratum)
            {
                if (_standardTallyEditPanel == null)
                {
                    _standardTallyEditPanel = new TallyEditPanel();
                    _standardTallyEditPanel.GetHotKeys = this._tallyEditPanel_GetHotKeys;
                    _standardTallyEditPanel.Dock = DockStyle.Fill;
                }

                _standardTallyEditPanel.Stratum = (TallySetupStratum)stratum;
                return _standardTallyEditPanel;
            }
            else if (stratum is FixCNTTallySetupStratum)
            {
                if (_myfixCNTTallyEditPanel == null)
                {
                    _myfixCNTTallyEditPanel = new FixCNTTallyEditPanel();
                    _myfixCNTTallyEditPanel.Dock = DockStyle.Fill;
                }
                _myfixCNTTallyEditPanel.Stratum = (FixCNTTallySetupStratum)stratum;
                return _myfixCNTTallyEditPanel;
            }
            else
            {
                throw new InvalidOperationException();
            }
        }