当前位置: 首页>>代码示例>>C#>>正文


C# DTE2.get_Properties方法代码示例

本文整理汇总了C#中DTE2.get_Properties方法的典型用法代码示例。如果您正苦于以下问题:C# DTE2.get_Properties方法的具体用法?C# DTE2.get_Properties怎么用?C# DTE2.get_Properties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DTE2的用法示例。


在下文中一共展示了DTE2.get_Properties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTextEditorProperties

        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;

        }
开发者ID:ronlemire2,项目名称:PrismRT-CodeGen-v2.1,代码行数:29,代码来源:MyEnvDTE.cs

示例2: MDView

 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();
 }
开发者ID:rookboom,项目名称:Elucidate,代码行数:15,代码来源:MDView.xaml.cs

示例3: OnConnection

        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;
            }
        }
开发者ID:bholl,项目名称:zeroc-ice,代码行数:33,代码来源:Connect.cs


注:本文中的DTE2.get_Properties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。