public void OnButtonClick(TypeButton _tb, int num_but = 0) { switch (_tb) { case TypeButton.Next: if (NumberRoom != 0 && NumberRoom != 5) { AppRootStatic.NextRoomNavigation(); } NumberRoom++; ViewerActivWindow(); break; case TypeButton.Back: if (NumberRoom != 6 && NumberRoom != 1) { AppRootStatic.PrevRoomNavigation(); } NumberRoom--; ViewerActivWindow(); break; case TypeButton.Metodics: AppRootStatic.SetActiveUI(TypeUI.AppMenu, false); AppRootStatic.SetActiveLabel(TypeLabel.Header, false); AppRootStatic.SetActiveLabel(TypeLabel.Info, false); AppRootStatic.SetActiveUI(TypeUI.Metodic, true); oWindows = false; break; case TypeButton.CloseMetodics: AppRootStatic.SetActiveUI(TypeUI.Metodic, false); ViewerActivWindow(); break; case TypeButton.CloseApplication: AppRootStatic.SetActiveUI(TypeUI.AppMenu, false); AppRootStatic.SetActiveLabel(TypeLabel.Header, false); AppRootStatic.SetActiveLabel(TypeLabel.Info, false); AppRootStatic.SetActiveUI(TypeUI.Exit, true); oWindows = false; break; case TypeButton.YesExit: Application.Quit(); break; case TypeButton.NoExit: AppRootStatic.SetActiveUI(TypeUI.Exit, false); ViewerActivWindow(); break; case TypeButton.NextInstr: if (Instrument % 3 != 0) { return; } Instrument = (Instrument + 1) % 3; ButtonInstrument(); AppRootStatic.NextTool(); break; case TypeButton.PrevInstr: if (Instrument % 3 != 1) { return; } Instrument = (Instrument - 1) % 3; AppRootStatic.PrevuTool(); ButtonInstrument(); break; case TypeButton.Viewer: AppRootStatic.SetActiveUI(TypeUI.Metodic, false); AppRootStatic.SetActiveLabel(TypeLabel.Viewer, true); AppRootStatic.SetObjectViewer(num_but, true); ///просотр объектов!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! break; case TypeButton.CloseViewr: AppRootStatic.SetActiveUI(TypeUI.Metodic, true); AppRootStatic.SetActiveLabel(TypeLabel.Viewer, false); break; case TypeButton.Task: AppRootStatic.SetActiveLabel(TypeLabel.Task, !AppRootStatic.isActive(TypeLabel.Task)); ///задачи break; } }
private void ViewerActivWindow() { switch (NumberRoom) { case 0: AppRootStatic.SetActiveLabel(TypeLabel.Info, true); AppRootStatic.SetActiveLabel(TypeLabel.Header, true); AppRootStatic.SetActiveUI(TypeUI.AppMenu, true); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo1, false); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo2, false); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuHelp, false); AppRootStatic.SetActiveButton(TypeButton.Back, false); AppRootStatic.SetActiveButton(TypeButton.NextInstr, false); AppRootStatic.SetActiveButton(TypeButton.PrevInstr, false); AppRootStatic.SetActiveButton(TypeButton.HideInfo1, false); AppRootStatic.SetActiveButton(TypeButton.HideInfo2, false); AppRootStatic.SetActiveButton(TypeButton.HideHelper, false); AppRootStatic.SetActiveUI(TypeUI.Metodic, false); AppRootStatic.SetActiveLabel(TypeLabel.Viewer, false); AppRootStatic.SetActiveUI(TypeUI.Exit, false); AppRootStatic.SetLabelText(TypeLabel.Header, Head.Header[NumberRoom]); AppRootStatic.SetActiveLabel(TypeLabel.Task, false); AppRootStatic.SetActiveButton(TypeButton.Task, false); oWindows = true; AppRootStatic.isMoviment = false; return; case 6: AppRootStatic.SetActiveLabel(TypeLabel.Info, true); AppRootStatic.SetActiveLabel(TypeLabel.Header, true); AppRootStatic.SetActiveUI(TypeUI.AppMenu, true); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo1, false); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo2, false); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuHelp, false); AppRootStatic.SetActiveButton(TypeButton.Next, false); AppRootStatic.SetActiveButton(TypeButton.NextInstr, false); AppRootStatic.SetActiveButton(TypeButton.PrevInstr, false); AppRootStatic.SetActiveButton(TypeButton.HideInfo1, false); AppRootStatic.SetActiveButton(TypeButton.HideInfo2, false); AppRootStatic.SetActiveButton(TypeButton.HideHelper, false); AppRootStatic.SetLabelText(TypeLabel.Header, Head.Header[NumberRoom]); AppRootStatic.SetActiveLabel(TypeLabel.Task, false); AppRootStatic.SetActiveButton(TypeButton.Task, false); oWindows = true; AppRootStatic.isMoviment = false; return; default: AppRootStatic.SetActiveLabel(TypeLabel.Header, true); AppRootStatic.SetActiveUI(TypeUI.AppMenu, true); if (oWindows) { AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo1, true); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo2, true); AppRootStatic.SetActiveLabel(TypeLabel.AppMenuHelp, true); AppRootStatic.SetActiveButton(TypeButton.Back, true); AppRootStatic.SetActiveButton(TypeButton.Next, true); AppRootStatic.SetActiveButton(TypeButton.NextInstr, true); AppRootStatic.SetActiveButton(TypeButton.PrevInstr, true); AppRootStatic.SetActiveButton(TypeButton.HideInfo1, true); AppRootStatic.SetActiveButton(TypeButton.HideInfo2, true); AppRootStatic.SetActiveButton(TypeButton.HideHelper, true); AppRootStatic.SetActiveButton(TypeButton.Task, true); AppRootStatic.NormalButtonHide(); oWindows = false; } AppRootStatic.SetLabelText(TypeLabel.Header, Head.Header[NumberRoom]); AppRootStatic.SetLabelText(TypeLabel.AppMenuInfo1, Info1.Info[NumberRoom - 1]); AppRootStatic.SetLabelText(TypeLabel.AppMenuInfo2, GetStrinInfo2(Variants.Rooms[NumberRoom - 1])); AppRootStatic.SetValues(System.Convert.ToSingle(Variants.Rooms[NumberRoom - 1].ValueThermometr), System.Convert.ToSingle(Variants.Rooms[NumberRoom - 1].ValueAnimometr) / 10, System.Convert.ToSingle(Variants.Rooms[NumberRoom - 1].ValueHygrometeDry), System.Convert.ToSingle(Variants.Rooms[NumberRoom - 1].ValueHygrometeWet)); AppRootStatic.SwitchToolOff(); AppRootStatic.SetLabelText(TypeLabel.AppMenuHelp, Help.Helper[NumberRoom == 6 ? 1 : 0]); AppRootStatic.SetActiveLabel(TypeLabel.Info, false); AppRootStatic.SetActiveLabel(TypeLabel.Task, false); AppRootStatic.NormalButtonTask(); ButtonInstrument(); AppRootStatic.isMoviment = true; break; } }