public EditorView(IViewContent content) { this.content = content; preview = new PreviewEditorView(content.Control.ToEto(), () => content?.WorkbenchWindow?.Document?.Editor?.Text); content.ContentChanged += content_ContentChanged; content.DirtyChanged += content_DirtyChanged; var commandRouterContainer = new CommandRouterContainer(preview.ToNative(true), content, true); commandRouterContainer.Show(); control = commandRouterContainer; IdeApp.Workbench.ActiveDocumentChanged += Workbench_ActiveDocumentChanged; base.ContentName = content.ContentName; }
public CombinedDesignView (IViewContent content) { this.content = content; if (content is IEditableTextBuffer) { ((IEditableTextBuffer)content).CaretPositionSet += delegate { ShowPage (0); }; } content.ContentChanged += new EventHandler (OnTextContentChanged); content.DirtyChanged += new EventHandler (OnTextDirtyChanged); notebook = new Gtk.Notebook (); // Main notebook notebook.TabPos = Gtk.PositionType.Bottom; notebook.ShowTabs = false; notebook.ShowBorder = false; notebook.Show (); box = new VBox (); // Bottom toolbar toolbar = new Toolbar (); toolbar.IconSize = IconSize.SmallToolbar; toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; toolbar.ShowArrow = false; CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true); crc.Show (); AddButton (GettextCatalog.GetString ("Source Code"), crc).Active = true; toolbar.ShowAll (); box.PackStart (notebook, true, true, 0); box.PackStart (toolbar, false, false, 0); box.Show (); IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged); content.Control.Realized += delegate { if (content != null && content.WorkbenchWindow != null) content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this; }; notebook.SwitchPage += delegate { if (content != null && content.WorkbenchWindow != null) content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this; }; }
public CombinedDesignView (ViewContent content) { this.content = content; /* This code causes that chagnes in a version control view always select the source code view. if (content is IEditableTextBuffer) { ((IEditableTextBuffer)content).CaretPositionSet += delegate { ShowPage (0); }; }*/ content.DirtyChanged += new EventHandler (OnTextDirtyChanged); CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true); crc.Show (); control = crc; IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged); }