コード例 #1
0
        private void SelectControl(object ControlName)
        {
            notselectInpu = ControlName.ToString();
            string selectInpu = InpuModelSelector.Instance.LoadedInpu;
            switch (ControlName.ToString())
            {
                case "ИнПУ-1":
                    {
                        //if ((selectInpu == string.Empty) && (!Inpu1ModelSelect.ValueState))
                        {
                            InpuModelSelector.Instance.LoadedInpu = "ИнПУ-2";
                            if (vInPu == null) vInPu = new View_InPU();
                            vInPu.DataContext = inwin1;
                            vInPu.RUSKlapan.Visibility = Visibility.Hidden;
                            Workspaces = vInPu;
                            WagoIO.Instance.TypePult = 1;
                        }
                    } break;
                case "ИнПУ-2":
                    {
                        //if ((selectInpu == string.Empty) && (!Inpu2ModelSelect.ValueState))
                        {
                            InpuModelSelector.Instance.LoadedInpu = "ИнПУ-1";
                            if (vInPu == null) vInPu = new View_InPU();
                            vInPu.DataContext = inwin2;
                            vInPu.RUSKlapan.Visibility = Visibility.Hidden; Workspaces = vInPu;
                            WagoIO.Instance.TypePult = 2;
                        }
                    } break;
                case "ЭПК-ПСА": { if (_epksa == null) _epksa = new View_EPKPSA(); Workspaces = _epksa; } break;
                case "РПВ-1,2": { if (_rpv == null) _rpv = new View_RPV(); Workspaces = _rpv; } break;
                case "ЭПК-РД": { if (_epkrd == null) _epkrd = new View_EPKRD(); Workspaces = _epkrd; } break;
                case "ЭПК-П": { if (_epkp == null) _epkp = new View_EPKP(); Workspaces = _epkp; } break;
                case "КР-3": { if (_kr3 == null) _kr3 = new View_KR3(); Workspaces = _kr3; } break;
                case "БРУС": { if (_brus == null) _brus = new View_BRUS(); Workspaces = _brus; } break;
                case "ЗДВ": { if (_zdv == null) _zdv = new View_ZDV(); Workspaces = _zdv; } break;
                case "ДСД": { if (_dsd == null) _dsd = new View_DSD(); Workspaces = _dsd; } break;
                case "Нептун Прав": { if (_nprav == null) _nprav = new View_NeptunP2(); Workspaces = _nprav; } break;
                case "КР-2": { if (_xsasa == null) _xsasa = new View_XSASA(); Workspaces = _xsasa; } break;
                case "Люк СА БО": { if (_lyk == null) _lyk = new View_Lyk(); Workspaces = _lyk; } break;
                case "БР1": { if (_br1 == null) _br1 = new View_BR1(); Workspaces = _br1; } break;
                case "РАП-10": { if (_rap10 == null) _rap10 = new View_RAP10(); Workspaces = _rap10; } break;
                case "РАП-7": { if (_rap7 == null) _rap7 = new View_RAP7(); Workspaces = _rap7; } break;
                case "КСД-БО": { if (_ksdbo == null) _ksdbo = new View_KSDBO(); Workspaces = _ksdbo; } break;
                case "КВД БО-СУ": { if (_kvdbo == null) _kvdbo = new View_KVDBO(); Workspaces = _kvdbo; } break;
                case "БРУБ": { if (_brub == null) _brub = new View_BRUB(); Workspaces = _brub; } break;
                case "Мановак.": { if (_manov == null) _manov = new View_Manov(); Workspaces = _manov; } break;
                case "КР1": { if (_kr1 == null) _kr1 = new View_KR1(); Workspaces = _kr1; } break;
                case "БАПД": { if (_bapd == null) _bapd = new View_BAPD(); Workspaces = _bapd; } break;
                case "БАПД ": { if (_bapd == null) _bapd = new View_BAPD(); Workspaces = _bapd; } break;
                case "Згл.КСД-СУ": { if (_zgl == null) _zgl = new View_ZGL(); Workspaces = _zgl; } break;
                case "ВСЕ": { if (_allValves == null) _allValves = new View_AllValves(); Workspaces = _allValves; } break;
                // case "РУС": { if (_rus == null) _rus = new View_RUS(); Workspaces = _rus; } break;
                case "РУС":
                    {

                        if ((Workspaces == vInPu) && (vInPu != null))
                        {
                            if (vInPu.RUSKlapan.Visibility == Visibility.Hidden)
                                vInPu.RUSKlapan.Visibility = Visibility.Visible;
                            else
                                vInPu.RUSKlapan.Visibility = Visibility.Hidden;

                        }
                        else
                        {

                            if (_rus == null) _rus = new View_RUS();
                            Workspaces = _rus;
                        }

                    } break;

            }
            //  base.OnPropertyChanged("Workspaces");
        }
