public static List <string> GetTextEditorProperties() { System.Type t = Connect.settingsObject.VisualStudioVersion; object obj = Activator.CreateInstance(t, true); dte2 = (DTE2)obj; sln2 = (Solution2)dte2.Solution; // http://msdn.microsoft.com/en-us/library/ms165641(v=vs.90).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1 // Nested node doesn't work in C# as done in article with VB. // Tried different separators but have not found the right C# syntax. // Other links: // http://msdn.microsoft.com/en-us/library/ms165644.aspx // http://www.mztools.com/articles/2005/mz2005008.aspx // http://dotnet.dzone.com/articles/structure-visual-studio?page=0,1 EnvDTE.Properties txtEdCS = dte2.get_Properties("TextEditor", "CSharp - Formatting"); EnvDTE.Property prop = null; string msg = null; List <string> propList = new List <string>(); foreach (EnvDTE.Property temp in txtEdCS) { prop = temp; msg = ("Prop Name: " + prop.Name + " VALUE: " + prop.Value) + "\n"; propList.Add(msg); } return(propList); }
public static List<string> GetTextEditorProperties() { System.Type t = Connect.settingsObject.VisualStudioVersion; object obj = Activator.CreateInstance(t, true); dte2 = (DTE2)obj; sln2 = (Solution2)dte2.Solution; // http://msdn.microsoft.com/en-us/library/ms165641(v=vs.90).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1 // Nested node doesn't work in C# as done in article with VB. // Tried different separators but have not found the right C# syntax. // Other links: // http://msdn.microsoft.com/en-us/library/ms165644.aspx // http://www.mztools.com/articles/2005/mz2005008.aspx // http://dotnet.dzone.com/articles/structure-visual-studio?page=0,1 EnvDTE.Properties txtEdCS = dte2.get_Properties("TextEditor", "CSharp - Formatting"); EnvDTE.Property prop = null; string msg = null; List<string> propList = new List<string>(); foreach (EnvDTE.Property temp in txtEdCS) { prop = temp; msg = ("Prop Name: " + prop.Name + " VALUE: " + prop.Value) + "\n"; propList.Add(msg); } return propList; }
public DoxygenToolsOptionsControl(DoxygenToolsOptionsBase optionsPage, DTE2 vsEnvironment) { // Check if on Ui thread Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); this.optionsPage = optionsPage; InitializeComponent(); // Get the visual studio default font Properties propertiesList = vsEnvironment.get_Properties("FontsAndColors", "TextEditor"); int fontSize = (short)propertiesList.Item("FontSize").Value; string fontFamily = (string)propertiesList.Item("FontFamily").Value; // Init input text richTextInput.Font = new Font(fontFamily, fontSize, FontStyle.Regular); richTextInput.ForeColor = Color.FromArgb(87, 166, 74); richTextInput.Text = optionsPage.Format; highlightVariables(richTextInput); // Set info text colors richTextInfo.Font = new Font(fontFamily, fontSize, FontStyle.Regular); richTextInfo.ForeColor = Color.Black; richTextInfo.Text = richTextInfo.Text.Replace(":", ":\n" + string.Join("\n", optionsPage.additionalKeys)); highlightVariables(richTextInfo, false); }
public override IEnumerable <INodeFactory> GetNodeChildren(IContext context) { var factories = new List <INodeFactory>(); var props = _dte.get_Properties(_category, _page); foreach (EnvDTE.Property prop in props) { INodeFactory factory = null; try { if (null != prop && null != prop.Object && prop.Object is FontsAndColorsItems) { FontsAndColorsItems fci = prop.Object as FontsAndColorsItems; factory = new FontsAndColorsPropertyNodeFactory(_dte, fci); } } catch { } if (null == factory) { factory = new PropertyNodeFactory(prop); } factories.Add(factory); } return(factories); }
public MDView() { InitializeComponent(); dte = Package.GetGlobalService(typeof(DTE)) as DTE2; events = dte.Events; docEvents = events.DocumentEvents; dte.Events.WindowEvents.WindowActivated += OnWindowActivated; docEvents.DocumentSaved += OnDocumentSaved; browser.LoadCompleted += OnBrowserLoadCompleted; var properties = dte.get_Properties("FontsAndColors", "TextEditor"); var fontsAndColorsItems = (EnvDTE.FontsAndColorsItems)properties.Item("FontsAndColorsItems").Object; colorableItems = fontsAndColorsItems.Item("Plain Text") as ColorableItems; UpdateMarkdown(""); Unloaded += (s, o) => (formatter as IDisposable).Dispose(); }
public static FontsAndColorsItems GetTextEditorFontAndColorsItems(DTE2 dte) { EnvDTE.Properties props = dte.get_Properties("FontsAndColors", "TextEditor"); return(props.Item("FontsAndColorsItems").Object as FontsAndColorsItems); }
public IEnumerable <ShellProperty> get_Properties(string Category, string Page) { return(from Property prop in _dte.get_Properties(Category, Page) select new ShellProperty(prop)); }
public Properties get_Properties(string Category, string Page) { return(_dte.get_Properties(Category, Page)); }
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) { try { _applicationObject = (DTE2)application; _addInInstance = (AddIn)addInInst; if(connectMode == ext_ConnectMode.ext_cm_Startup || connectMode == ext_ConnectMode.ext_cm_CommandLine) { if(_builder == null) { // // This property is set to false to avoid VC++ "no matching rule" dialog, the property // doesn't exist in VS2010 // #if VS2008 EnvDTE.Properties props = _applicationObject.get_Properties("Projects", "VCGeneral"); EnvDTE.Property prop = props.Item("ShowNoMatchingRuleDlg"); prop.Value = false; #endif _builder = new Builder(); _builder.commandLine = connectMode == ext_ConnectMode.ext_cm_CommandLine; _builder.init(_applicationObject, connectMode, _addInInstance); } } } catch(Exception ex) { Util.unexpectedExceptionWarning(ex); throw; } }