internal void SetProject(Project project) { if (Window.ViewContent.Project == project) { return; } DetachExtensionChain(); ISupportsProjectReload pr = GetContent <ISupportsProjectReload> (); if (pr != null) { // Unsubscribe project events if (Window.ViewContent.Project != null) { Window.ViewContent.Project.Modified -= HandleProjectModified; } Window.ViewContent.Project = project; pr.Update(project); } if (project != null) { project.Modified += HandleProjectModified; } InitializeExtensionChain(); ListenToProjectLoad(project); }
internal void SetProject(Project project) { if (Window.ViewContent.Project == project) { return; } while (editorExtension != null) { try { editorExtension.Dispose(); } catch (Exception ex) { LoggingService.LogError("Exception while disposing extension:" + editorExtension, ex); } editorExtension = editorExtension.Next as TextEditorExtension; } editorExtension = null; ISupportsProjectReload pr = GetContent <ISupportsProjectReload> (); if (pr != null) { Window.ViewContent.Project = project; pr.Update(project); } if (project != null) { project.Modified += HandleProjectModified; } OnDocumentAttached(); }
internal void SetProject(Project project) { IExtensibleTextEditor editor = GetContent <IExtensibleTextEditor> (); if (editor != null) { editor.TextChanged -= OnDocumentChanged; } while (editorExtension != null) { try { editorExtension.Dispose(); } catch (Exception ex) { LoggingService.LogError("Exception while disposing extension:" + editorExtension, ex); } editorExtension = editorExtension.Next as TextEditorExtension; } editorExtension = null; ISupportsProjectReload pr = GetContent <ISupportsProjectReload> (); if (pr != null) { Window.ViewContent.Project = project; pr.Update(project); } OnDocumentAttached(); }
internal void SetProject(Project project) { if (Window == null || Window.ViewContent == null || Window.ViewContent.Project == project) { return; } UnloadAdhocProject(); if (adhocProject == null) { analysisDocument = null; } ISupportsProjectReload pr = GetContent <ISupportsProjectReload> (); if (pr != null) { // Unsubscribe project events if (Window.ViewContent.Project != null) { Window.ViewContent.Project.Modified -= HandleProjectModified; } Window.ViewContent.Project = project; pr.Update(project); } if (project != null) { project.Modified += HandleProjectModified; } InitializeExtensionChain(); TypeSystemService.Workspace.WorkspaceChanged += HandleWorkspaceChanged; ListenToProjectLoad(project); }
internal void SetProject(Project project) { if (Window.ViewContent.Project == project) { return; } DetachExtensionChain(); ISupportsProjectReload pr = GetContent <ISupportsProjectReload> (); if (pr != null) { // Unsubscribe project events if (Window.ViewContent.Project != null) { Window.ViewContent.Project.Modified -= HandleProjectModified; } Window.ViewContent.Project = project; pr.Update(project); } if (project != null) { project.Modified += HandleProjectModified; } InitializeExtensionChain(); StartReparseThread(); if (oldWrapper != null) { oldWrapper.InLoadChanged -= HandleInLoadChanged; oldWrapper = null; } if (project != null) { var wrapper = TypeSystemService.GetProjectContentWrapper(project); wrapper.InLoadChanged += HandleInLoadChanged; oldWrapper = wrapper; } }