public object CreateControl() { var uiSvc = services.RequireService <IDecompilerShellUiService>(); this.combinedCodeView = new CombinedCodeView(); this.combinedCodeView.Dock = DockStyle.Fill; this.combinedCodeView.CurrentAddressChanged += CombinedCodeView_CurrentAddressChanged; this.combinedCodeView.MixedCodeDataView.VScrollValueChanged += MixedCodeDataView_VScrollValueChanged; this.combinedCodeView.MixedCodeDataView.Services = services; this.combinedCodeView.MixedCodeDataView.MouseDown += MixedCodeDataView_MouseDown; this.combinedCodeView.MixedCodeDataView.ModelChanged += MixedCodeDataView_ModelChanged; this.combinedCodeView.MixedCodeDataView.Navigate += TextView_Navigate; this.combinedCodeView.CodeView.VScrollValueChanged += CodeView_VScrollValueChanged; this.combinedCodeView.CodeView.Services = services; this.combinedCodeView.CodeView.MouseDown += CodeView_MouseDown; this.combinedCodeView.CodeView.Navigate += TextView_Navigate; uiSvc.SetContextMenu(this.combinedCodeView, MenuIds.CtxCodeView); this.combinedCodeView.ToolBarGoButton.Click += ToolBarGoButton_Click; this.combinedCodeView.ToolBarAddressTextbox.KeyDown += ToolBarAddressTextbox_KeyDown; this.gViewer = new GViewer(); this.gViewer.Dock = DockStyle.Fill; this.gViewer.Visible = false; this.gViewer.PanButtonPressed = true; this.gViewer.ToolBarIsVisible = true; this.gViewer.KeyDown += GViewer_KeyDown; uiSvc.SetContextMenu(this.gViewer, MenuIds.CtxCodeView); this.gViewer.LayoutAlgorithmSettingsButtonVisible = false; this.gViewer.LayoutEditingEnabled = false; this.gViewer.EdgeInsertButtonVisible = false; this.gViewer.SaveButtonVisible = false; this.gViewer.SaveGraphButtonVisible = false; this.gViewer.SaveAsMsaglEnabled = false; this.gViewer.UndoRedoButtonsVisible = false; this.gViewer.KeyDown += GViewer_KeyDown; uiSvc.SetContextMenu(this.gViewer, MenuIds.CtxCodeView); this.gViewer.MouseUp += GViewer_MouseUp; this.gViewer.DrawingPanel.MouseUp += GViewer_MouseUp; var iViewer = (IViewer)gViewer; iViewer.MouseUp += IViewer_MouseUp; iViewer.MouseDown += IViewer_MouseDown; this.navInteractor = new NavigationInteractor <Address>(); this.navInteractor.Attach(this.combinedCodeView); declarationFormInteractor = new DeclarationFormInteractor(services); commentFormInteractor = new CommentFormInteractor(services); previewInteractor = new PreviewInteractor( services, this.program, this.combinedCodeView.PreviewTimer, this.combinedCodeView.MixedCodeDataView); return(combinedCodeView); }
public void Setup() { services = new ServiceContainer(); commentForm = new Mock <IDeclarationForm>(); textBox = new FakeTextBox(); commentForm.Setup(f => f.TextBox).Returns(textBox); commentForm.Setup(f => f.ShowAt(new Point())); commentForm.Setup(f => f.Hide()); commentForm.Setup(f => f.Dispose()); commentForm.SetupProperty(f => f.HintText); var dlgFactory = new Mock <IDialogFactory>(); dlgFactory .Setup(f => f.CreateCommentForm()) .Returns(commentForm.Object); services.AddService <IDialogFactory>(dlgFactory.Object); interactor = new CommentFormInteractor(services); program = new Program(); }
public void Setup() { mr = new MockRepository(); services = new ServiceContainer(); commentForm = mr.Stub <IDeclarationForm>(); textBox = new FakeTextBox(); commentForm.Stub(f => f.TextBox).Return(textBox); commentForm.Stub(f => f.ShowAt(new Point())); commentForm.Stub(f => f.Hide()); commentForm.Stub(f => f.Dispose()); var dlgFactory = mr.Stub <IDialogFactory>(); dlgFactory .Stub(f => f.CreateCommentForm()) .Return(commentForm); services.AddService <IDialogFactory>(dlgFactory); mr.ReplayAll(); interactor = new CommentFormInteractor(services); program = new Program(); }