partial void OnIntroBtnServersConnectPressed(Foundation.NSObject sender) { __InotroductionStage = IntroductionStageEnum.Finished; GuiIntroductionPanelServers.Close(); __MainViewModel.ConnectCommand.Execute(null); }
/// <summary> /// Show next introduction step /// </summary> private void ShowNextIntoductionStep() { NSPanel panelToShow = null; switch (__InotroductionStage) { case IntroductionStageEnum.Starting: panelToShow = GuiIntroductionPanelWelcome; __InotroductionStage = IntroductionStageEnum.Welcome; break; case IntroductionStageEnum.Welcome: panelToShow = GuiIntroductionPanelConnectBtn; __InotroductionStage = IntroductionStageEnum.ConnectBtn; break; case IntroductionStageEnum.ConnectBtn: panelToShow = GuiIntroductionPanelFirewall; __InotroductionStage = IntroductionStageEnum.Firewall; break; case IntroductionStageEnum.Firewall: panelToShow = GuiIntroductionPanelServers; __InotroductionStage = IntroductionStageEnum.Servers; break; case IntroductionStageEnum.Servers: __InotroductionStage = IntroductionStageEnum.Finished; break; } // fit transparent view to window size GuiTopTransparentView.Frame = MainPageView.Frame; // request View to redraw ((PageView)GuiTopTransparentView).SetDrawer(this); NSApplication.SharedApplication.StopModal(); if (panelToShow != null) { InitializeDialogPositions(); panelToShow.ParentWindow = Window; panelToShow.MakeKeyAndOrderFront(this); NSApplication.SharedApplication.RunModalForWindow(panelToShow); } }
/// <summary> /// Initialize introduction functionality /// </summary> private void StartIntroductionIfNecesary() { if (!NSThread.IsMain) { InvokeOnMainThread(() => StartIntroductionIfNecesary()); return; } if (__Settings.IsFirstIntroductionDone) { return; } if (__InotroductionStage != IntroductionStageEnum.NotStarted) { return; } try { __Settings.IsFirstIntroductionDone = true; __Settings.Save(); } catch (Exception ex) { Logging.Info(string.Format("{0}", ex)); return; } GuiIntroductionPanelWelcome.WillClose += OnIntroductionPanel_WillClose; GuiIntroductionPanelConnectBtn.WillClose += OnIntroductionPanel_WillClose; GuiIntroductionPanelFirewall.WillClose += OnIntroductionPanel_WillClose; GuiIntroductionPanelServers.WillClose += OnIntroductionPanel_WillClose; UpdateIntroductionApperiance(); __InotroductionStage = IntroductionStageEnum.Starting; ShowNextIntoductionStep(); }
partial void OnIntroBtnServersClosePressed(Foundation.NSObject sender) { __InotroductionStage = IntroductionStageEnum.Finished; GuiIntroductionPanelServers.Close(); }
partial void OnIntroBtnFirewallClosePressed(Foundation.NSObject sender) { __InotroductionStage = IntroductionStageEnum.Finished; GuiIntroductionPanelFirewall.Close(); }