partial void OnButtonPauseAddPressed(Foundation.NSObject sender) { if (__MainViewModel.ConnectionState != ServiceState.Connected) { return; } if (__MainViewModel.PauseStatus == MainViewModel.PauseStatusEnum.Paused) { if (__PausePopoverMenu == null) { __PausePopoverMenu = new NSPopover(); NSViewController pausePopoverMenuController = new NSViewController(); pausePopoverMenuController.View = GuiPausePopoverView; __PausePopoverMenu.ContentViewController = pausePopoverMenuController; __PausePopoverMenu.Behavior = NSPopoverBehavior.Transient; } if (__PausePopoverMenu.Shown) { __PausePopoverMenu.Close(); } else { __PausePopoverMenu.Show(PauseAddButton.Bounds, PauseAddButton, NSRectEdge.MaxYEdge);// MinYEdge); } } }
public void closePopOver() { if (_popover != null) { _popover.Close(); } }
// Called when the user quits public override void WillTerminate(NSNotification notification) { // Teardown resources statusItem.Visible = false; statusItem.Dispose(); statusMenu.Dispose(); if (popover.Shown) { popover.Close(); } popover.Dispose(); Application.Current.Quit(); }
public async Task OpenPublicationContentAtSearchItem(SearchDisplayResult resultItem) { parentPopover.Close(); int tocID = resultItem.TocId; var winController = Utility.GetMainWindowConroller(); PublicationsDataManager.SharedInstance.CurrentPublication = PublicationsDataManager.SharedInstance.GetCurrentPublicationByBookID(BookID); var section = resultItem.isDocument ? resultItem.SnippetContent : resultItem.GuideCardTitle; var title = resultItem.isDocument ? resultItem.Head : resultItem.TocTitle; var header = resultItem.isDocument ? resultItem.HeadType + "," + resultItem.HeadSequence : null; winController.ContentVC.TOCDataManager.UpdateSearchMatchWordList(SearchResultsData.FoundWordList, SearchResultsData.KeyWordList, section, header); // var resultItemData = new SearchNavigationData (); // resultItemData.FoundWordList.AddRange(SearchResultsData.KeyWordList); // resultItemData.SearchItem.ContentType = resultItem.ContentType; // resultItemData.SearchItem.Head = resultItem.Head; // resultItemData.SearchItem.HeadSequence = resultItem.HeadSequence; // resultItemData.SearchItem.HeadType = resultItem.HeadType; // resultItemData.SearchItem.isDocument = resultItem.isDocument; // resultItemData.SearchItem.SnippetContent = resultItem.SnippetContent; await winController.ContentVC.HighlightContentView(tocID, true); }
private void ShowLoginErrorPopover(PopoverContentView contentView, NSView positioningView = null) { if (__LoginPopoverErrorInfo != null) { __LoginPopoverErrorInfo.Close(); __LoginPopoverErrorInfo = null; } // create and show popover __LoginPopoverErrorInfo = new NSPopover(); NSViewController popoverControllerConnectionError = new NSViewController(); contentView.BackgroundColor = NSColor.FromRgb(251, 56, 65); popoverControllerConnectionError.View = contentView; __LoginPopoverErrorInfo.ContentViewController = popoverControllerConnectionError; __LoginPopoverErrorInfo.Behavior = NSPopoverBehavior.Transient; if (positioningView == null) { positioningView = GuiTextViewUser; } __LoginPopoverErrorInfo.Show(GuiTextViewUser.Bounds, positioningView, NSRectEdge.MinYEdge); }
void DestroyPopover(object sender, EventArgs args) { if (popover != null) { popover.Close(); } popover = null; }
void DestroyPopover() { oldLayer = null; if (popover != null) { popover.Close(); } popover = null; }
partial void Search(Foundation.NSObject sender) { UIErrorHelper.CheckedExec(delegate() { DoValidateControls(); RecordName = RecordNameField.StringValue; RecordType = VMDNSUtilityService.GetRecordType(RecordTypeOptionsField.TitleOfSelectedItem); ZoneName = ZoneNameField.StringValue; parent.Close(); }); }
async public Task OpenContentPageAtSearchPageItem(PageSearchItem resultItem) { parentPopover.Close(); int tocID = resultItem.TOCID; var winController = Utility.GetMainWindowConroller(); winController.ContentVC.searchPageNumber = SearchField.StringValue; await winController.ContentVC.HighlightContentView(tocID, false); }
public async Task OpenPublicationContentAtHistory(RecentHistoryItem recentHistoryItem) { parentPopover.Close(); int bookID = recentHistoryItem.BookId; var docID = recentHistoryItem.DOCID; int tocID = await PublicationContentUtil.Instance.GetTOCIDByDocId(bookID, docID); var winController = Utility.GetMainWindowConroller(); await winController.UpdateContentView(bookID, tocID); }
private void MenuAction() { if (_pop.Shown) { _pop.Close(); } else { _pop.Show(_statusItem.Button.Frame, _statusItem.Button, NSRectEdge.MaxYEdge); } }
partial void DoneClick(NSObject sender) { if (string.IsNullOrEmpty(TagNameTF.StringValue)) { return; } this.TagColorName = TagNameTF.StringValue; if (ViewController is EditTagsViewController) { var viewController = (EditTagsViewController)ViewController; viewController.AddTagToTableView(this.TagColorValue, this.TagColorName); viewController.SwitchTagView(1, string.Empty, string.Empty, Guid.Empty); } else { AddTagToDB(); ParentPopover.Close(); } }
void LoadNote(bool withHistory = true) { if (HasUnautosavedChanges) { SaveData(); } _loadingFromString = true; if (currentNote == null) { return; } InvalidateRestorableState(); Logger.Debug("Translating Note:{0} \n Note text before Translator {1}", currentNoteID, currentNote.Text); var content = translator.From(currentNote); var beginIndx = content.IndexOf(currentNote.Title, StringComparison.CurrentCulture); if (beginIndx != -1) // it's possible that some notes do not have any content { var len = currentNote.Title.Length; content = content.Remove(beginIndx, (len + 1)); // +1 to remove the NewLine char after the title } // replace the system newlines with HTML new lines content = content.Replace("\n", "<br>"); // strip NewLine LR types.May cause problems. Needs more testing noteWebView.MainFrame.LoadHtmlString(WikiLinks(content), new NSUrl(AppDelegate.BaseUrlPath)); if (withHistory) { if (currentHistoryPosition < history.Count - 1) { history.RemoveRange(currentHistoryPosition + 1, history.Count - (currentHistoryPosition + 1)); } history.Add(currentNoteID); currentHistoryPosition = history.Count - 1; } // Make the note editable Editable(true); UpdateBackForwardSensitivity(); _loadingFromString = false; if (popover != null) { popover.Close(); } Logger.Debug("Finished loading Note ID {0} \n Note Body '{1}'", currentNoteID, content); }
void View_OnButtonPausePressed(object sender, EventArgs e) { if (__MainViewModel.ConnectionState != ServiceState.Connected) { return; } if (__MainViewModel.PauseStatus == MainViewModel.PauseStatusEnum.Resumed) { if (__PausePopoverMenu == null) { __PausePopoverMenu = new NSPopover(); NSViewController pausePopoverMenuController = new NSViewController(); pausePopoverMenuController.View = GuiPausePopoverView; __PausePopoverMenu.ContentViewController = pausePopoverMenuController; __PausePopoverMenu.Behavior = NSPopoverBehavior.Transient; } if (__PausePopoverMenu.Shown) { __PausePopoverMenu.Close(); } else { __PausePopoverMenu.Show(GuiPauseButton.Bounds, GuiPauseButton, NSRectEdge.MinYEdge); } } else { if (__MainViewModel.PauseStatus == MainViewModel.PauseStatusEnum.Paused) { __MainViewModel.DisconnectCommand.Execute(null); } } }
/// <summary> /// Show popover (pressed Information button) /// </summary> partial void GuiInformationButtonPressed(Foundation.NSObject sender) { __GuiPopoverConnectionInfo = new NSPopover() { Behavior = NSPopoverBehavior.Transient, Appearance = NSPopoverAppearance.HUD }; __ProofsViewModel.UpdateCommand.Execute(null); UpdateInformationPopover(); if (__GuiPopoverConnectionInfo.Shown) { __GuiPopoverConnectionInfo.Close(); } else { __GuiPopoverConnectionInfo.Show(GuiInformationButton.Bounds, GuiInformationButton, NSRectEdge.MinYEdge); } }
private void ShowPopoverVPNisConnected() { // create and show popover if (__GuiPopoverVPNisConnected == null) { __GuiPopoverVPNisConnected = new NSPopover(); NSViewController popoverController = new NSViewController(); popoverController.View = GuiUnbaleToChangeWhenConnectedView; __GuiPopoverVPNisConnected.ContentViewController = popoverController; __GuiPopoverVPNisConnected.Behavior = NSPopoverBehavior.Transient; __GuiPopoverVPNisConnected.Appearance = NSPopoverAppearance.HUD; // auto-close after 4 seconds inteval __TimerAutoclosePopover = new Timer() { Interval = 4000, AutoReset = false }; __TimerAutoclosePopover.Elapsed += (theSender, evt) => { InvokeOnMainThread(() => { try { if (__GuiPopoverVPNisConnected != null && __GuiPopoverVPNisConnected.Shown) { __GuiPopoverVPNisConnected.Close(); } } catch { } }); }; } __TimerAutoclosePopover.Stop(); __GuiPopoverVPNisConnected.Show(View.Bounds, View, NSRectEdge.MaxYEdge); __TimerAutoclosePopover.Start(); }
public void Hide() { popover.Close(); }
void DestroyPopover() { oldLayer = null; popover.Close(); }
//api with IndexViewController public void OpenPublicationAtTocNode(SearchDisplayResult tocNode) { parentPopover.Close(); }
void GuiFirewallSwitchControl_ValueChanged(object sender, EventArgs e) { if (__MainViewModel != null) { if (__MainViewModel.IsKillSwitchEnabled != GuiFirewallSwitchControl.Value) { __MainViewModel.IsKillSwitchEnabled = GuiFirewallSwitchControl.Value; } } // If VPN is ON but Firewall is off - show notification: // e.g."We recommend you to keep it always turned on when you are connected to VPN." CustomSwitchControl switchCtrl = sender as CustomSwitchControl; if (__MainViewModel.IsKillSwitchEnabled == false && __MainViewModel.ConnectionState != ServiceState.Disconnected && switchCtrl != null) { if (__GuiPopoverFirewallIsOff == null) { // create and show popover __GuiPopoverFirewallIsOff = new NSPopover(); NSViewController popoverController = new NSViewController(); popoverController.View = GuiFirewallOffInfoView; __GuiPopoverFirewallIsOff.ContentViewController = popoverController; __GuiPopoverFirewallIsOff.Behavior = NSPopoverBehavior.Transient; __GuiPopoverFirewallIsOff.Appearance = NSPopoverAppearance.HUD; // auto-close after 6 seconds inteval __TimerAutoClosePopoverFirewall = new Timer() { Interval = 6000, AutoReset = false }; __TimerAutoClosePopoverFirewall.Elapsed += (theSender, evt) => { InvokeOnMainThread(() => { try { if (__GuiPopoverFirewallIsOff != null && __GuiPopoverFirewallIsOff.Shown) { __GuiPopoverFirewallIsOff.Close(); } } catch { } }); }; } __TimerAutoClosePopoverFirewall.Stop(); __GuiPopoverFirewallIsOff.Show(switchCtrl.Bounds, switchCtrl, NSRectEdge.MinYEdge); __TimerAutoClosePopoverFirewall.Start(); } else { if (__GuiPopoverFirewallIsOff != null) { __GuiPopoverFirewallIsOff.Close(); } } }