當前位置: 首頁>>代碼示例>>C#>>正文


C# ProjectElement.GetMetadata方法代碼示例

本文整理匯總了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);
        }
開發者ID:omnimark,項目名稱:PTVS,代碼行數:18,代碼來源:PythonReferenceContainerNode.cs

示例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);
        }
開發者ID:jsschultz,項目名稱:PTVS,代碼行數:21,代碼來源:PythonReferenceContainerNode.cs

示例3: TrackedFileNode

 public TrackedFileNode(RustProjectNode root, ProjectElement elm)
     : base(root, elm, elm.GetMetadata(ProjectFileConstants.Include))
 {
 }
開發者ID:whuthj,項目名稱:VisualRust,代碼行數:4,代碼來源:TrackedFileNode.cs

示例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;
        }
開發者ID:vairam-svs,項目名稱:poshtools,代碼行數:35,代碼來源:CommonProjectNode.cs


注:本文中的Microsoft.VisualStudioTools.Project.ProjectElement.GetMetadata方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。