/// <summary> /// This function is the callback used to execute a command when the a menu item is clicked. /// See the Initialize method to see how the menu item is associated to this function using /// the OleMenuCommandService service and the MenuCommand class. /// </summary> private void MenuItemCallback(object sender, EventArgs e) { IVsHierarchy hierarchy; uint itemid; if (!IsSingleProjectItemSelection(out hierarchy, out itemid)) { return; } // ReSharper disable once SuspiciousTypeConversion.Global var vsProject = (IVsProject)hierarchy; string projectFullPath; if (vsProject != null && ErrorHandler.Failed(vsProject.GetMkDocument(VSConstants.VSITEMID_ROOT, out projectFullPath))) { return; } // get the name of the item string itemFullPath = null; if (vsProject != null && ErrorHandler.Failed(vsProject.GetMkDocument(itemid, out itemFullPath))) { return; } var selectedProjectItem = GetProjectItemFromHierarchy(hierarchy, itemid); if (selectedProjectItem == null) { return; } if (itemFullPath != null) { ItemFullPath = itemFullPath; Hierarchy = hierarchy; TenonModal.InvokedFromBrowser = false; TenonModal customdialog = new TenonModal(); customdialog.ShowModal(); } }
public void SendText(string message) { if (!TenonAccessibilityCheckerPackage.TenonBrowserLinkSetting) { TenonModal.InvokedFromBrowser = true; TenonModal.RenderedContent = message; // close all the open TenonAccessibility dialogs CloseAllWindows(); var dialog = new TenonModal(); TenonAccessibilityCheckerPackage.ItemFullPath = string.Empty; TenonAccessibilityCheckerPackage.Hierarchy = null; dialog.Topmost = true; TenonAccessibilityCheckerPackage.ItemFullPath = connectionURL; TenonAccessibilityCheckerPackage.Hierarchy = projectHierarchy; //Show the tenon modal browser dialog dialog.ShowDialog(); } }
[BrowserLinkCallback] // This method can be called from JavaScript public void SendText(string message) { if (!TenonAccessibilityCheckerPackage.TenonBrowserLinkSetting) { TenonModal.InvokedFromBrowser = true; TenonModal.RenderedContent = message; // close all the open TenonAccessibility dialogs CloseAllWindows(); var dialog = new TenonModal(); TenonAccessibilityCheckerPackage.ItemFullPath = string.Empty; TenonAccessibilityCheckerPackage.Hierarchy = null; dialog.Topmost = true; TenonAccessibilityCheckerPackage.ItemFullPath = connectionURL; TenonAccessibilityCheckerPackage.Hierarchy = projectHierarchy; //Show the tenon modal browser dialog dialog.ShowDialog(); } }
/// <summary> /// This function is the callback used to execute a command when the a menu item is clicked. /// See the Initialize method to see how the menu item is associated to this function using /// the OleMenuCommandService service and the MenuCommand class. /// </summary> private void MenuItemCallback(object sender, EventArgs e) { IVsHierarchy hierarchy; uint itemid; if (!IsSingleProjectItemSelection(out hierarchy, out itemid)) return; // ReSharper disable once SuspiciousTypeConversion.Global var vsProject = (IVsProject)hierarchy; string projectFullPath; if (vsProject != null && ErrorHandler.Failed(vsProject.GetMkDocument(VSConstants.VSITEMID_ROOT, out projectFullPath))) return; // get the name of the item string itemFullPath = null; if (vsProject != null && ErrorHandler.Failed(vsProject.GetMkDocument(itemid, out itemFullPath))) return; var selectedProjectItem = GetProjectItemFromHierarchy(hierarchy, itemid); if (selectedProjectItem == null) return; if (itemFullPath != null) { ItemFullPath = itemFullPath; Hierarchy = hierarchy; TenonModal.InvokedFromBrowser = false; TenonModal customdialog = new TenonModal(); customdialog.ShowModal(); } }