示例#1
0
 internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, IProtectedOperations protectedOperations, ILegacySettings legacySettings)
 {
     _dte = serviceProvider.GetService<SDTE, _DTE>();
     _vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
     _optionsDialogService = service;
     _protectedOperations = protectedOperations;
     _legacySettings = legacySettings;
     _importantScopeSet = new Lazy<HashSet<string>>(CreateImportantScopeSet);
 }
示例#2
0
 internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, [EditorUtilsImport] IProtectedOperations protectedOperations, ILegacySettings legacySettings)
 {
     _dte     = serviceProvider.GetService <SDTE, _DTE>();
     _vsShell = serviceProvider.GetService <SVsShell, IVsShell>();
     _optionsDialogService = service;
     _protectedOperations  = protectedOperations;
     _legacySettings       = legacySettings;
     _importantScopeSet    = new Lazy <HashSet <string> >(CreateImportantScopeSet);
 }
示例#3
0
 internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, [EditorUtilsImport] IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings)
 {
     _dte = serviceProvider.GetService<SDTE, _DTE>();
     _vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
     _optionsDialogService = service;
     _protectedOperations = protectedOperations;
     _vimApplicationSettings = vimApplicationSettings;
     _importantScopeSet = new Lazy<HashSet<string>>(CreateImportantScopeSet);
 }
示例#4
0
        internal KeyBindingService(_DTE dte, IOptionsDialogService service, IVimProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings, ScopeData scopeData)
        {
            _dte = dte;
            _optionsDialogService = service;
            _protectedOperations = protectedOperations;
            _vimApplicationSettings = vimApplicationSettings;
            _scopeData = scopeData;

            FixKeyMappingIssue();
        }
示例#5
0
        internal KeyBindingService(_DTE dte, IOptionsDialogService service, IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings, ScopeData scopeData)
        {
            _dte = dte;
            _optionsDialogService   = service;
            _protectedOperations    = protectedOperations;
            _vimApplicationSettings = vimApplicationSettings;
            _scopeData = scopeData;

            FixKeyMappingIssue();
        }
示例#6
0
        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();
        }
示例#7
0
        public void Unload()
        {
            IOptionsDialogService service1 = this.services.GetService <IOptionsDialogService>();
            IConfigurationService service2 = this.services.GetService <IConfigurationService>();

            Microsoft.Expression.Framework.UserInterface.IWindowService service3 = this.services.GetService <Microsoft.Expression.Framework.UserInterface.IWindowService>();
            service1.OptionsPages.Remove((IOptionsPage)this.shellOptionsPage);
            service2["WindowService"].SetProperty("ActiveTheme", (object)service3.ActiveTheme, (object)service3.Themes[0].Name);
            service2.Save();
            this.services.RemoveService(typeof(Microsoft.Expression.Framework.UserInterface.IWindowService));
            this.services.RemoveService(typeof(IDocumentService));
            this.services.RemoveService(typeof(IViewService));
            this.services.RemoveService(typeof(ICommandService));
            this.services.RemoveService(typeof(IConfigurationService));
            this.services.RemoveService(typeof(IOptionsDialogService));
            this.services.RemoveService(typeof(IMessageDisplayService));
            this.services.RemoveService(typeof(IImporterService));
        }
示例#8
0
 internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service)
 {
     _dte = serviceProvider.GetService<SDTE, _DTE>();
     _vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
     _optionsDialogService = service;
 }
示例#9
0
 internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, IVimProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings)
     : this(serviceProvider.GetService<SDTE, _DTE>(), service, protectedOperations, vimApplicationSettings, new ScopeData(serviceProvider.GetService<SVsShell, IVsShell>()))
 {
 }
