FloatWindowCollection.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:FloatWindowCollection.cs
  5. * 2.功能描述:类文件
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/01 1.00 新建
  9. *******************************************************************************/
  10. using System.Collections.Generic;
  11. using System.Collections.ObjectModel;
  12. namespace Dongke.IBOSS.PRD.Basics.DockPanel
  13. {
  14. public class FloatWindowCollection : ReadOnlyCollection<FloatWindow>
  15. {
  16. internal FloatWindowCollection()
  17. : base(new List<FloatWindow>())
  18. {
  19. }
  20. internal int Add(FloatWindow fw)
  21. {
  22. if (Items.Contains(fw))
  23. return Items.IndexOf(fw);
  24. Items.Add(fw);
  25. return Count - 1;
  26. }
  27. internal void Dispose()
  28. {
  29. for (int i = Count - 1; i >= 0; i--)
  30. this[i].Close();
  31. }
  32. internal void Remove(FloatWindow fw)
  33. {
  34. Items.Remove(fw);
  35. }
  36. internal void BringWindowToFront(FloatWindow fw)
  37. {
  38. Items.Remove(fw);
  39. Items.Add(fw);
  40. }
  41. }
  42. }