示例#1
0
        /// <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 retrieve 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");
            }

            // TODO: Maybe referenced projects should be relative to ProjectDir?
            this.referencedProjectFullPath = CommonUtils.GetAbsoluteFilePath(this.ProjectMgr.ProjectHome, this.referencedProjectRelativePath);
        }
示例#2
0
 internal WebPiReferenceNode(ProjectNode root, ProjectElement element, string filename, string productId, string friendlyName)
     : base(root, element) {
     Utilities.ArgumentNotNullOrEmpty("filename", filename);
     _feed = filename;
     _productId = productId;
     _friendlyName = friendlyName;
 }
        internal PythonExtensionReferenceNode(PythonProjectNode root, ProjectElement element, string filename)
            : base(root, element) {
            Utilities.ArgumentNotNullOrEmpty("filename", filename);
            _filename = CommonUtils.GetAbsoluteFilePath(root.ProjectHome, filename);

            AnalyzeReference(root.GetInterpreter() as IPythonInterpreterWithProjectReferences);
            InitializeFileChangeEvents();
        }
 public NodejsFileNode(NodejsProjectNode root, ProjectElement e)
     : base(root, e) {
     if (Url.Contains(AnalysisConstants.NodeModulesFolder)) {
         root.EnqueueForDelayedAnalysis(this);
     } else {
         Analyze();
     }
 }
        public NodejsFileNode(NodejsProjectNode root, ProjectElement e)
            : base(root, e) {
            string referenceBaseName = Path.GetFileNameWithoutExtension(Caption);

#if FALSE
            CreateWatcher(Url);
#endif
            if (Url.Contains(AnalysisConstants.NodeModulesFolder)) {
                root.DelayedAnalysisQueue.Enqueue(this);
            } else {
                Analyze();
            }
        }
示例#6
0
        public NodejsFileNode(NodejsProjectNode root, ProjectElement e)
            : base(root, e) {
            string referenceBaseName = Path.GetFileNameWithoutExtension(Caption);

#if FALSE
            CreateWatcher(Url);
#endif
            if (ShouldAnalyze) {
                root.Analyzer.AnalyzeFile(Url, !IsNonMemberItem);
                root._requireCompletionCache.Clear();
            }
            
            ItemNode.ItemTypeChanged += ItemNode_ItemTypeChanged;
        }
示例#7
0
        /// <summary>
        /// Constructor for the ReferenceNode
        /// </summary>
        public AssemblyReferenceNode(ProjectNode root, ProjectElement element)
            : base(root, element)
        {
            this.GetPathNameFromProjectFile();

            this.InitializeFileChangeEvents();

            if (File.Exists(assemblyPath)) {
                this.fileChangeListener.ObserveItem(this.assemblyPath);
            }

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

            this.CreateFromAssemblyName(new System.Reflection.AssemblyName(include));
        }
        protected override AssemblyReferenceNode CreateAssemblyReferenceNode(ProjectElement element) {
            AssemblyReferenceNode node = null;
            try {
                node = new PythonAssemblyReferenceNode((PythonProjectNode)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;
        }
        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);
        }
        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);
        }
示例#11
0
 /// <summary>
 /// constructor for the ReferenceNode
 /// </summary>
 protected ReferenceNode(ProjectNode root, ProjectElement element)
     : base(root, element) {
     this.ExcludeNodeFromScc = true;
 }
示例#12
0
 public PythonFolderNode(CommonProjectNode root, ProjectElement element)
     : base(root, element) {
 }
        protected virtual ReferenceNode CreateReferenceNode(string referenceType, ProjectElement element) {
            ReferenceNode node = null;
#if FALSE
            if(referenceType == ProjectFileConstants.COMReference)
            {
                node = this.CreateComReferenceNode(element);
            }
            else 
#endif
            if (referenceType == ProjectFileConstants.Reference) {
                node = this.CreateAssemblyReferenceNode(element);
            } else if (referenceType == ProjectFileConstants.ProjectReference) {
                node = this.CreateProjectReferenceNode(element);
            }

            return node;
        }
 /// <summary>
 /// Creates a project reference node given an existing project element.
 /// </summary>
 protected virtual ProjectReferenceNode CreateProjectReferenceNode(ProjectElement element)
 {
     return(new ProjectReferenceNode(this.ProjectMgr, element));
 }
示例#15
0
 public TrackedFileNode(RustProjectNode root, ProjectElement elm)
     : base(root, elm, elm.GetMetadata(ProjectFileConstants.Include))
 {
 }
示例#16
0
 public override CommonFileNode CreateCodeFileNode(ProjectElement item) {
     string fileName = item.Url;
     if (!String.IsNullOrWhiteSpace(fileName)
         && Path.GetExtension(fileName).Equals(NodejsConstants.TypeScriptExtension, StringComparison.OrdinalIgnoreCase)) {
         return new NodejsTypeScriptFileNode(this, item);
     }
     var res = new NodejsFileNode(this, item);
     return res;
 }
示例#17
0
 protected internal override FolderNode CreateFolderNode(ProjectElement element)
 {
     if (element == null)
         throw new ArgumentException("element");
     if (element is AllFilesProjectElement || !String.IsNullOrEmpty(element.ItemTypeName))
         return new RustFolderNode(this, element);
     else
         return new UntrackedFolderNode(this, element);
 }
示例#18
0
 public CommonNonCodeFileNode(CommonProjectNode root, ProjectElement e)
     : base(root, e)
 {
 }
 protected override ProjectReferenceNode CreateProjectReferenceNode(ProjectElement element) {
     return new PythonProjectReferenceNode(ProjectMgr, element);
 }
示例#20
0
 /// <summary>
 /// constructor for the ReferenceNode
 /// </summary>
 protected ReferenceNode(ProjectNode root, ProjectElement element)
     : base(root, element)
 {
     this.ExcludeNodeFromScc = true;
 }
示例#21
0
 public UntrackedFolderNode(RustProjectNode root, ProjectElement elm)
     : base(root, elm)
 {
     ProjectMgr = root;
 }
示例#22
0
 public CommonFolderNode(CommonProjectNode root, ProjectElement element)
     : base(root, element)
 {
     _project = root;
 }
示例#23
0
 public BaseFileNode(RustProjectNode node, ProjectElement elm, string path)
     : base(node, elm)
 {
     ProjectMgr = node;
 }
示例#24
0
 public override FileNode CreateFileNode(ProjectElement item)
 {
     if (String.IsNullOrEmpty(item.ItemTypeName))
         return base.CreateFileNode(item);
     return CreateTrackedNode(item);
 }
示例#25
0
 /// <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, ProjectElement element)
     : base(root, element) {
 }
示例#26
0
 public override CommonFileNode CreateNonCodeFileNode(ProjectElement item)
 {
     return new TrackedFileNode(this, item);
 }
示例#27
0
 public CommonFileNode(CommonProjectNode root, ProjectElement e)
     : base(root, e)
 {
     _project = root;
 }
示例#28
0
 private TrackedFileNode CreateTrackedNode(ProjectElement elm)
 {
     var node = new TrackedFileNode(this, elm);
     if (!ModuleTracker.IsIncremental)
     {
         ModuleTracker.AddRootModule(node.Url);
     }
     else
     {
         HashSet<string> children = ModuleTracker.AddRootModuleIncremental(node.Url);
         foreach (string child in children)
         {
             HierarchyNode parent = this.CreateFolderNodes(fs.Path.GetDirectoryName(child), false);
             parent.AddChild(CreateUntrackedNode(child));
         }
     }
     return node;
 }
示例#29
0
 /// <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)
 {
     UpdateCaption();
 }
示例#30
0
 /// <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) {
     UpdateCaption();
 }
示例#31
0
        public override CommonFileNode CreateNonCodeFileNode(ProjectElement item) {
            string fileName = item.Url;
            if (Path.GetFileName(fileName).Equals(NodejsConstants.PackageJsonFile, StringComparison.OrdinalIgnoreCase)) {
                return new PackageJsonFileNode(this, item);
            }

            return base.CreateNonCodeFileNode(item);
        }
示例#32
0
 protected internal override FolderNode CreateFolderNode(ProjectElement element) {
     return new NodejsFolderNode(this, element);
 }
 public PythonAssemblyReferenceNode(PythonProjectNode root, ProjectElement element)
     : base(root, element) {
     AnalyzeReference(root.GetInterpreter() as IPythonInterpreterWithProjectReferences);
 }
示例#34
0
 public NodejsFolderNode(CommonProjectNode root, ProjectElement element) : base(root, element) {
     _project = root;
 }
 public NodejsTypeScriptFileNode(NodejsProjectNode root, ProjectElement e)
     : base(root, e) {
 }
 /// <summary>
 /// Creates a project reference node given an existing project element.
 /// </summary>
 protected virtual ProjectReferenceNode CreateProjectReferenceNode(ProjectElement element) {
     return new ProjectReferenceNode(this.ProjectMgr, element);
 }
示例#37
0
 /// <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, ProjectElement element)
     : base(root, element)
 {
 }