示例#10
0
        public void Load(IServices services)
        {
            this.services = services;
            PerformanceUtility.StartPerformanceSequence(PerformanceEvent.FrameworkPackageLoad);
            UIThreadDispatcher.InitializeInstance();
            IExpressionMefHostingService mefHostingService = (IExpressionMefHostingService) new ExpressionMefHostingService(services);

            this.services.AddService(typeof(IExpressionMefHostingService), (object)mefHostingService);
            mefHostingService.AddInternalPart((object)mefHostingService);
            IMessageDisplayService messageDisplayService = (IMessageDisplayService) new MessageDisplayService(services.GetService <IExpressionInformationService>());

            this.services.AddService(typeof(IMessageDisplayService), (object)messageDisplayService);
            mefHostingService.AddInternalPart((object)this.services.GetService <IMessageDisplayService>());
            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Create SchedulingService");
            this.services.AddService(typeof(ISchedulingService), (object)new SchedulingService());
            mefHostingService.AddInternalPart((object)this.services.GetService <ISchedulingService>());
            string str = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Microsoft\\Expression\\Blend 4");

            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Create ConfigurationService");
            IConfigurationService configurationService = (IConfigurationService) new ConfigurationService(str);

            this.services.AddService(typeof(IConfigurationService), (object)configurationService);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Create OptionsDialogService");
            IOptionsDialogService optionsDialogService = (IOptionsDialogService) new OptionsDialogService(configurationService);

            this.services.AddService(typeof(IOptionsDialogService), (object)optionsDialogService);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Create CommandService");
            ICommandService commandService = (ICommandService) new CommandService(services.GetService <IFeedbackService>());

            this.services.AddService(typeof(ICommandService), (object)commandService);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Add Commands");
            this.AddCommand("Application_Exit", (ICommand) new FrameworkPackage.ExitCommand());
            this.AddCommand("Application_Options", (ICommand) new FrameworkPackage.OptionsCommand(optionsDialogService));
            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Create DocumentService");
            DocumentService documentService = (DocumentService) new BlendDocumentService(commandService, messageDisplayService);

            this.services.AddService(typeof(IDocumentService), (object)documentService);
            this.services.AddService(typeof(IViewService), (object)documentService);
            ICommandBarService commandBarService = (ICommandBarService) new CommandBarService(commandService);

            this.services.AddService(typeof(ICommandBarService), (object)commandBarService);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Create WorkspaceService");
            WorkspaceService workspaceService = new WorkspaceService(configurationService["WorkspaceService"], Path.Combine(str, "Workspaces"), (IEnumerable <string>) new string[2]
            {
                StringTable.DesignWorkspaceName,
                StringTable.AnimationWorkspaceName
            }, (IEnumerable <Uri>) new Uri[2]
            {
                new Uri("pack://application:,,,/Shopdrawing.Application;Component/Resources/Workspaces/Design.xaml", UriKind.Absolute),
                new Uri("pack://application:,,,/Shopdrawing.Application;Component/Resources/Workspaces/Animation.xaml", UriKind.Absolute)
            }, messageDisplayService);

            commandService.AddTarget((ICommandTarget)workspaceService);
            this.services.AddService(typeof(IWorkspaceService), (object)workspaceService);
            this.frameworkIcons        = new ResourceDictionary();
            this.frameworkIcons.Source = new Uri("pack://application:,,,/Microsoft.Expression.Framework;Component/Resources/Icons/FrameworkIcons.xaml", UriKind.Absolute);
            List <Theme> list = new List <Theme>(2);
            Uri          resourceDictionaryUriToMerge1 = new Uri("pack://application:,,,/Shopdrawing.Application;Component/Resources/BlendDarkTheme.xaml", UriKind.Absolute);

            list.Add(new Theme(StringTable.ThemeNameExpressionDark, "Resources\\UserInterface\\ExpressionDark.xaml", resourceDictionaryUriToMerge1));
            Uri resourceDictionaryUriToMerge2 = new Uri("pack://application:,,,/Shopdrawing.Application;Component/Resources/BlendLightTheme.xaml", UriKind.Absolute);

            list.Add(new Theme(StringTable.ThemeNameExpressionLight, "Resources\\UserInterface\\ExpressionLight.xaml", resourceDictionaryUriToMerge2));
            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Create WindowService");
            WindowService windowService = new WindowService(configurationService["WindowService"], commandBarService, commandService, (IViewService)documentService, (IWorkspaceService)workspaceService, messageDisplayService, services.GetService <IFeedbackService>(), services.GetService <IExpressionInformationService>().MainWindowRootElement, this.frameworkIcons, list.AsReadOnly(), this.suppressViewUI);

            this.services.AddService(typeof(Microsoft.Expression.Framework.UserInterface.IWindowService), (object)windowService);
            this.services.AddService(typeof(IOrderedViewProvider), (object)windowService);
            workspaceService.SetPaletteRegistry(windowService.PaletteRegistry);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.FrameworkPackageLoad, "Register CommandTargets");
            commandService.AddTarget((ICommandTarget)this);
            commandService.AddTarget((ICommandTarget)documentService);
            this.services.AddService(typeof(IMessageLoggingService), (object)new FrameworkPackage.NullMessageLoggingService());
            this.services.AddService(typeof(IErrorService), (object)new FrameworkPackage.ErrorService());
            this.services.AddService(typeof(IImporterService), (object)new ImporterService(configurationService["ImporterService"], Path.Combine(str, "ImportersDataStore")));
            this.shellOptionsPage = new ShellOptionsPage((Microsoft.Expression.Framework.UserInterface.IWindowService)windowService);
            optionsDialogService.OptionsPages.Add((IOptionsPage)this.shellOptionsPage);
            Dialog.ServiceProvider = (IServiceProvider)services;
            PerformanceUtility.EndPerformanceSequence(PerformanceEvent.FrameworkPackageLoad);
        }
示例#11
0
 public OptionsDialog(IOptionsDialogService optionsDialogService)
 {
     this.Title       = StringTable.OptionsDialogTitle;
     this.DataContext = (object)optionsDialogService;
     this.InitializeComponent();
 }
示例#12
0
        public void Load(IServices services)
        {
            this.services = services;
            ICommandService service1 = this.services.GetService <ICommandService>();

            this.services.GetService <IDocumentService>();
            IDocumentTypeManager   service2         = this.services.GetService <IDocumentTypeManager>();
            IViewService           service3         = this.services.GetService <IViewService>();
            IProjectManager        service4         = this.services.GetService <IProjectManager>();
            IAssemblyService       service5         = this.services.GetService <IAssemblyService>();
            IMessageDisplayService service6         = this.services.GetService <IMessageDisplayService>();
            IWindowService         service7         = this.services.GetService <IWindowService>();
            CodeOptionsModel       codeOptionsModel = new CodeOptionsModel();

            this.editingService = new EditingService((IServiceProvider)this.services, codeOptionsModel);
            this.services.AddService(typeof(ITextEditorService), (object)this.editingService);
            this.services.AddService(typeof(ITextBufferService), (object)this.editingService);
            ICodeProjectService codeProjectService = (ICodeProjectService) new CodeProjectService(service4, service5, service6, service3, service2);

            this.services.AddService(typeof(ICodeModelService), (object)new CodeModelService(this.services, codeProjectService));
            if (service2 != null)
            {
                this.csharpDocumentType = (IDocumentType) new CSharpDocumentType(codeProjectService, service3, codeOptionsModel, service7);
                service2.Register(this.csharpDocumentType);
                this.visualBasicDocumentType = (IDocumentType) new VisualBasicDocumentType(codeProjectService, service3, codeOptionsModel, service7);
                service2.Register(this.visualBasicDocumentType);
                this.javascriptDocumentType = (IDocumentType) new JavascriptDocumentType(codeProjectService, service3, codeOptionsModel, service7);
                service2.Register(this.javascriptDocumentType);
                this.fSharpDocumentType = (IDocumentType) new FSharpDocumentType(codeProjectService, service3, codeOptionsModel, service7);
                service2.Register(this.fSharpDocumentType);
                this.fSharpScriptDocumentType = (IDocumentType) new FSharpScriptDocumentType(codeProjectService, service3, codeOptionsModel, service7);
                service2.Register(this.fSharpScriptDocumentType);
                this.fSharpTemplateDocumentType = (IDocumentType) new FSharpTemplateDocumentType(codeProjectService, service3, codeOptionsModel, service7);
                service2.Register(this.fSharpTemplateDocumentType);
                this.cPlusPlusDocumentType = (IDocumentType) new CPlusPlusDocumentType(codeProjectService, service3, codeOptionsModel, service7);
                service2.Register(this.cPlusPlusDocumentType);
                this.headerDocumentType = (IDocumentType) new HeaderDocumentType(codeProjectService, service3, codeOptionsModel, service7);
                service2.Register(this.headerDocumentType);
                this.htmlDocumentType = (IDocumentType) new HTMLDocumentType(this.editingService);
                service2.Register(this.htmlDocumentType);
                this.xmlDocumentType = (IDocumentType) new XmlDocumentType(this.editingService);
                service2.Register(this.xmlDocumentType);
                this.limitedXamlDocumentType = (IDocumentType) new LimitedXamlDocumentType(this.editingService);
                service2.Register(this.limitedXamlDocumentType);
                this.fxgDocumentType = (IDocumentType) new FxgDocumentType(this.editingService);
                service2.Register(this.fxgDocumentType);
            }
            IOptionsDialogService service8 = this.services.GetService <IOptionsDialogService>();

            if (service8 != null)
            {
                this.codeOptionsPage = (IOptionsPage) new CodeOptionsPage(this.editingService);
                service8.OptionsPages.Add(this.codeOptionsPage);
            }
            if (service1 == null)
            {
                return;
            }
            this.commandTarget = new CommandTarget();
            this.commandTarget.AddCommand("Project_EditVisualStudio", (ICommand) new EditVisualStudioCommand(service4, service1, service6));
            service1.AddTarget((ICommandTarget)this.commandTarget);
        }
