• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Package.ProjectElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.VisualStudio.Package.ProjectElement的典型用法代码示例。如果您正苦于以下问题:C# ProjectElement类的具体用法?C# ProjectElement怎么用?C# ProjectElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProjectElement类属于Microsoft.VisualStudio.Package命名空间,在下文中一共展示了ProjectElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: HierarchyItemNode

        /// <include file='doc\HierarchyItem.uex' path='docs/doc[@for="HierarchyItemNode.HierarchyItemNode"]/*' />
        /// <summary>
        /// constructor for the HierarchyItemNode
        /// </summary>
        /// <param name="root"></param>
        /// <param name="type"></param>
        /// <param name="strDirectoryPath"></param>
        public HierarchyItemNode(Project root, HierarchyNodeType type, ProjectElement e)
		{
            this.projectMgr = root;
            this.nodeType = type;
			this.itemNode = e;
			this.hierarchyId = this.projectMgr.ItemIdMap.Add(this);
        }
开发者ID:hesam,项目名称:SketchSharp,代码行数:14,代码来源:HierarchyItem.cs


示例2: WixReferenceNode

        // =========================================================================================
        // Constructors
        // =========================================================================================

        /// <summary>
        /// Initializes a new instance of the <see cref="WixReferenceNode"/> class.
        /// </summary>
        /// <param name="root">The root <see cref="WixProjectNode"/> that contains this node.</param>
        /// <param name="element">The element that contains MSBuild properties.</param>
        protected WixReferenceNode(WixProjectNode root, ProjectElement element)
            : base(root, element)
        {
            string includeValue = this.ItemNode.GetMetadata(ProjectFileConstants.Include);
            bool referenceNameNotPresent = String.IsNullOrEmpty(this.ItemNode.GetMetadata(ProjectFileConstants.Name));
            string newReferenceName = includeValue;

            if (String.IsNullOrEmpty(this.ItemNode.GetMetadata(ProjectFileConstants.HintPath)))
            {
                this.ItemNode.SetMetadata(ProjectFileConstants.HintPath, includeValue);
            }

            if (includeValue.Contains(Path.DirectorySeparatorChar.ToString()))
            {
                this.ItemNode.Rename(Path.GetFileNameWithoutExtension(includeValue));
                newReferenceName = Path.GetFileNameWithoutExtension(includeValue);
            }

            if (referenceNameNotPresent)
            {
                // this will fail if the node was included from a targets file
                try
                {
                    this.ItemNode.SetMetadata(ProjectFileConstants.Name, newReferenceName);
                }
                catch
                {
                }
            }
        }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:39,代码来源:WixReferenceNode.cs


示例3: ProjectReferenceNode

        /// <summary>
        /// Constructor for the ReferenceNode. It is called when the project is reloaded, when the project element representing the refernce exists. 
        /// </summary>
        public ProjectReferenceNode(ProjectNode root, ProjectElement element)
            : base(root, element)
        {
            this.referencedProjectRelativePath = this.ItemNode.GetMetadata(ProjectFileConstants.Include);
            Debug.Assert(!String.IsNullOrEmpty(this.referencedProjectRelativePath), "Could not retrive referenced project path form project file");

            string guidString = this.ItemNode.GetMetadata(ProjectFileConstants.Project);

            // Continue even if project setttings cannot be read.
            try
            {
                this.referencedProjectGuid = new Guid(guidString);

                this.buildDependency = new BuildDependency(this.ProjectMgr, this.referencedProjectGuid);
                this.ProjectMgr.AddBuildDependency(this.buildDependency);
            }
            finally
            {
                Debug.Assert(this.referencedProjectGuid != Guid.Empty, "Could not retrive referenced project guidproject file");

                this.ReferencedProjectName = this.ItemNode.GetMetadata(ProjectFileConstants.Name);

                Debug.Assert(!String.IsNullOrEmpty(this.referencedProjectName), "Could not retrive referenced project name form project file");
            }

            Uri uri = new Uri(this.ProjectMgr.BaseURI.Uri, this.referencedProjectRelativePath);

            if (uri != null)
            {
                this.referencedProjectFullPath = Microsoft.VisualStudio.Shell.Url.Unescape(uri.LocalPath, true);
            }
        }
