BackupEndpointCollection.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 (BackupEndpointElement))]
  13. public class BackupEndpointCollection : ConfigurationElementCollection
  14. {
  15. [ConfigurationProperty ("name", DefaultValue = null, Options = ConfigurationPropertyOptions.IsRequired)]
  16. public string Name {
  17. get { return (string) base ["name"]; }
  18. set { base ["name"] = value; }
  19. }
  20. public BackupEndpointCollection ()
  21. {
  22. }
  23. public void Add (BackupEndpointElement element)
  24. {
  25. BaseAdd (element);
  26. }
  27. public void Clear ()
  28. {
  29. BaseClear ();
  30. }
  31. protected override ConfigurationElement CreateNewElement ()
  32. {
  33. return new BackupEndpointElement ();
  34. }
  35. protected override object GetElementKey (ConfigurationElement element)
  36. {
  37. return ((BackupEndpointElement) element).EndpointName;
  38. }
  39. public void Remove (BackupEndpointElement element)
  40. {
  41. BaseRemove (element);
  42. }
  43. }
  44. }