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