public DecompilerShellUiService( IMainForm form, DecompilerMenus dm, OpenFileDialog ofd, SaveFileDialog sfd, IServiceProvider sp) : base((Form)form, ofd, sfd) { this.form = form; this.dm = dm; this.services = sp; this.framesByName = new Dictionary<string, WindowFrame>(); this.framesByTab = new Dictionary<TabPage, WindowFrame>(); this.form.DocumentTabs.ControlRemoved += documentTabs_ControlRemoved; this.form.DocumentTabs.MouseUp += documentTabs_MouseUp; }
private void CreateServices(IServiceFactory svcFactory, IServiceContainer sc, DecompilerMenus dm) { config = svcFactory.CreateDecompilerConfiguration(); sc.AddService(typeof(IConfigurationService), config); sc.AddService(typeof(IStatusBarService), (IStatusBarService)this); diagnosticsSvc = svcFactory.CreateDiagnosticsService(form.DiagnosticsList); sc.AddService(typeof(IDiagnosticsService), diagnosticsSvc); decompilerSvc = svcFactory.CreateDecompilerService(); sc.AddService(typeof(IDecompilerService), decompilerSvc); uiSvc = svcFactory.CreateShellUiService(form, dm); subWindowCommandTarget = uiSvc; sc.AddService(typeof(IDecompilerShellUiService), uiSvc); sc.AddService(typeof(IDecompilerUIService), uiSvc); var codeViewSvc = new CodeViewerServiceImpl(sc); sc.AddService(typeof(ICodeViewerService), codeViewSvc); var segmentViewSvc = new ImageSegmentServiceImpl(sc); sc.AddService(typeof(ImageSegmentService), segmentViewSvc); var del = svcFactory.CreateDecompilerEventListener(); workerDlgSvc = (IWorkerDialogService)del; sc.AddService(typeof(IWorkerDialogService), workerDlgSvc); sc.AddService(typeof(DecompilerEventListener), del); loader = svcFactory.CreateLoader(); sc.AddService(typeof(ILoader), loader); var abSvc = svcFactory.CreateArchiveBrowserService(); sc.AddService(typeof(IArchiveBrowserService), abSvc); sc.AddService(typeof(ILowLevelViewService), svcFactory.CreateMemoryViewService()); sc.AddService(typeof(IDisassemblyViewService), svcFactory.CreateDisassemblyViewService()); var tlSvc = svcFactory.CreateTypeLibraryLoaderService(); sc.AddService(typeof(ITypeLibraryLoaderService), tlSvc); this.projectBrowserSvc = svcFactory.CreateProjectBrowserService(form.ProjectBrowser); sc.AddService<IProjectBrowserService>(projectBrowserSvc); var upSvc = svcFactory.CreateUiPreferencesService(); sc.AddService<IUiPreferencesService>(upSvc); var fsSvc = svcFactory.CreateFileSystemService(); sc.AddService<IFileSystemService>(fsSvc); this.searchResultsTabControl = svcFactory.CreateTabControlHost(form.TabControl); sc.AddService<ITabControlHostService>(this.searchResultsTabControl); srSvc = svcFactory.CreateSearchResultService(form.FindResultsList); sc.AddService<ISearchResultService>(srSvc); searchResultsTabControl.Attach((IWindowPane) srSvc, form.FindResultsPage); searchResultsTabControl.Attach((IWindowPane) diagnosticsSvc, form.DiagnosticsPage); }
public IDecompilerShellUiService CreateShellUiService(IMainForm form, DecompilerMenus dm) { return new DecompilerShellUiService(form, dm, form.OpenFileDialog, form.SaveFileDialog, services); }
public IMainForm LoadForm() { this.form = dlgFactory.CreateMainForm(); dm = new DecompilerMenus(this); form.Menu = dm.MainMenu; dm.MainToolbar.Text = ""; dm.MainToolbar.ImageList = form.ImageList; form.AddToolbar(dm.MainToolbar); var svcFactory = sc.RequireService<IServiceFactory>(); CreateServices(svcFactory, sc, dm); CreatePhaseInteractors(svcFactory); form.Load += this.MainForm_Loaded; form.Closed += this.MainForm_Closed; form.ProcessCommandKey += this.MainForm_ProcessCommandKey; form.ToolBar.ItemClicked += toolBar_ItemClicked; //form.InitialPage.IsDirtyChanged += new EventHandler(InitialPage_IsDirtyChanged);//$REENABLE //MainForm.InitialPage.IsDirty = false; //$REENABLE return form; }