FindCriteriaElement.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using System.ComponentModel;
  3. using System.Configuration;
  4. using System.ServiceModel.Configuration;
  5. namespace System.ServiceModel.Discovery.Configuration
  6. {
  7. public sealed class FindCriteriaElement : ConfigurationElement
  8. {
  9. static ConfigurationPropertyCollection properties;
  10. static ConfigurationProperty types, duration, extensions, max_results, scope_match_by, scopes;
  11. static FindCriteriaElement ()
  12. {
  13. types = new ConfigurationProperty ("types", typeof (ContractTypeNameElementCollection), null, null, null, ConfigurationPropertyOptions.None);
  14. duration = new ConfigurationProperty ("duration", typeof (TimeSpan), "00:00:20", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
  15. extensions = new ConfigurationProperty ("extensions", typeof (XmlElementElementCollection), null, null, null, ConfigurationPropertyOptions.None);
  16. max_results = new ConfigurationProperty ("maxResults", typeof (TimeSpan), "00:00:20", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
  17. scope_match_by = new ConfigurationProperty ("scopeMatchBy", typeof (Uri), null, null, null, ConfigurationPropertyOptions.None);
  18. scopes = new ConfigurationProperty ("scopes", typeof (ScopeElementCollection), null, null, null, ConfigurationPropertyOptions.None);
  19. properties = new ConfigurationPropertyCollection ();
  20. properties.Add (types);
  21. properties.Add (duration);
  22. properties.Add (extensions);
  23. properties.Add (max_results);
  24. properties.Add (scope_match_by);
  25. properties.Add (scopes);
  26. }
  27. public FindCriteriaElement ()
  28. {
  29. }
  30. [ConfigurationProperty ("types")]
  31. public ContractTypeNameElementCollection ContractTypeNames {
  32. get { return (ContractTypeNameElementCollection) base [types]; }
  33. }
  34. [ConfigurationProperty ("duration", DefaultValue = "00:00:20")]
  35. [TypeConverter (typeof (TimeSpanConverter))]
  36. public TimeSpan Duration {
  37. get { return (TimeSpan) base [duration]; }
  38. set { base [duration] = value; }
  39. }
  40. [ConfigurationProperty ("extensions")]
  41. public XmlElementElementCollection Extensions {
  42. get { return (XmlElementElementCollection) base [extensions]; }
  43. }
  44. [ConfigurationProperty ("maxResults", DefaultValue = 0)]
  45. [IntegerValidator (MinValue = 0, MaxValue = int.MaxValue)]
  46. public int MaxResults {
  47. get { return (int) base [max_results]; }
  48. set { base [max_results] = value; }
  49. }
  50. [ConfigurationProperty ("scopeMatchBy")]
  51. [TypeConverter (typeof (UriTypeConverter))]
  52. public Uri ScopeMatchBy {
  53. get { return (Uri) base [scope_match_by]; }
  54. set { base [scope_match_by] = value; }
  55. }
  56. [ConfigurationProperty ("scopes")]
  57. public ScopeElementCollection Scopes {
  58. get { return (ScopeElementCollection) base [scopes]; }
  59. }
  60. }
  61. }