public void Unload() { KnownProjectBase.MetadataStore = null; ViewNodeManager.EnsureLayoutRequired -= new EventHandler(this.ViewNodeManager_EnsureLayoutRequired); XamlPerformanceEvents.UnregisterEvents(); this.services.RemoveService(typeof(AnnotationService)); this.annotationService.Shutdown(); IProjectTypeManager service = this.services.GetService <IProjectTypeManager>(); IDocumentTypeManager documentTypeManager = this.services.GetService <IDocumentTypeManager>(); IWindowService windowService = this.services.GetService <IWindowService>(); IOptionsDialogService optionsDialogService = this.services.GetService <IOptionsDialogService>(); this.services.GetService <ICommandService>().RemoveTarget(this.commandTarget); this.commandTarget = null; foreach (Tool tool in this.tools) { this.designerContext.ToolManager.Remove(tool); } this.services.RemoveService(typeof(ToolManager)); this.services.RemoveService(typeof(SnappingEngine)); this.services.RemoveService(typeof(IAttachedPropertyMetadataFactory)); this.services.RemoveService(typeof(IOutOfBrowserDeploymentService)); this.services.GetService <IDesignerDefaultPlatformService>().Dispose(); this.services.RemoveService(typeof(IDesignerDefaultPlatformService)); this.services.RemoveService(typeof(IHelpService)); windowService.RemoveResourceDictionary(this.designSurfaceIcons); optionsDialogService.OptionsPages.Remove(this.unitsOptionsPage); optionsDialogService.OptionsPages.Remove(this.artboardOptionsPage); optionsDialogService.OptionsPages.Remove(this.viewOptionsPage); optionsDialogService.OptionsPages.Remove(this.annotationsOptionsPage); this.sharedColorSpaceManager.Unload(); if (windowService.PaletteRegistry["Designer_ProjectPane"] != null) { ProjectPane content = (ProjectPane)windowService.PaletteRegistry["Designer_ProjectPane"].Content; } SceneViewModel.UnregisterPipelineTasks(this.services.GetService <ISchedulingService>()); foreach (IProjectType projectType in this.projectTypes) { service.Unregister(projectType); } foreach (IDocumentType documentType in this.documentTypes) { documentTypeManager.Unregister(documentType); } this.projectTypes.Clear(); this.documentTypes.Clear(); this.designerContext.Uninitialize(); this.designerContext = null; IAssemblyService assemblyService = this.services.GetService <IAssemblyService>(); assemblyService.UnregisterPlatformResolver("Silverlight"); assemblyService.UnregisterPlatformResolver(".NETFramework"); this.silverLightAssemblyResolver.Dispose(); }
public void Unload() { Microsoft.Expression.Framework.UserInterface.IWindowService service = this.services.GetService <Microsoft.Expression.Framework.UserInterface.IWindowService>(); service.Closing -= new CancelEventHandler(this.WindowManager_Closing); Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Send, new DispatcherOperationCallback((object o) => { Application.Current.SessionEnding -= new SessionEndingCancelEventHandler(this.Current_SessionEnding); return(null); }), null); ICommandService commandService = this.services.GetService <ICommandService>(); IProjectManager projectManager = this.services.GetService <IProjectManager>(); projectManager.CloseSolution(); ProjectManager projectManager1 = (ProjectManager)projectManager; projectManager1.UpdateConfiguration(); commandService.RemoveTarget(projectManager1); IDocumentTypeManager documentTypeManager = this.services.GetService <IDocumentTypeManager>(); documentTypeManager.Unregister(this.assemblyDocumentType); documentTypeManager.Unregister(this.projectReferenceDocumentType); documentTypeManager.Unregister(this.folderDocumentType); documentTypeManager.Unregister(this.comReferenceDocumentType); documentTypeManager.Unregister(this.cursorDocumentType); documentTypeManager.Unregister(this.deepZoomDocumentType); IProjectTypeManager projectTypeManager = this.services.GetService <IProjectTypeManager>(); projectTypeManager.Unregister(this.websiteProjectType); projectTypeManager.Unregister(this.webApplicationProjectType); this.services.GetService <IOptionsDialogService>().OptionsPages.Remove(this.projectSystemOptionsPage); this.assemblyLoggingService.Unload(); this.services.RemoveService(typeof(IAssemblyLoggingService)); this.services.RemoveService(typeof(IProjectTypeManager)); this.services.RemoveService(typeof(IDocumentTypeManager)); this.services.RemoveService(typeof(IProjectManager)); this.services.RemoveService(typeof(ISolutionService)); this.services.AssemblyService().UnregisterLibraryResolver(this.blendSdkAssemblyResolver); this.services.AssemblyService().UnregisterLibraryResolver(this.blendAssemblyResolver); this.services.RemoveService(typeof(IAssemblyService)); this.services.RemoveService(typeof(ISatelliteAssemblyResolver)); this.assemblyService.Dispose(); }