开发者ID:zooba,项目名称:wix3,代码行数:35,代码来源:ProjectReferenceNode.cs


示例4: WixFolderNode

        public WixFolderNode(WixProjectNode root, string directoryPath, ProjectElement element, bool isNonMemberItem)
            : base(root, directoryPath, element)
        {
            this.isNonMemberItem = isNonMemberItem;

            // Folders do not participate in SCC.
            base.ExcludeNodeFromScc = true;
        }
开发者ID:bullshock29,项目名称:Wix3.6Toolset,代码行数:8,代码来源:WixFolderNode.cs


示例5: AssemblyReferenceNode

        /// <summary>
        /// Constructor for the ReferenceNode
        /// </summary>
        public AssemblyReferenceNode(ProjectNode root, ProjectElement e)
            : base(root, e)
        {
            this.GetPathNameFromProjectFile();

            string include = this.ItemNode.GetMetadata(ProjectFileConstants.Include);

            CreateFromAssemblyName(new System.Reflection.AssemblyName(include));
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:12,代码来源:AssemblyReferenceNode.cs


示例6: Output

        /// <summary>
        /// Constructor for IVSOutput2 implementation
        /// </summary>
        /// <param name="projectManager">Project that produce this output</param>
        /// <param name="configuration">Configuration that produce this output</param>
        /// <param name="outputAssembly">MSBuild generated item corresponding to the output assembly (by default, these would be of type MainAssembly</param>
        public Output(ProjectNode projectManager, ProjectConfig configuration, ProjectElement outputAssembly)
        {
            if (projectManager == null)
                throw new ArgumentNullException("projectManager");
            if (configuration == null)
                throw new ArgumentNullException("configuration");
            if (outputAssembly == null)
                throw new ArgumentNullException("outputAssembly");

            project = projectManager;
            projectCfg = configuration;
            output = outputAssembly;
        }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:19,代码来源:output.cs


示例7: ComReferenceNode

        /// <summary>
        /// Constructor for the ComReferenceNode. 
        /// </summary>
        public ComReferenceNode(ProjectNode root, ProjectElement element)
            : base(root, element)
        {
            this.typeName = this.ItemNode.GetMetadata(ProjectFileConstants.Include);
            string typeGuidAsString = this.ItemNode.GetMetadata(ProjectFileConstants.Guid);
            if (typeGuidAsString != null)
            {
                this.typeGuid = new Guid(typeGuidAsString);
            }

            this.majorVersionNumber = this.ItemNode.GetMetadata(ProjectFileConstants.VersionMajor);
            this.minorVersionNumber = this.ItemNode.GetMetadata(ProjectFileConstants.VersionMinor);
            this.lcid = this.ItemNode.GetMetadata(ProjectFileConstants.Lcid);
            this.SetProjectItemsThatRelyOnReferencesToBeResolved(false);
            this.SetInstalledFilePath();
        }
开发者ID:einaregilsson,项目名称:Process-Language-Runtime,代码行数:19,代码来源:ComReferenceNode.cs


示例8: CreateProjectReferenceNode

 /// <summary>
 /// Creates a project reference node given an existing project element.
 /// </summary>
 protected virtual ProjectReferenceNode CreateProjectReferenceNode(ProjectElement element)
 {
     return new ProjectReferenceNode(this.ProjectMgr, element);
 }
开发者ID:zooba,项目名称:wix3,代码行数:7,代码来源:referencecontainernode.cs


示例9: CreateComReferenceNode

 /// <summary>
 /// Creates a com reference node from the project element.
 /// </summary>
 protected virtual ComReferenceNode CreateComReferenceNode(ProjectElement reference)
 {
     return new ComReferenceNode(this.ProjectMgr, reference);
 }
开发者ID:zooba,项目名称:wix3,代码行数:7,代码来源:referencecontainernode.cs


示例10: CreateAssemblyReferenceNode

        /// <summary>
        /// Creates an assembly refernce node from a project element.
        /// </summary>
        protected virtual AssemblyReferenceNode CreateAssemblyReferenceNode(ProjectElement element)
        {
            AssemblyReferenceNode node = null;
            try
            {
                node = new AssemblyReferenceNode(this.ProjectMgr, element);
            }
            catch (ArgumentNullException e)
            {
                Trace.WriteLine("Exception : " + e.Message);
            }
            catch (FileNotFoundException e)
            {
                Trace.WriteLine("Exception : " + e.Message);
            }
            catch (BadImageFormatException e)
            {
                Trace.WriteLine("Exception : " + e.Message);
            }
            catch (FileLoadException e)
            {
                Trace.WriteLine("Exception : " + e.Message);
            }
            catch (System.Security.SecurityException e)
            {
                Trace.WriteLine("Exception : " + e.Message);
            }

            return node;
        }
开发者ID:zooba,项目名称:wix3,代码行数:33,代码来源:referencecontainernode.cs


示例11: WixFileNode

 public WixFileNode(WixProjectNode root, ProjectElement element, bool isNonMemberItem)
     : base(root, element)
 {
     this.isNonMemberItem = isNonMemberItem;
 }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:5,代码来源:WixFileNode.cs


示例12: NestedProjectNode

 public NestedProjectNode(ProjectNode root, ProjectElement element)
     : base(root, element)
 {
     this.IsExpanded = true;
 }
开发者ID:bullshock29,项目名称:Wix3.6Toolset,代码行数:5,代码来源:nestedprojectnode.cs


示例13: ReferenceNode

 /// <summary>
 /// constructor for the ReferenceNode
 /// </summary>
 protected ReferenceNode(ProjectNode root, ProjectElement e)
     : base(root,e)
 {
     this.ExcludeNodeFromScc = true;
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:8,代码来源:ReferenceNode.cs


示例14: FileNode

 /// <summary>
 /// Constructor for the FileNode
 /// </summary>
 /// <param name="root">Root of the hierarchy</param>
 /// <param name="e">Associated project element</param>
 public FileNode(ProjectNode root, ProjectElement e)
     : base(root, e)
 {
     if (this.ProjectMgr.NodeHasDesigner(this.ItemNode.GetMetadata(ProjectFileConstants.Include)))
     {
         this.HasDesigner = true;
     }
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:13,代码来源:FileNode.cs


示例15: LoadReferencesFromBuildProject

        /// <summary>
        /// Adds references to this container from a MSBuild project.
        /// </summary>
        public void LoadReferencesFromBuildProject(MSBuild.Project buildProject)
        {
            foreach (string referenceType in SupportedReferenceTypes)
            {
                MSBuild.BuildItemGroup refererncesGroup = buildProject.GetEvaluatedItemsByName(referenceType);

                bool isAssemblyReference = referenceType == ProjectFileConstants.Reference;
                // If the project was loaded for browsing we should still create the nodes but as not resolved.
                if (this.ProjectMgr.HasPassedSecurityChecks && isAssemblyReference && this.ProjectMgr.Build(MsBuildTarget.ResolveAssemblyReferences) != MSBuildResult.Successful)
                {
                    continue;
                }

                foreach (MSBuild.BuildItem item in refererncesGroup)
                {
                    ProjectElement element = new ProjectElement(this.ProjectMgr, item, false);

                    ReferenceNode node = CreateReferenceNode(referenceType, element);

                    if (node != null)
                    {
                        // Make sure that we do not want to add the item twice to the ui hierarchy
                        // We are using here the UI representation of the Node namely the Caption to find that out, in order to
                        // avoid different representation problems.
                        // Example :<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
                        //		  <Reference Include="EnvDTE80" />
                        bool found = false;
                        for (HierarchyNode n = this.FirstChild; n != null && !found; n = n.NextSibling)
                        {
                            if (String.Compare(n.Caption, node.Caption, StringComparison.OrdinalIgnoreCase) == 0)
                            {
                                found = true;
                            }
                        }

                        if (!found)
                        {
                            this.AddChild(node);
                        }
                    }
                }
            }
        }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:46,代码来源:referencecontainernode.cs


示例16: FolderNode

		/// <summary>
		/// Constructor for the FolderNode
		/// </summary>
		/// <param name="root">Root node of the hierarchy</param>
		/// <param name="relativePath">relative path from root i.e.: "NewFolder1\\NewFolder2\\NewFolder3</param>
		/// <param name="element">Associated project element</param>
		public FolderNode(ProjectNode root, string relativePath, ProjectElement element)
			: base(root, element)
		{
			this.VirtualNodeName = relativePath.TrimEnd('\\');
		}
开发者ID:bullshock29,项目名称:Wix3.6Toolset,代码行数:11,代码来源:foldernode.cs


示例17: WixExtensionReferenceNode

 // =========================================================================================
 // Constructors
 // =========================================================================================
 /// <summary>
 /// Initializes a new instance of the <see cref="WixExtensionReferenceNode"/> class.
 /// </summary>
 /// <param name="root">The root <see cref="WixProjectNode"/> that contains this node.</param>
 /// <param name="element">The element that contains MSBuild properties.</param>
 public WixExtensionReferenceNode(WixProjectNode root, ProjectElement element)
     : base(root, element)
 {
     this.InitializeFileChangeEvents();
 }
开发者ID:zooba,项目名称:wix3,代码行数:13,代码来源:WixExtensionReferenceNode.cs


示例18: CreateReferenceNode

        /// <summary>
        /// Creates a new <see cref="WixLibraryReferenceNode"/> if the element is a "WixLibraryReference",
        /// a new <see cref="WixExtensionReferenceNode"/> if the element is a "WixExtensionReference",
        /// or a new <see cref="WixProjectReferenceNode"/> if the element is a "ProjectReference".
        /// </summary>
        /// <param name="referenceType">The type of reference to be created.</param>
        /// <param name="element">The MSBuild element pertaining to the reference.</param>
        /// <returns>A <see cref="WixLibraryReferenceNode"/>, <see cref="WixExtensionReferenceNode"/>,
        /// or a <see cref="WixProjectReferenceNode"/>.</returns>
        protected override ReferenceNode CreateReferenceNode(string referenceType, ProjectElement element)
        {
            switch (element.ItemName)
            {
                case WixProjectFileConstants.WixLibrary:
                    return new WixLibraryReferenceNode(this.ProjectMgr as WixProjectNode, element);

                case WixProjectFileConstants.WixExtension:
                    return new WixExtensionReferenceNode(this.ProjectMgr as WixProjectNode, element);
            }

            return base.CreateReferenceNode(referenceType, element);
        }
开发者ID:zooba,项目名称:wix3,代码行数:22,代码来源:WixReferenceContainerNode.cs


示例19: CreateProjectReferenceNode

 /// <summary>
 /// Creates a project reference node given an existing project element.
 /// </summary>
 /// <param name="element">MSBuild properties for the project.</param>
 /// <returns>A <see cref="WixProjectReferenceNode"/> instance.</returns>
 protected override ProjectReferenceNode CreateProjectReferenceNode(ProjectElement element)
 {
     return new WixProjectReferenceNode(this.ProjectMgr as WixProjectNode, element);
 }
开发者ID:zooba,项目名称:wix3,代码行数:9,代码来源:WixReferenceContainerNode.cs


示例20: CreateReferenceNode

        protected virtual ReferenceNode CreateReferenceNode(string referenceType, ProjectElement element)
        {
            ReferenceNode node = null;
            if (referenceType == ProjectFileConstants.COMReference)
            {
                node = this.CreateComReferenceNode(element);
            }
            else if (referenceType == ProjectFileConstants.Reference)
            {
                node = this.CreateAssemblyReferenceNode(element);
            }
            else if (referenceType == ProjectFileConstants.ProjectReference)
            {
                node = this.CreateProjectReferenceNode(element);
            }

            return node;
        }
开发者ID:zooba,项目名称:wix3,代码行数:18,代码来源:referencecontainernode.cs



注:本文中的Microsoft.VisualStudio.Package.ProjectElement类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Package.ProjectNode类代码示例发布时间:2022-05-26
下一篇:
C# Package.ParseRequest类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap