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


C# DTE.get_Properties方法代码示例

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


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

示例1: RelativeLineNumbers

        /// <summary>
        /// Creates a <see cref="RelativeLineNumbers"/> for a given <see cref="IWpfTextView"/>.
        /// </summary>
        /// <param name="textView">The <see cref="IWpfTextView"/> to attach the margin to.</param>
        public RelativeLineNumbers(IWpfTextView textView, IEditorFormatMap formatMap, DTE dte)
        {
            _textView = textView;
            _formatMap = formatMap;
            _dte = dte;
            _lineMap = new Dictionary<int, int>();

            _canvas = new Canvas();
            this.Children.Add(_canvas);

            this.ClipToBounds = true;

            _textView.Caret.PositionChanged += new EventHandler<CaretPositionChangedEventArgs>(OnCaretPositionChanged);
            _textView.ViewportHeightChanged += (sender, args) => DrawLineNumbers();
            _textView.LayoutChanged += new EventHandler<TextViewLayoutChangedEventArgs>(OnLayoutChanged);
            _formatMap.FormatMappingChanged += (sender, args) => DrawLineNumbers();
            EnvDTE.Properties props = _dte.get_Properties("Relative Line Numbers", "Cursor Line Number");
            _mixedMode = (bool)props.Item("OptionBool").Value;

            this.ToolTip = "To customize Relative Line Numbers select:\n\n" +
                           "  Tools -> Options -> Fonts and Colors -> Relative Line Numbers\n" +
                           "  Tools -> Options -> Fonts and Colors -> Relative Line Numbers Cursor Line\n" +
                           "  Tools -> Options -> Relative Line Numbers -> Cursor Line Number\n";
        }
开发者ID:jimmymain,项目名称:RelativeLineNumbers,代码行数:28,代码来源:RelativeLineNumbers.cs

示例2: GetMSBuildOutputVerbositySetting

 /// <summary>
 /// Returns the value of the VisualStudio MSBuildOutputVerbosity setting.
 /// </summary>
 /// <param name="dte">The VisualStudio instance.</param>
 /// <remarks>
 /// 0 is Quiet, while 4 is diagnostic.
 /// </remarks>
 private static int GetMSBuildOutputVerbositySetting(DTE dte)
 {
     var properties = dte.get_Properties("Environment", "ProjectsAndSolution");
     var value = properties.Item("MSBuildOutputVerbosity").Value;
     if (value is int)
     {
         return (int)value;
     }
     else
     {
         return 0;
     }
 }
开发者ID:kumavis,项目名称:NuGet,代码行数:20,代码来源:PackageRestorer.cs

示例3: Initialize

 /// <summary>
 /// Initialization of the package; this method is called right after the package is sited, so this is the place
 /// where you can put all the initialization code that rely on services provided by VisualStudio.
 /// </summary>
 protected override void Initialize()
 {
     Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
     base.Initialize();
     dte = GetGlobalService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
     _props = dte.get_Properties("Remove Trailing Whitespaces", "Options");
     rdt = new RunningDocumentTable(this);
     rdt.Advise(new RunningDocTableEvents(this));
     var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
     if (mcs != null)
     {
         // Create the command for the menu item.
         CommandID menuCommandID = new CommandID(
             GuidList.guidRemoveTrailingWhitespacesCmdSet, (int)PkgCmdIDList.cmdIdRemoveTrailingWhitespaces);
         OleMenuCommand menuItem = new OleMenuCommand(onRemoveTrailingWhitespacesPressed, menuCommandID);
         menuItem.BeforeQueryStatus += onBeforeQueryStatus;
         mcs.AddCommand(menuItem);
     }
 }
开发者ID:Predelnik,项目名称:RemoveTrailingWhitespaces,代码行数:23,代码来源:RemoveTrailingWhitespacesPackage.cs


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