Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.WinFormsUI/2.3.1/WinFormsUI-2.3.1/Docking/DockPaneCollection.cs @ 2645

Last change on this file since 2645 was 2645, checked in by mkommend, 14 years ago

extracted external libraries and adapted dependent plugins (ticket #837)

File size: 897 bytes
Line 
1using System;
2using System.Collections.ObjectModel;
3using System.Collections.Generic;
4using System.Drawing;
5using System.Windows.Forms;
6
7namespace WeifenLuo.WinFormsUI.Docking
8{
9  public class DockPaneCollection : ReadOnlyCollection<DockPane>
10  {
11        internal DockPaneCollection()
12            : base(new List<DockPane>())
13        {
14        }
15
16    internal int Add(DockPane pane)
17    {
18      if (Items.Contains(pane))
19        return Items.IndexOf(pane);
20
21      Items.Add(pane);
22            return Count - 1;
23    }
24
25    internal void AddAt(DockPane pane, int index)
26    {
27      if (index < 0 || index > Items.Count - 1)
28        return;
29     
30      if (Contains(pane))
31        return;
32
33      Items.Insert(index, pane);
34    }
35
36    internal void Dispose()
37    {
38      for (int i=Count - 1; i>=0; i--)
39        this[i].Close();
40    }
41
42    internal void Remove(DockPane pane)
43    {
44      Items.Remove(pane);
45    }
46  }
47}
Note: See TracBrowser for help on using the repository browser.