protected override void OnDestroyed() { if (viewContents != null) { foreach (BaseViewContent sv in SubViewContents) { sv.Dispose(); } viewContents = null; } if (content != null) { content.ContentNameChanged -= SetTitleEvent; content.DirtyChanged -= HandleDirtyChanged; content.WorkbenchWindow = null; content.Dispose(); content = null; } if (subViewToolbar != null) { subViewToolbar.Dispose(); subViewToolbar = null; } DetachFromPathedDocument(); commandHandler = null; document = null; extensionContext = null; base.OnDestroyed(); }
protected override void OnDestroyed() { base.OnDestroyed(); if (viewContents != null) { foreach (IAttachableViewContent sv in SubViewContents) { sv.Dispose(); } viewContents = null; } if (content != null) { content.ContentNameChanged -= new EventHandler(SetTitleEvent); content.DirtyChanged -= HandleDirtyChanged; content.BeforeSave -= new EventHandler(BeforeSave); content.ContentChanged -= new EventHandler(OnContentChanged); content.WorkbenchWindow = null; content.Dispose(); content = null; } DetachFromPathedDocument(); commandHandler = null; document = null; extensionContext = null; }
public SdiWorkspaceWindow(DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base() { this.workbench = workbench; this.tabControl = tabControl; this.content = content; this.tabLabel = tabLabel; this.tabPage = content.Control; content.WorkbenchWindow = this; content.ContentNameChanged += new EventHandler(SetTitleEvent); content.DirtyChanged += new EventHandler(SetTitleEvent); content.BeforeSave += new EventHandler(BeforeSave); content.ContentChanged += new EventHandler(OnContentChanged); ShadowType = ShadowType.None; box = new VBox(); box.PackStart(content.Control); Add(box); box.Show(); SetTitleEvent(null, null); commandHandler = new ViewCommandHandlers(this); Show(); }
public SdiWorkspaceWindow(DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base() { this.workbench = workbench; this.tabControl = tabControl; this.content = content; this.tabLabel = tabLabel; this.tabPage = content.Control; ShadowType = ShadowType.None; box = new VBox(); Add(box); box.PackStart(content.Control); fileTypeCondition.SetFileName(content.ContentName ?? content.UntitledName); extensionContext = AddinManager.CreateExtensionContext(); extensionContext.RegisterCondition("FileType", fileTypeCondition); content.WorkbenchWindow = this; content.ContentNameChanged += new EventHandler(SetTitleEvent); content.DirtyChanged += new EventHandler(SetTitleEvent); content.BeforeSave += new EventHandler(BeforeSave); content.ContentChanged += new EventHandler(OnContentChanged); box.Show(); SetTitleEvent(null, null); commandHandler = new ViewCommandHandlers(this); Show(); }
public SdiWorkspaceWindow(DefaultWorkbench workbench, IViewContent content, DockNotebook tabControl, IDockNotebookTab tabLabel) : base() { this.workbench = workbench; this.tabControl = tabControl; this.content = content; this.tab = tabLabel; this.tabPage = content.Control; fileTypeCondition.SetFileName(content.ContentName ?? content.UntitledName); extensionContext = AddinManager.CreateExtensionContext(); extensionContext.RegisterCondition("FileType", fileTypeCondition); box = new VBox(); viewContents.Add(content); //this fires an event that the content uses to access this object's ExtensionContext content.WorkbenchWindow = this; // The previous WorkbenchWindow property assignement may end with a call to AttachViewContent, // which will add the content control to the subview notebook. In that case, we don't need to add it to box if (subViewNotebook == null) { box.PackStart(content.Control); } content.ContentNameChanged += new EventHandler(SetTitleEvent); content.DirtyChanged += HandleDirtyChanged; content.BeforeSave += new EventHandler(BeforeSave); content.ContentChanged += new EventHandler(OnContentChanged); box.Show(); Add(box); SetTitleEvent(null, null); commandHandler = new ViewCommandHandlers(this); }
internal void CreateCommandHandler() { commandHandler = new ViewCommandHandlers(this); }