BackupListCollection.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Configuration;
  5. using System.ServiceModel;
  6. using System.ServiceModel.Channels;
  7. using System.ServiceModel.Configuration;
  8. using System.ServiceModel.Description;
  9. using System.ServiceModel.Dispatcher;
  10. namespace System.ServiceModel.Routing.Configuration
  11. {
  12. [ConfigurationCollection (typeof (BackupEndpointCollection), AddItemName = "backupList")]
  13. public class BackupListCollection : ConfigurationElementCollection
  14. {
  15. public void Add (BackupEndpointCollection element)
  16. {
  17. BaseAdd (element);
  18. }
  19. public void Clear ()
  20. {
  21. BaseClear ();
  22. }
  23. protected override ConfigurationElement CreateNewElement ()
  24. {
  25. return new BackupEndpointElement ();
  26. }
  27. protected override Object GetElementKey (ConfigurationElement element)
  28. {
  29. return ((BackupEndpointElement) element).EndpointName;
  30. }
  31. public void Remove (BackupEndpointCollection element)
  32. {
  33. BaseRemove (element);
  34. }
  35. public new BackupEndpointCollection this [string name] {
  36. get {
  37. foreach (BackupEndpointCollection c in this)
  38. if (c.Name == name)
  39. return c;
  40. return null;
  41. }
  42. }
  43. }
  44. }