本文整理汇总了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";
}
示例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;
}
}
示例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);
}
}