本文整理汇总了C#中Microsoft.VisualStudio.Project.ProjectElement.GetMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectElement.GetMetadata方法的具体用法?C# ProjectElement.GetMetadata怎么用?C# ProjectElement.GetMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualStudio.Project.ProjectElement
的用法示例。
在下文中一共展示了ProjectElement.GetMetadata方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: JavaFolderNode
public JavaFolderNode(ProjectNode root, string relativePath, ProjectElement element)
: base(root, relativePath, element)
{
Contract.Requires(root != null);
Contract.Requires(relativePath != null);
Contract.Requires(element != null);
if (element.IsVirtual)
{
string buildAction = element.GetMetadata(ProjectFileConstants.BuildAction);
if (buildAction == ProjectFileConstants.Folder)
this.IsNonmemberItem = false;
}
}
示例2: DartFolderNode
public DartFolderNode(ProjectNode root, string relativePath, ProjectElement element)
: base(root, relativePath, element)
{
if (root == null)
throw new ArgumentNullException("root");
if (relativePath == null)
throw new ArgumentNullException("relativePath");
if (element == null)
throw new ArgumentNullException("element");
if (element.IsVirtual)
{
string buildAction = element.GetMetadata(ProjectFileConstants.BuildAction);
if (buildAction == ProjectFileConstants.Folder)
this.IsNonmemberItem = false;
}
}
示例3: CreateFileNode
/// <summary>
/// Create a file node based on an msbuild item.
/// </summary>
/// <param name="item">The msbuild item to be analyzed</param>
/// <returns>PythonFileNode or FileNode</returns>
public override FileNode CreateFileNode(ProjectElement item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
string include = item.GetMetadata(ProjectFileConstants.Include);
PythonFileNode newNode = new PythonFileNode(this, item);
newNode.OleServiceProvider.AddService(typeof(EnvDTE.Project), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
newNode.OleServiceProvider.AddService(typeof(EnvDTE.ProjectItem), newNode.ServiceCreator, false);
if (!string.IsNullOrEmpty(include) && Path.GetExtension(include).Equals(".xaml", StringComparison.OrdinalIgnoreCase))
{
//Create a DesignerContext for the XAML designer for this file
newNode.OleServiceProvider.AddService(typeof(DesignerContext), newNode.ServiceCreator, false);
}
newNode.OleServiceProvider.AddService(typeof(VSLangProj.VSProject), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
if (IsCodeFile(include))
{
newNode.OleServiceProvider.AddService(
typeof(SVSMDCodeDomProvider), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
}
return newNode;
}
示例4: CreateDependentFileNode
public override DependentFileNode CreateDependentFileNode(ProjectElement item)
{
DependentFileNode node = base.CreateDependentFileNode(item);
if (null != node)
{
string include = item.GetMetadata(ProjectFileConstants.Include);
if (IsCodeFile(include))
{
node.OleServiceProvider.AddService(
typeof(SVSMDCodeDomProvider), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
}
}
return node;
}
示例5: CreateFileNode
/// <summary>
/// Create a file node based on an msbuild item.
/// </summary>
/// <param name="item">The msbuild item to be analyzed</param>
/// <returns>NemerleFileNode or FileNode</returns>
public override FileNode CreateFileNode(ProjectElement item)
{
ErrorHelper.ThrowIsNull(item, "item");
NemerleFileNode newNode = new NemerleFileNode(this, item, item.IsVirtual);
string include = item.GetMetadata(ProjectFileConstants.Include);
var provider = newNode.OleServiceProvider;
provider.AddService(typeof(EnvDTE.Project), ProjectMgr.GetAutomationObject(), false);
provider.AddService(typeof(EnvDTE.ProjectItem), newNode.ServiceCreator, false);
provider.AddService(typeof(VSLangProj.VSProject), this.VSProject, false);
if (!string.IsNullOrEmpty(include) && Path.GetExtension(include).Equals(".xaml", StringComparison.OrdinalIgnoreCase))
{
//Create a DesignerContext for the XAML designer for this file
newNode.OleServiceProvider.AddService(typeof(DesignerContext), newNode.ServiceCreator, false);
}
if (newNode.IsFormSubType)
{
newNode.OleServiceProvider.AddService(typeof(DesignerContext), newNode.ServiceCreator, false);
}
if (item.ItemName == "Compile") // IsCodeFile(include) &&
provider.AddService(typeof(SVSMDCodeDomProvider), new NemerleVSMDProvider(newNode), false);
return newNode;
}
示例6: CreateDependentFileNode
/// <summary>
/// Create dependent file node based on an msbuild item
/// </summary>
/// <param name="item">msbuild item</param>
/// <returns>dependent file node</returns>
public override FileNode CreateDependentFileNode(ProjectElement item)
{
ErrorHelper.ThrowIsNull(item, "item");
NemerleDependentFileNode newNode = new NemerleDependentFileNode(this, item);
string include = item.GetMetadata(ProjectFileConstants.Include);
var provider = newNode.OleServiceProvider;
provider.AddService(typeof(EnvDTE.Project), ProjectMgr.GetAutomationObject(), false);
provider.AddService(typeof(EnvDTE.ProjectItem), newNode.GetAutomationObject(), false);
provider.AddService(typeof(VSLangProj.VSProject), this.VSProject, false);
if (IsCodeFile(include) && item.ItemName == "Compile")
newNode.OleServiceProvider.AddService(typeof(SVSMDCodeDomProvider),
new NemerleVSMDProvider(newNode), false);
return newNode;
}
示例7: CreateFileNode
/// <summary>
/// Creates the file node.
/// </summary>
/// <param name="item">The project element item.</param>
/// <returns></returns>
public override FileNode CreateFileNode(ProjectElement item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
XSharpFileNode node = new XSharpFileNode(this, item);
var provider = node.OleServiceProvider;
// Use the CreateServices of the Project
provider.AddService(typeof(EnvDTE.Project), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
// Use the CreateServices of the Node
provider.AddService(typeof(ProjectItem), node.ServiceCreator, false);
// Use the CreateServices of the Project
provider.AddService(typeof(VSProject), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
//provider.AddService(typeof(VSProject), this.VSProject, false);
string include = item.GetMetadata(ProjectFileConstants.Include);
if (!string.IsNullOrEmpty(include) && XSharpFileNode.GetFileType(include) == XSharpFileType.XAML)
{
//Create a DesignerContext for the XAML designer for this file
// Use the CreateServices of the Node
provider.AddService(typeof(DesignerContext), node.ServiceCreator, false);
}
if (node.IsFormSubType)
{
// Use the CreateServices of the Node
provider.AddService(typeof(DesignerContext), node.ServiceCreator, false);
}
if (this.IsCodeFile(include) && item.ItemName == "Compile")
provider.AddService(typeof(SVSMDCodeDomProvider), new XSharpVSMDProvider(node), false);
return node;
}