SecurityTokenReferenceStyle.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. namespace System.ServiceModel.Security.Tokens
  5. {
  6. using System;
  7. using System.ComponentModel;
  8. public enum SecurityTokenReferenceStyle
  9. {
  10. Internal = 0,
  11. External = 1,
  12. }
  13. static class TokenReferenceStyleHelper
  14. {
  15. public static bool IsDefined(SecurityTokenReferenceStyle value)
  16. {
  17. return (value == SecurityTokenReferenceStyle.External || value == SecurityTokenReferenceStyle.Internal);
  18. }
  19. public static void Validate(SecurityTokenReferenceStyle value)
  20. {
  21. if (!IsDefined(value))
  22. {
  23. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int)value,
  24. typeof(SecurityTokenReferenceStyle)));
  25. }
  26. }
  27. }
  28. }