本文整理匯總了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;
}