/// <summary>
 /// Registers with File change events
 /// </summary>
 private void InitializeFileChangeEvents()
 {
     if (null == this.fileChangeListener)
     {
         this.fileChangeListener = new FileChangeManager(this.ProjectMgr.Site);
         this.fileChangeListener.FileChangedOnDisk += this.OnAssemblyReferenceChangedOnDisk;
     }
 }
Exemplo n.º 2
0
 public PythonProjectReferenceNode(ProjectNode project, string referencedProjectName, string projectPath, string projectReference)
     : base(project, referencedProjectName, projectPath, projectReference)
 {
     _fileChangeListener = new FileChangeManager(ProjectMgr.Site);
     Initialize();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Registers with File change events
 /// </summary>
 private void InitializeFileChangeEvents()
 {
     _fileChangeListener = new FileChangeManager(ProjectMgr.Site);
     _fileChangeListener.FileChangedOnDisk += OnExtensionChangedOnDisk;
 }
Exemplo n.º 4
0
 public PythonProjectReferenceNode(ProjectNode root, ProjectElement element)
     : base(root, element)
 {
     _fileChangeListener = new FileChangeManager(ProjectMgr.Site);
     Initialize();
 }
 private void renameNamespaces(List<Namespace> namespacesToRename, SourceFile file)
 {
     FileChangeManager fileChangeManager = new FileChangeManager();
     foreach (Namespace nameSpace in namespacesToRename)
     {
         SourceFile nameSpaceFileNode = nameSpace.FileNode;
         string fileName = nameSpaceFileNode.Name;
         if (!fileChangeManager.ContainsKey(fileName))
             fileChangeManager.Add(fileName, new FileChangeGroup(fileName));
         string expectedNamespace = GetExpectedNamespace(nameSpaceFileNode);
         fileChangeManager[fileName].AddNamespaceDeclarationChange(nameSpace.NameRange, expectedNamespace);
         LanguageElementCollection allReferences = FindAllReferences(nameSpace);
         foreach (LanguageElement reference in allReferences)
         {
             string referenceFileName = reference.FileNode.Name;
             if (!fileChangeManager.ContainsKey(referenceFileName))
                 fileChangeManager.Add(referenceFileName, new FileChangeGroup(referenceFileName));
             NamespaceReference import = reference.GetParent(LanguageElementType.NamespaceReference) as NamespaceReference;
             FileChangeGroup fileChangeGroup = fileChangeManager[referenceFileName];
             if (import != null && import.IsAlias == false)
                 HandleNamespaceImport(reference, referenceFileName, import, fileChangeGroup);
             else
                 if (reference is TypeReferenceExpression || reference is ElementReferenceExpression)
                     HandleQualifiedReference(expectedNamespace, reference, fileChangeGroup, file);
                 else
                 {
                     Debugger.Break(); // We don't expect to ever be here.
                 }
         }
     }
     fileChangeManager.ApplyChanges();
 }