EmptyControlCollection.cs 589 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // System.Web.UI.EmptyControlCollection.cs
  3. //
  4. // Duncan Mak ([email protected])
  5. //
  6. // (C) Ximian, Inc.
  7. //
  8. using System;
  9. namespace System.Web.UI {
  10. public class EmptyControlCollection : ControlCollection
  11. {
  12. public EmptyControlCollection (Control owner)
  13. : base (owner)
  14. {
  15. }
  16. public override void Add (Control child)
  17. {
  18. throw new NotSupportedException ("Control " + Owner.ID + " does not allow children");
  19. }
  20. public override void AddAt (int index, Control child)
  21. {
  22. throw new NotSupportedException ("Control " + Owner.ID + " does not allow children");
  23. }
  24. }
  25. }