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 @ 6675

Last change on this file since 6675 was 4068, checked in by swagner, 14 years ago

Sorted usings and removed unused usings in entire solution (#1094)

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