LSLEditor/trunk/Docking/FloatWindowCollection.cs
thoysg 573823c181 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
2010-08-02 14:35:46 +00:00

42 lines
784 B
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
public class FloatWindowCollection : ReadOnlyCollection<FloatWindow>
{
internal FloatWindowCollection()
: base(new List<FloatWindow>())
{
}
internal int Add(FloatWindow fw)
{
if (Items.Contains(fw))
return Items.IndexOf(fw);
Items.Add(fw);
return Count - 1;
}
internal void Dispose()
{
for (int i=Count - 1; i>=0; i--)
this[i].Close();
}
internal void Remove(FloatWindow fw)
{
Items.Remove(fw);
}
internal void BringWindowToFront(FloatWindow fw)
{
Items.Remove(fw);
Items.Add(fw);
}
}
}