Exemple #1
0
 /// <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);
 }
Exemple #2
0
        /// <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);
        }
Exemple #3
0
 /// <summary>
 /// constructor for the HierarchyItemNode
 /// </summary>
 /// <param name="root"></param>
 /// <param name="type"></param>
 /// <param name="strDirectoryPath"></param>
 public HierarchyItemNode(ProjectManager root, HierarchyNodeType type, XmlElement e){
   this.projectMgr = root;
   this.nodeType = type;
   this.xmlNode = e;
   this.hierarchyId = this.projectMgr.ItemIdMap.Add(this);      
 }
Exemple #4
0
        const int MAX_PATH = 260; // windef.h

        /// <include file='doc\Hierarchy.uex' path='docs/doc[@for="HierarchyNode.HierarchyNode"]/*' />
        public HierarchyNode(){
            this.nodeType = HierarchyNodeType.Root;
        }
Exemple #5
0
        /// <include file='doc\Hierarchy.uex' path='docs/doc[@for="HierarchyNode.HierarchyNode2"]/*' />
        /// <summary>
        /// note that here the directorypath needs to end with a backslash...
        /// </summary>
        /// <param name="root"></param>
        /// <param name="type"></param>
        /// <param name="strDirectoryPath"></param>
        public HierarchyNode(Project root, HierarchyNodeType type, string strDirectoryPath){
            Uri uriBase;
            Uri uriNew;
            string relPath;
            // the path is an absolute one, need to make it relative to the project for further use in the xml document
            uriNew = new Uri(strDirectoryPath);
            uriBase = new Uri(root.projFile.BaseURI);
#if WHIDBEY
            relPath = uriBase.MakeRelativeUri(uriNew).ToString();
#else
            relPath = uriBase.MakeRelative(uriNew);
#endif
            relPath = relPath.Replace("/", "\\");

            this.projectMgr = root;
            this.nodeType = type;
            // we need to create an dangling node... just for this abstract folder type
            this.xmlNode = this.projectMgr.projFile.CreateElement("Folder");
            this.xmlNode.SetAttribute("RelPath", relPath);

            this.hierarchyId = this.projectMgr.ItemIdMap.Add(this);
        }
Exemple #6
0
 /// <include file='doc\Project.uex' path='docs/doc[@for="Project.CreateNode1"]/*' />
 protected virtual HierarchyNode CreateNode(Project root, HierarchyNodeType type, string direcoryPath)
 {
     return new HierarchyNode(root, type, direcoryPath);
 }
Exemple #7
0
        /// <include file='doc\Project.uex' path='docs/doc[@for="Project.CreateNode"]/*' />
        protected virtual HierarchyNode CreateNode(Project root, HierarchyNodeType type, ProjectElement item)
        {
            if (type == HierarchyNodeType.File)
            {
                HierarchyItemNode hi = new HierarchyItemNode(this, type, item);

                if (NodeHasDesigner(item.GetAttribute("Include")))
                {
                    hi.HasDesigner = true;
                }

                return hi;
            }

            return new HierarchyNode(root, type, item);
        }
Exemple #8
0
 /// <summary>
 /// constructor for the HierarchyItemNode
 /// </summary>
 /// <param name="root"></param>
 /// <param name="type"></param>
 /// <param name="strDirectoryPath"></param>
 public HierarchyItemNode(ProjectManager root, HierarchyNodeType type, XmlElement e){
   this.projectMgr = root;
   this.nodeType = type;
   this.xmlNode = e;
   this.hierarchyId = this.projectMgr.ItemIdMap.Add(this);      
 }
Exemple #9
0
        const int MAX_PATH = 260; // windef.h
        /// <include file='doc\Hierarchy.uex' path='docs/doc[@for="HierarchyNode.HierarchyNode"]/*' />
        public HierarchyNode()
		{
            this.nodeType = HierarchyNodeType.Root;
			this.IsExpanded = true;
		}
Exemple #10
0
        /// <include file='doc\Hierarchy.uex' path='docs/doc[@for="HierarchyNode.HierarchyNode2"]/*' />
        /// <summary>
        /// note that here the directory path needs to end with a backslash...
        /// </summary>
        /// <param name="root"></param>
        /// <param name="type"></param>
        /// <param name="strDirectoryPath"></param>
        public HierarchyNode(Project root, HierarchyNodeType type, string strDirectoryPath)
		{
            Uri uriBase;
            Uri uriNew;
            string relPath;
			if (type == HierarchyNodeType.RefFolder
				|| type == HierarchyNodeType.Folder)
			{
				relPath = strDirectoryPath;
				this.virtualNodeName = strDirectoryPath;
			}
			else
			{
				// the path is an absolute one, need to make it relative to the project for further use
				uriNew = new Uri(strDirectoryPath);
				uriBase = root.BaseURI.Uri;
				relPath = uriBase.MakeRelative(uriNew);
				relPath = relPath.Replace("/", "\\");
			}

			this.projectMgr = root;
            this.nodeType = type;
            // we need to create an dangling node... just for this abstract folder type
			this.itemNode = this.projectMgr.AddFolderNodeToProject(relPath);

			this.hierarchyId = this.projectMgr.ItemIdMap.Add(this);
        }
Exemple #11
0
    /// <include file='doc\Project.uex' path='docs/doc[@for="Project.CreateNode"]/*' />
    protected virtual HierarchyNode CreateNode(Project root, HierarchyNodeType type, XmlElement projNode){
      if (type == HierarchyNodeType.File){
        HierarchyItemNode hi = new HierarchyItemNode(this, type, projNode);

        if (NodeHasDesigner(projNode)){
          hi.HasDesigner = true;
        }

        return hi;
      }

      return new HierarchyNode(root, type, projNode);
    }