protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (disposing)
     {
         if (padDescriptor != null)
         {
             padDescriptor.Dispose();
             padDescriptor = null;
         }
     }
 }
 public PadContentWrapper(PadDescriptor padDescriptor)
 {
     if (padDescriptor == null)
         throw new ArgumentNullException("padDescriptor");
     this.padDescriptor = padDescriptor;
     //this.DockableAreas = ((((WeifenLuo.WinFormsUI.DockAreas.Float | WeifenLuo.WinFormsUI.DockAreas.DockLeft) |
     //                        WeifenLuo.WinFormsUI.DockAreas.DockRight) |
     //                       WeifenLuo.WinFormsUI.DockAreas.DockTop) |
     //                      WeifenLuo.WinFormsUI.DockAreas.DockBottom);
     this.DockAreas = ((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft) |
                             WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight) |
                            WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop) |
                           WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom);
     HideOnClose = true;
 }
        PadContentWrapper CreateContent(PadDescriptor content)
        {
            if (contentHash.ContainsKey(content.Class))
            {
                return contentHash[content.Class];
            }
            ICSharpCode.Core.Properties properties = (ICSharpCode.Core.Properties)PropertyService.Get("Workspace.ViewMementos", new ICSharpCode.Core.Properties());

            PadContentWrapper newContent = new PadContentWrapper(content);
            if (content.Icon != null)
            {
                newContent.Icon = IconService.GetIcon(content.Icon);
            }
            newContent.Text = StringParser.Parse(content.Title);
            contentHash[content.Class] = newContent;
            return newContent;
        }
 public void ShowPad(PadDescriptor content)
 {
     ShowPad(content, false);
 }
 public void ShowPad(PadDescriptor content, bool bActivatedIt)
 {
     if (content == null)
     {
         return;
     }
     if (!contentHash.ContainsKey(content.Class))
     {
         DockContent newContent = CreateContent(content);
         newContent.Show(dockPanel);
     }
     else
     {
         contentHash[content.Class].Show();
         if (bActivatedIt)
             contentHash[content.Class].PanelPane.Activate();
     }
 }
 public void DetachContent()
 {
     Controls.Clear();
     padDescriptor = null;
 }
            public MyMenuItem(PadDescriptor padDescriptor)
                : base(null, null)
            {
                this.padDescriptor = padDescriptor;
                Text = StringParser.Parse(padDescriptor.Title);

                if (padDescriptor.Icon != null)
                {
                    base.Image = IconService.GetBitmap(padDescriptor.Icon);
                }

                if (padDescriptor.Shortcut != null)
                {
                    ShortcutKeys = ICSharpCode.Core.WinForms.MenuCommand.ParseShortcut(padDescriptor.Shortcut);
                }
            }
        public virtual void ShowPad(PadDescriptor content)
        {
            PadContentCollection.Add(content);

            if (layout != null)
            {
                layout.ShowPad(content);
            }
        }