SecurityHeaderLayout.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. namespace System.ServiceModel.Channels
  5. {
  6. using System.ComponentModel;
  7. public enum SecurityHeaderLayout
  8. {
  9. Strict = 0,
  10. Lax = 1,
  11. LaxTimestampFirst = 2,
  12. LaxTimestampLast = 3
  13. }
  14. static class SecurityHeaderLayoutHelper
  15. {
  16. public static bool IsDefined(SecurityHeaderLayout value)
  17. {
  18. return (value == SecurityHeaderLayout.Lax
  19. || value == SecurityHeaderLayout.LaxTimestampFirst
  20. || value == SecurityHeaderLayout.LaxTimestampLast
  21. || value == SecurityHeaderLayout.Strict);
  22. }
  23. public static void Validate(SecurityHeaderLayout value)
  24. {
  25. if (!IsDefined(value))
  26. {
  27. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int)value,
  28. typeof(SecurityHeaderLayout)));
  29. }
  30. }
  31. }
  32. }