コード例 #2
0
        private void SelectControl(object ControlName)
        {
            notselectInpu = ControlName.ToString();
            string selectInpu = InpuModelSelector.Instance.LoadedInpu;

            switch (ControlName.ToString())
            {
            case "ЭПК-ПСА": { if (_epksa == null)
                              {
                                  _epksa = new View_EPKPSA();
                              }
                              Workspaces = _epksa; } break;

            case "РПВ-1,2": { if (_rpv == null)
                              {
                                  _rpv = new View_RPV();
                              }
                              Workspaces = _rpv; } break;

            case "ЭПК-РД": { if (_epkrd == null)
                             {
                                 _epkrd = new View_EPKRD();
                             }
                             Workspaces = _epkrd; } break;

            case "ЭПК-П": { if (_epkp == null)
                            {
                                _epkp = new View_EPKP();
                            }
                            Workspaces = _epkp; } break;

            case "КР-3": { if (_kr3 == null)
                           {
                               _kr3 = new View_KR3();
                           }
                           Workspaces = _kr3; } break;

            case "БРУС": { if (_brus == null)
                           {
                               _brus = new View_BRUS();
                           }
                           Workspaces = _brus; } break;

            case "ЗДВ": { if (_zdv == null)
                          {
                              _zdv = new View_ZDV();
                          }
                          Workspaces = _zdv; } break;

            case "ДСД": { if (_dsd == null)
                          {
                              _dsd = new View_DSD();
                          }
                          Workspaces = _dsd; } break;

            case "КР-2": { if (_xsasa == null)
                           {
                               _xsasa = new View_XSASA();
                           }
                           Workspaces = _xsasa; } break;

            case "Люк СА БО": { if (_lyk == null)
                                {
                                    _lyk = new View_Lyk();
                                }
                                Workspaces = _lyk; } break;

            case "БР1": { if (_br1 == null)
                          {
                              _br1 = new View_BR1();
                          }
                          Workspaces = _br1; } break;

            case "РАП-10": { if (_rap10 == null)
                             {
                                 _rap10 = new View_RAP10();
                             }
                             Workspaces = _rap10; } break;

            case "РАП-7": { if (_rap7 == null)
                            {
                                _rap7 = new View_RAP7();
                            }
                            Workspaces = _rap7; } break;

            case "КСД-БО": { if (_ksdbo == null)
                             {
                                 _ksdbo = new View_KSDBO();
                             }
                             Workspaces = _ksdbo; } break;

            case "КВД БО-СУ": { if (_kvdbo == null)
                                {
                                    _kvdbo = new View_KVDBO();
                                }
                                Workspaces = _kvdbo; } break;

            case "БРУБ": { if (_brub == null)
                           {
                               _brub = new View_BRUB();
                           }
                           Workspaces = _brub; } break;

            case "Мановак.": { if (_manov == null)
                               {
                                   _manov = new View_Manov();
                               }
                               Workspaces = _manov; } break;

            case "КР1": { if (_kr1 == null)
                          {
                              _kr1 = new View_KR1();
                          }
                          Workspaces = _kr1; } break;

            case "БАПД": { if (_bapd == null)
                           {
                               _bapd = new View_BAPD();
                           }
                           Workspaces = _bapd; } break;

            case "БАПД ": { if (_bapd == null)
                            {
                                _bapd = new View_BAPD();
                            }
                            Workspaces = _bapd; } break;

            case "Згл.КСД-СУ": { if (_zgl == null)
                                 {
                                     _zgl = new View_ZGL();
                                 }
                                 Workspaces = _zgl; } break;

            case "ВСЕ": { if (_allValves == null)
                          {
                              _allValves = new View_AllValves();
                          }
                          Workspaces = _allValves; } break;
                // case "РУС": { if (_rus == null) _rus = new View_RUS(); Workspaces = _rus; } break;
            }
            //  base.OnPropertyChanged("Workspaces");
        }