void BeforeQueryStatusCallback(Object sender, EventArgs e) { // gets called from a XAML file being edited by the WPF Designer editor. var result = AssemblyAssistant.GetProjectType(this.Dte2.ActiveDocument.ActiveWindow.Project); var cmd = (OleMenuCommand)sender; // future proofing when Visual Studio changes the editor for Xamarin cmd.Visible = result == ProjectType.Wpf || result == ProjectType.Xamarin || result == ProjectType.Uwp || result == ProjectType.Silverlight; }
void BeforeQueryStatusCallback(Object sender, EventArgs e) { // gets called from any code file editor. // will need to modify this after VS changes the editor for Xamarin XAML files. var result = AssemblyAssistant.GetProjectType(this.Dte2.ActiveDocument.ActiveWindow.Project); var cmd = (OleMenuCommand)sender; cmd.Visible = result == ProjectType.Xamarin && Path.GetExtension(this.Dte2.ActiveDocument.FullName) == ".xaml"; }
public DataFormGenerator(DTE2 dte2) { Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); if (dte2 == null) { throw new ArgumentNullException(nameof(dte2)); } _dte2 = dte2; _activeProject = dte2.ActiveDocument.ActiveWindow.Project; _projectType = AssemblyAssistant.GetProjectType(dte2.ActiveDocument.ActiveWindow.Project); _projectFrameworkVersion = AssemblyAssistant.GetProjectFrameworkVersion(dte2.ActiveDocument.ActiveWindow.Project); }
public DataFormGenerator(DTE2 dte2, Project activeProject) { _dte2 = dte2; _activeProject = activeProject; if (dte2 == null) { throw new ArgumentNullException(nameof(dte2)); } if (activeProject == null) { throw new ArgumentNullException(nameof(activeProject)); } _projectType = AssemblyAssistant.GetProjectType(dte2.ActiveDocument.ActiveWindow.Project); _projectFrameworkVersion = AssemblyAssistant.GetProjectFrameworkVersion(dte2.ActiveDocument.ActiveWindow.Project); }