本文整理汇总了C#中Microsoft.VisualStudioTools.Project.ProjectElement.GetMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectElement.GetMetadata方法的具体用法?C# ProjectElement.GetMetadata怎么用?C# ProjectElement.GetMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualStudioTools.Project.ProjectElement
的用法示例。
在下文中一共展示了ProjectElement.GetMetadata方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateReferenceNode
protected override ReferenceNode CreateReferenceNode(string referenceType, ProjectElement element) {
if (referenceType == ProjectFileConstants.Reference) {
string pyExtension = element.GetMetadata(PythonConstants.PythonExtension);
if (!String.IsNullOrWhiteSpace(pyExtension)) {
return new PythonExtensionReferenceNode((PythonProjectNode)ProjectMgr, element, pyExtension);
}
} else if (referenceType == ProjectFileConstants.WebPiReference) {
return new WebPiReferenceNode(
ProjectMgr,
element,
element.GetMetadata("Feed"),
element.GetMetadata("ProductId"),
element.GetMetadata("FriendlyName")
);
}
return base.CreateReferenceNode(referenceType, element);
}
示例2: CreateReferenceNode
protected override ReferenceNode CreateReferenceNode(string referenceType, ProjectElement element) {
if (referenceType == ProjectFileConstants.Reference) {
if (Path.GetExtension(element.Url).Equals(".pyd", StringComparison.OrdinalIgnoreCase)) {
return new DeprecatedReferenceNode(
ProjectMgr,
element,
element.GetMetadata(ProjectFileConstants.Include),
Strings.PydReferenceDeprecated
);
}
} else if (referenceType == ProjectFileConstants.WebPiReference) {
return new DeprecatedReferenceNode(
ProjectMgr,
element,
element.GetMetadata("FriendlyName"),
Strings.WebPIReferenceDeprecated
);
}
return base.CreateReferenceNode(referenceType, element);
}
示例3: TrackedFileNode
public TrackedFileNode(RustProjectNode root, ProjectElement elm)
: base(root, elm, elm.GetMetadata(ProjectFileConstants.Include))
{
}
示例4: CreateFileNode
/// <summary>
/// Create a file node based on an msbuild item.
/// </summary>
/// <param name="item">The msbuild item to be analyzed</param>
public override FileNode CreateFileNode(ProjectElement item) {
Utilities.ArgumentNotNull("item", item);
CommonFileNode newNode;
if (IsCodeFile(item.GetFullPathForElement())) {
newNode = CreateCodeFileNode(item);
} else {
newNode = CreateNonCodeFileNode(item);
}
string link = item.GetMetadata(ProjectFileConstants.Link);
if (!String.IsNullOrWhiteSpace(link) ||
!CommonUtils.IsSubpathOf(ProjectHome, item.GetFullPathForElement())) {
newNode.SetIsLinkFile(true);
}
string include = item.GetMetadata(ProjectFileConstants.Include);
newNode.OleServiceProvider.AddService(typeof(EnvDTE.Project),
new OleServiceProvider.ServiceCreatorCallback(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(CreateServices), false);
return newNode;
}