示例#13
0
 internal KeyBindingService(SVsServiceProvider sp, IOptionsDialogService service)
 {
     _dte = sp.GetService<SDTE, _DTE>();
     _optionsDialogService = service;
 }
示例#14
0
        public void Load(IServices services)
        {
            this.services = services;
            ICommandService service = (ICommandService)this.services.GetService(typeof(ICommandService));
            IExpressionMefHostingService expressionMefHostingService = this.services.GetService <IExpressionMefHostingService>();
            IDocumentTypeManager         documentTypeManager         = new DocumentTypeManager(new UnknownDocumentType());

            this.services.AddService(typeof(IDocumentTypeManager), documentTypeManager);
            IProjectTypeManager projectTypeManager = new ProjectTypeManager();

            this.services.AddService(typeof(IProjectTypeManager), projectTypeManager);
            IConfigurationService configurationService = this.services.GetService <IConfigurationService>();
            ProjectManager        projectManager       = new ProjectManager(this.services, configurationService["ProjectManager"]);

            this.services.AddService(typeof(IProjectManager), projectManager);
            service.AddTarget(projectManager);
            this.services.AddService(typeof(IExternalChanges), projectManager);
            this.solutionService = new SolutionService(projectManager);
            this.services.AddService(typeof(ISolutionService), this.solutionService);
            this.assemblyLoggingService = new AssemblyLoggingService(configurationService.ConfigurationDirectoryPath);
            this.services.AddService(typeof(IAssemblyLoggingService), this.assemblyLoggingService);
            IProjectAdapterService projectAdapterService = new ProjectAdapterService(this.services);

            this.services.AddService(typeof(IProjectAdapterService), projectAdapterService);
            if (expressionMefHostingService != null)
            {
                expressionMefHostingService.AddInternalPart(projectAdapterService);
                expressionMefHostingService.AddInternalPart(this.solutionService);
            }
            IOptionsDialogService optionsDialogService = this.services.GetService <IOptionsDialogService>();

            this.projectSystemOptionsPage = new ProjectSystemOptionsPage(projectManager, this.assemblyLoggingService);
            optionsDialogService.OptionsPages.Add(this.projectSystemOptionsPage);
            this.assemblyDocumentType = new AssemblyDocumentType();
            documentTypeManager.Register(this.assemblyDocumentType);
            this.projectReferenceDocumentType = new ProjectReferenceDocumentType();
            documentTypeManager.Register(this.projectReferenceDocumentType);
            this.folderDocumentType = new FolderDocumentType();
            documentTypeManager.Register(this.folderDocumentType);
            this.comReferenceDocumentType = new ComReferenceDocumentType();
            documentTypeManager.Register(this.comReferenceDocumentType);
            this.cursorDocumentType = new CursorDocumentType();
            documentTypeManager.Register(this.cursorDocumentType);
            this.deepZoomDocumentType = new DeepZoomDocumentType();
            documentTypeManager.Register(this.deepZoomDocumentType);
            this.websiteProjectType = new WebsiteProjectType();
            projectTypeManager.Register(this.websiteProjectType);
            this.webApplicationProjectType = new WebApplicationProjectType();
            projectTypeManager.Register(this.webApplicationProjectType);
            this.assemblyService = new AssemblyService(this.services);
            this.services.AddService(typeof(IAssemblyService), this.assemblyService);
            this.services.AddService(typeof(ISatelliteAssemblyResolver), this.assemblyService);
            this.blendSdkAssemblyResolver = new BlendSdkAssemblyResolver();
            this.assemblyService.RegisterLibraryResolver(this.blendSdkAssemblyResolver);
            this.blendAssemblyResolver = new BlendAssemblyResolver();
            this.assemblyService.RegisterLibraryResolver(this.blendAssemblyResolver);
            Microsoft.Expression.Framework.UserInterface.IWindowService windowService = this.services.GetService <Microsoft.Expression.Framework.UserInterface.IWindowService>();
            windowService.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);
            UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.SystemIdle, new Action(this.assemblyService.AssemblyCache.Clean));
        }
