private frmTabView ActivateDocument(object element) { this.Cursor = Cursors.WaitCursor; Icon icon = null; IDockContent content = this.FindDocument(((IdentificableObject)element).Name); if(content != null) { content.DockHandler.Activate(); this.Cursor = Cursors.Default; return (frmTabView)content; } frmTabView frm = new frmTabView( this, element, this.separators, this.hdc, this.localizer); if(element.GetType() == typeof(Package) || element.GetType() == typeof(Model)) { icon = Icon.FromHandle(((Bitmap)imgListModelBrowser.Images[0]).GetHicon()); } if(element.GetType() == typeof(Actor)) { icon = Icon.FromHandle(((Bitmap)imgListModelBrowser.Images[3]).GetHicon()); } if(element.GetType() == typeof(UseCase)) { icon = Icon.FromHandle(((Bitmap)imgListModelBrowser.Images[4]).GetHicon()); } frm.Icon = (Icon)icon.Clone(); Win32.DestroyIcon(icon.Handle); frm.Show(this.dockPanel, DockState.Document); frm.Activate(); this.Cursor = Cursors.Default; return frm; }