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


C# Project.ProjectElement類代碼示例

本文整理匯總了C#中Microsoft.VisualStudio.Project.ProjectElement的典型用法代碼示例。如果您正苦於以下問題:C# ProjectElement類的具體用法?C# ProjectElement怎麽用?C# ProjectElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ProjectElement類屬於Microsoft.VisualStudio.Project命名空間,在下文中一共展示了ProjectElement類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateAssemblyReferenceNode

        /// <summary>
        /// Creates an assembly reference node from a project element.
        /// </summary>
        /// <returns>An assembly reference node</returns>
        protected override AssemblyReferenceNode CreateAssemblyReferenceNode(ProjectElement element)
        {
            SandcastleBuilderAssemblyReferenceNode node = null;

            try
            {
                node = new SandcastleBuilderAssemblyReferenceNode(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:julianhaslinger,項目名稱:SHFB,代碼行數:35,代碼來源:SandcastleBuilderReferenceContainerNode.cs

示例2: CreateApplicationReferenceNode

        /// <summary>
        /// Creates a file reference from the project configuration data.
        /// </summary>
        /// <param name="element">Project configuration element</param>
        /// <returns>Application reference node</returns>
        protected ApplicationReferenceNode CreateApplicationReferenceNode(ProjectElement element)
        {
            try
            {
                return new ApplicationReferenceNode( 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 null;
        }
開發者ID:Rantanen,項目名稱:M-Files-SDK,代碼行數:34,代碼來源:ApplicationReferenceContainerNode.cs

示例3: XSharpFileNode

 /// <summary>
 /// Initializes a new instance of the <see cref="XSharpFileNode"/> class.
 /// </summary>
 /// <param name="root">The project node.</param>
 /// <param name="e">The project element node.</param>
 internal XSharpFileNode(ProjectNode root, ProjectElement e)
     : base(root, e)
 {
     //
     this.UpdateHasDesigner();
     this.UpdateItemType();
 }
開發者ID:X-Sharp,項目名稱:XSharpPublic,代碼行數:12,代碼來源:XSharpFileNode.cs

示例4: BooFileNode

 public BooFileNode(ProjectNode root, ProjectElement e)
     : base(root, e)
 {
     results = new CompileResults(() => Url, GetCompilerInput, ()=>GlobalServices.LanguageService.GetLanguagePreferences().TabSize);
     languageService = (BooLanguageService)GetService(typeof(BooLanguageService));
     hidden = true;
 }
開發者ID:pshiryaev,項目名稱:Boo-Plugin,代碼行數:7,代碼來源:BooFileNode.cs

示例5: NemerleFileNode

        public NemerleFileNode(ProjectNode root, ProjectElement element, bool isNonMemberItem)
            : base(root, element)
        {
            IsNonMemberItem = isNonMemberItem;

            _selectionChangedListener =
                    new SelectionElementValueChangedListener(
                            new ServiceProvider((IOleServiceProvider)root.GetService(typeof(IOleServiceProvider))), root);

            _selectionChangedListener.Init();

            //((FileNodeProperties)NodeProperties).OnCustomToolChanged		  += OnCustomToolChanged;
            //((FileNodeProperties)NodeProperties).OnCustomToolNameSpaceChanged += OnCustomToolNameSpaceChanged;

            // HasDesigner property is not virtual, so we have to set it up in the ctor.
            InferHasDesignerFromSubType();

            var url = this.Url;
            var ext = Path.GetExtension(url);

            //if (ext.Equals(".resx", StringComparison.InvariantCultureIgnoreCase))
            //{
            //  // TODO: ”далить это дело, так как теперь оповещени¤ должны быть реализованы в Engine.
            //  url = Path.GetFullPath(this.Url);
            //  var path = Path.GetDirectoryName(url);
            //  var name = Path.GetFileName(url);
            //  _watcher = new FileSystemWatcher(path, name);
            //  _watcher.NotifyFilter = NotifyFilters.LastWrite;
            //  _watcher.Changed += watcher_Changed;
            //  _watcher.EnableRaisingEvents = true;
            //}
        }
開發者ID:vestild,項目名稱:nemerle,代碼行數:32,代碼來源:NemerleFileNode.cs

示例6: ProjectReferenceNode

        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:Rfvgyhn,項目名稱:Boo-Plugin,代碼行數:32,代碼來源:ProjectReferenceNode.cs

示例7: BaseSearchPathNode

 public BaseSearchPathNode(CommonProjectNode project, string path, ProjectElement element)
     : base(project, path, element)
 {
     _project = project;
     this.VirtualNodeName = path;
     this.ExcludeNodeFromScc = true;
 }
開發者ID:TerabyteX,項目名稱:main,代碼行數:7,代碼來源:BaseSearchPathNode.cs

示例8: NemerleFolderNode

        public NemerleFolderNode(ProjectNode root, string directoryPath, ProjectElement element, bool isNonMemberItem)
            : base(root, directoryPath, element)
        {
            IsNonMemberItem = isNonMemberItem;

            // Folders do not participate in SCC.
            ExcludeNodeFromScc = true;
        }
開發者ID:vestild,項目名稱:nemerle,代碼行數:8,代碼來源:NemerleFolderNode.cs

示例9: 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 element)
     : base(root, element)
 {
     if(this.ProjectMgr.NodeHasDesigner(this.ItemNode.GetMetadata(ProjectFileConstants.Include)))
     {
         this.HasDesigner = true;
     }
 }
開發者ID:ldematte,項目名稱:BlenXVSP,代碼行數:13,代碼來源:FileNode.cs

示例10: CreateFolderNode

 /// <summary>
 /// Create a folder node based on absolute folder path.
 /// </summary>
 public new virtual FolderNode CreateFolderNode(string absFolderPath)
 {
     //This code builds folder node in such a way that it won't be added to the
     //project as build item and the project won't be go dirty.
     var prjItem = GetExistingItem(absFolderPath) ?? BuildProject.AddItem("None", absFolderPath)[0];
     ProjectElement prjElem = new ProjectElement(this, prjItem, false);
     return new CommonFolderNode(this, absFolderPath, prjElem);
 }
開發者ID:TerabyteX,項目名稱:main,代碼行數:11,代碼來源:DirectoryBasedProjectNode.cs

示例11: JarReferenceNode

        public JarReferenceNode(ProjectNode root, ProjectElement element)
            : base(root, element)
        {
            Contract.Requires<ArgumentNullException>(root != null, "root");
            Contract.Requires<ArgumentNullException>(element != null, "element");

            _projectRelativeFilePath = element.Item.EvaluatedInclude;
            ProjectManager.ItemIdMap.UpdateCanonicalName(this);
        }
開發者ID:Kav2018,項目名稱:JavaForVS,代碼行數:9,代碼來源:JarReferenceNode.cs

示例12: CreateFileNode

        public override FileNode CreateFileNode(ProjectElement item)
        {
            var node = new Mac65ProjectFileNode(this, item);

            node.OleServiceProvider.AddService(typeof(EnvDTE.Project), new OleServiceProvider.ServiceCreatorCallback(CreateServices), false);
            node.OleServiceProvider.AddService(typeof(ProjectItem), node.ServiceCreator, false);
            node.OleServiceProvider.AddService(typeof(VSProject), new OleServiceProvider.ServiceCreatorCallback(CreateServices), false);

            return node;
        }
開發者ID:JakubLinhart,項目名稱:Mac65,代碼行數:10,代碼來源:Mac65ProjectNode.cs

示例13: Output

        /// <summary>
        /// Constructor for IVSOutput2 implementation
        /// </summary>
        /// <param name="projectManager">Project 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, ProjectElement outputAssembly)
        {
            if(projectManager == null)
                throw new ArgumentNullException("projectManager");
            if(outputAssembly == null)
                throw new ArgumentNullException("outputAssembly");

            project = projectManager;
            output = outputAssembly;
        }
開發者ID:vestild,項目名稱:nemerle,代碼行數:15,代碼來源:Output.cs

示例14: 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)
        {
            if (relativePath == null)
            {
                throw new ArgumentNullException("relativePath");
            }

            this.VirtualNodeName = relativePath.TrimEnd('\\');
        }
開發者ID:TerabyteX,項目名稱:main,代碼行數:16,代碼來源:FolderNode.cs

示例15: JarReferenceNode

        public JarReferenceNode(ProjectNode root, ProjectElement element)
            : base(root, element)
        {
            if (root == null)
                throw new ArgumentNullException("root");
            if (element == null)
                throw new ArgumentNullException("element");

            _projectRelativeFilePath = element.Item.EvaluatedInclude;
            ProjectManager.ItemIdMap.UpdateCanonicalName(this);
        }
開發者ID:modulexcite,項目名稱:DartVS,代碼行數:11,代碼來源:JarReferenceNode.cs


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