示例#15
0
 internal KeyBindingService(SVsServiceProvider sp, IOptionsDialogService service)
 {
     _dte = sp.GetService <SDTE, _DTE>();
     _optionsDialogService = service;
 }
示例#16
0
 internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, [EditorUtilsImport] IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings)
     : this(serviceProvider.GetService <SDTE, _DTE>(), service, protectedOperations, vimApplicationSettings, new ScopeData(serviceProvider.GetService <SVsShell, IVsShell>()))
 {
 }
示例#17
0
 public OptionsCommand(IOptionsDialogService optionsDialogService)
 {
     this.optionsDialogService = optionsDialogService;
 }
示例#18
0
        public void Load(IServices services)
        {
            PerformanceUtility.StartPerformanceSequence(PerformanceEvent.DesignerPackageLoad);
            this.services = services;
            PropertyReference.RegisterAssemblyNamespace(typeof(DesignerPackage).Assembly, new string[] { "Microsoft.Expression.DesignSurface", "Microsoft.Expression.DesignSurface.Properties" });
            IWindowService        service              = this.services.GetService <IWindowService>();
            IProjectTypeManager   projectTypeManager   = this.services.GetService <IProjectTypeManager>();
            IDocumentTypeManager  documentTypeManager  = this.services.GetService <IDocumentTypeManager>();
            IOptionsDialogService optionsDialogService = this.services.GetService <IOptionsDialogService>();

            this.services.GetService <IProjectManager>();
            this.designSurfaceIcons = FileTable.GetResourceDictionary("Resources/Icons/DesignSurfaceIcons.xaml");
            service.AddResourceDictionary(this.designSurfaceIcons);
            SceneViewModel.RegisterPipelineTasks(this.services.GetService <ISchedulingService>());
            this.designerContext = new DesignerContext(this.services);
            this.designerContext.Initialize();
            this.services.AddService(typeof(SelectionManager), this.designerContext.SelectionManager);
            this.services.AddService(typeof(ToolManager), this.designerContext.ToolManager);
            this.services.AddService(typeof(SnappingEngine), this.designerContext.SnappingEngine);
            this.services.AddService(typeof(ICodeAidProvider), this.designerContext.CodeAidProvider);
            this.services.AddService(typeof(IAttachedPropertyMetadataFactory), new AttachedPropertyMetadataFactory());
            IOutOfBrowserDeploymentService outOfBrowserDeploymentService = new OutOfBrowserDeploymentService(this.services);

            this.services.AddService(typeof(IOutOfBrowserDeploymentService), outOfBrowserDeploymentService);
            this.services.AddService(typeof(IPlatformContextChanger), this.designerContext.PlatformContextChanger);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.DesignerPackageLoad, "Registering Document Types");
            this.documentTypes.Add(new LicxDocumentType());
            this.documentTypes.Add(new SceneDocumentType(this.designerContext));
            this.documentTypes.Add(new ResourceDictionaryDocumentType(this.designerContext));
            this.documentTypes.Add(new ImageDocumentType(this.designerContext));
            this.documentTypes.Add(new IconImageDocumentType(this.designerContext));
            this.documentTypes.Add(new PngImageDocumentType(this.designerContext));
            this.documentTypes.Add(new JpgImageDocumentType(this.designerContext));
            this.documentTypes.Add(new GifImageDocumentType(this.designerContext));
            this.documentTypes.Add(new TifImageDocumentType(this.designerContext));
            this.documentTypes.Add(new FontDocumentType());
            this.documentTypes.Add(new WpfMediaDocumentType(this.designerContext));
            this.documentTypes.Add(new SilverlightAndWpfMediaDocumentType(this.designerContext));
            this.documentTypes.Add(new XapDocumentType());
            this.documentTypes.Add(new WavefrontObjAsset(this.designerContext));
            this.documentTypes.Add(new WavefrontMtlDocumentType(this.designerContext));
            this.documentTypes.Add(new ApplicationDefinitionDocumentType(this.designerContext));
            foreach (IDocumentType documentType in this.documentTypes)
            {
                documentTypeManager.Register(documentType);
            }
            PerformanceUtility.MarkInterimStep(PerformanceEvent.DesignerPackageLoad, "Initializing DesignTime Metadata Store");
            IDesignerDefaultPlatformService designerDefaultPlatformService = new DesignerDefaultPlatformService(this.services);

            this.services.AddService(typeof(IDesignerDefaultPlatformService), designerDefaultPlatformService);
            IHelpService helpService = new HelpService();

            this.services.AddService(typeof(IHelpService), helpService);
            CanonicalTransform3D.Initialize(this.designerContext);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.DesignerPackageLoad, "Creating Managers");
            this.unitsOptionsPage = new UnitsOptionsPage(this.designerContext);
            optionsDialogService.OptionsPages.Add(this.unitsOptionsPage);
            this.artboardOptionsPage = new ArtboardOptionsPage(this.designerContext);
            optionsDialogService.OptionsPages.Add(this.artboardOptionsPage);
            this.viewOptionsPage = new ViewOptionsPage(this.designerContext);
            optionsDialogService.OptionsPages.Add(this.viewOptionsPage);
            this.annotationsOptionsPage = new AnnotationsOptionsPage(this.designerContext);
            optionsDialogService.OptionsPages.Add(this.annotationsOptionsPage);
            this.projectTypes.Add(new ExecutableProjectType());
            this.projectTypes.Add(new WindowsExecutableProjectType());
            this.projectTypes.Add(new WpfProjectType());
            this.projectTypes.Add(new SilverlightProjectType(services));
            foreach (IProjectType projectType in this.projectTypes)
            {
                projectTypeManager.Register(projectType);
            }
            IAssemblyService assemblyService = services.GetService <IAssemblyService>();

            this.silverLightAssemblyResolver = new SilverlightAssemblyResolver(AppDomain.CurrentDomain, services);
            assemblyService.RegisterPlatformResolver(".NETFramework", new ClrAssemblyResolver());
            assemblyService.RegisterPlatformResolver("Silverlight", this.silverLightAssemblyResolver);
            service.AddResourceDictionary(FileTable.GetResourceDictionary("Resources\\DesignSurfaceStyles.xaml"));
            PerformanceUtility.MarkInterimStep(PerformanceEvent.ApplicationStartup, "Opening Panels");
            PerformanceUtility.StartPerformanceSequence(PerformanceEvent.OpeningPanels);
            ToolContext toolContext = this.designerContext.ToolContext;

            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "Tools");
            service.RegisterPalette("Designer_ToolPane", new ToolPane(this.designerContext, toolContext), StringTable.ToolPaneTitle, null, new StandaloneViewProperties(false, true, false));
            ProjectPane projectPane = new ProjectPane(services);

            service.RegisterPalette("Designer_ProjectPane", projectPane, StringTable.ProjectPaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "Data");
            service.RegisterPalette("Designer_DataPane", new DataPane(this.designerContext), StringTable.DataPaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "Resources");
            service.RegisterPalette("Designer_ResourcePane", new ResourcePane(this.designerContext, this.designerContext.ProjectManager, this.designerContext.ResourceManager), StringTable.ResourcePaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "PropertyInspector");
            service.RegisterPalette("Designer_PropertyInspector", new SceneNodePropertyInspectorPane(this.designerContext.PropertyInspectorModel), StringTable.PropertyInspectorPaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "Timeline");
            service.RegisterPalette("Designer_TimelinePane", new TimelinePane(this.designerContext), StringTable.TimelinePaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "Triggers");
            service.RegisterPalette("Designer_TriggersPane", new TriggersPane(this.designerContext), StringTable.TriggersPaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "States");
            service.RegisterPalette("Interaction_Skin", new SkinView(this.designerContext), StringTable.SkinPaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "Asset");
            service.RegisterPalette("Designer_AssetPane", new AssetPane(this.designerContext, toolContext), StringTable.AssetPaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "Parts");
            service.RegisterPalette("Interaction_Parts", new PartsPane(this.designerContext), StringTable.PartsPaneTitle);
            PerformanceUtility.MarkInterimStep(PerformanceEvent.OpeningPanels, "Results");
            ResultsPane resultsPane = new ResultsPane(this.designerContext, new ProjectErrorTaskCollection(this.designerContext));
            KeyBinding  keyBinding  = new KeyBinding()
            {
                Key = Key.F12
            };

            resultsPane.Palette = service.RegisterPalette("Designer_ResultsPane", resultsPane, StringTable.ResultsPaneTitle, keyBinding);
            PerformanceUtility.EndPerformanceSequence(PerformanceEvent.OpeningPanels);
            this.services.RemoveService(typeof(IErrorService));
            this.services.RemoveService(typeof(IMessageLoggingService));
            this.services.AddService(typeof(IErrorService), resultsPane.ErrorManager);
            this.services.AddService(typeof(IMessageLoggingService), resultsPane.MessageLoggingService);
            this.designerContext.ErrorManager          = resultsPane.ErrorManager;
            this.designerContext.MessageLoggingService = resultsPane.MessageLoggingService;
            PerformanceUtility.MarkInterimStep(PerformanceEvent.DesignerPackageLoad, "Adding Tools to ToolManager");
            this.tools.Add(new SelectionTool(toolContext));
            this.tools.Add(new SubselectionTool(toolContext));
            this.tools.Add(new RectangleTool(toolContext));
            this.tools.Add(new EllipseTool(toolContext));
            this.tools.Add(new LineTool(toolContext));
            this.tools.Add(new PenTool(toolContext));
            this.tools.Add(new PencilTool(toolContext));
            this.tools.Add(new PanTool(toolContext));
            this.tools.Add(new ZoomTool(toolContext));
            this.tools.Add(new EyedropperTool(toolContext));
            this.tools.Add(new PaintBucketTool(toolContext));
            this.tools.Add(new GradientBrushTool(toolContext));
            this.tools.Add(new BrushTransformTool(toolContext));
            this.tools.Add(new CameraOrbitTool(toolContext));
            foreach (ITypeId textToolType in TextTool.TextToolTypes)
            {
                this.tools.Add(new TextTool(toolContext, textToolType));
            }
            this.tools.Add(new GenericControlTool(toolContext, PlatformTypes.Grid, ToolCategory.LayoutPanels));
            this.tools.Add(new GenericControlTool(toolContext, PlatformTypes.Canvas, ToolCategory.LayoutPanels));
            this.tools.Add(new GenericControlTool(toolContext, PlatformTypes.StackPanel, ToolCategory.LayoutPanels));
            this.tools.Add(new GenericControlTool(toolContext, ProjectNeutralTypes.WrapPanel, ToolCategory.LayoutPanels));
            this.tools.Add(new GenericControlTool(toolContext, ProjectNeutralTypes.DockPanel, ToolCategory.LayoutPanels));
            this.tools.Add(new GenericControlTool(toolContext, PlatformTypes.ScrollViewer, ToolCategory.LayoutPanels));
            this.tools.Add(new GenericControlTool(toolContext, PlatformTypes.Border, ToolCategory.LayoutPanels));
            this.tools.Add(new GenericControlTool(toolContext, PlatformTypes.UniformGrid, ToolCategory.LayoutPanels));
            this.tools.Add(new GenericControlTool(toolContext, ProjectNeutralTypes.Viewbox, ToolCategory.LayoutPanels));
            foreach (ITypeId knownGenericControlType in DesignerPackage.KnownGenericControlTypes)
            {
                this.tools.Add(new GenericControlTool(toolContext, knownGenericControlType, ToolCategory.CommonControls));
            }
            foreach (Tool tool in this.tools)
            {
                this.designerContext.ToolManager.Add(tool);
            }
            this.sharedColorSpaceManager = new SharedColorSpaceManager(this.designerContext.Configuration);
            this.annotationService       = new AnnotationService(this.designerContext);
            services.AddService(typeof(AnnotationService), this.annotationService);
            this.commandTarget = new CommandTarget();
            this.commandTarget.AddCommand("Application_AddNewItem", new AddNewItemCommand(this.designerContext, null));
            CommandTarget   commandTarget   = this.commandTarget;
            DesignerContext designerContext = this.designerContext;

            string[] strArrays = new string[] { "ResourceDictionary.xaml" };
            commandTarget.AddCommand("Application_AddNewResource", new AddNewItemCommand(designerContext, strArrays));
            this.commandTarget.AddCommand("Project_OpenView", new OpenViewCommand(this.designerContext));
            this.commandTarget.AddCommand("Project_EnablePlatformExtensions", new EnablePlatformExtensionsCommand(services));
            this.commandTarget.AddCommand("Project_EnableOutOfBrowser", new EnableApplicationOutsideBrowserCommand(services));
            this.commandTarget.AddCommand("Project_EnablePreviewOutOfBrowser", new EnablePreviewOutOfBrowserCommand(services));
            this.commandTarget.AddCommand("Project_EnableElevatedOutOfBrowser", new EnableElevatedOutOfBrowserCommand(services));
            this.commandTarget.AddCommand("Project_AddReference", new AddReferenceCommand(services));
            this.designerContext.CommandService.AddTarget(this.commandTarget);
            PerformanceUtility.EndPerformanceSequence(PerformanceEvent.DesignerPackageLoad);
            EventRouter.InitializeKeyboardHook(this.designerContext);
            XamlPerformanceEvents.RegisterEvents();
            UIThreadDispatcherHelper.Capture();
            ViewNodeManager.EnsureLayoutRequired += new EventHandler(this.ViewNodeManager_EnsureLayoutRequired);
            KnownProjectBase.MetadataStore        = new DesignerPackage.MetadataStore();
            UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.SystemIdle, new Action(FontResolver.CleanFontCache));
        }