big transformation , using DockPanels now
it feels good to me! -Thoys git-svn-id: https://lsleditor.svn.sourceforge.net/svnroot/lsleditor@26 3f4676ac-adda-40fd-8265-58d1435b1672
This commit is contained in:
parent
75c722f354
commit
573823c181
92 changed files with 16899 additions and 760 deletions
47
trunk/Docking/DockPaneCollection.cs
Normal file
47
trunk/Docking/DockPaneCollection.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace LSLEditor.Docking
|
||||
{
|
||||
public class DockPaneCollection : ReadOnlyCollection<DockPane>
|
||||
{
|
||||
internal DockPaneCollection()
|
||||
: base(new List<DockPane>())
|
||||
{
|
||||
}
|
||||
|
||||
internal int Add(DockPane pane)
|
||||
{
|
||||
if (Items.Contains(pane))
|
||||
return Items.IndexOf(pane);
|
||||
|
||||
Items.Add(pane);
|
||||
return Count - 1;
|
||||
}
|
||||
|
||||
internal void AddAt(DockPane pane, int index)
|
||||
{
|
||||
if (index < 0 || index > Items.Count - 1)
|
||||
return;
|
||||
|
||||
if (Contains(pane))
|
||||
return;
|
||||
|
||||
Items.Insert(index, pane);
|
||||
}
|
||||
|
||||
internal void Dispose()
|
||||
{
|
||||
for (int i=Count - 1; i>=0; i--)
|
||||
this[i].Close();
|
||||
}
|
||||
|
||||
internal void Remove(DockPane pane)
|
||||
{
|
||||
Items.Remove(pane);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue