NetMsmqSecurityMode.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //----------------------------------------------------------------------------
  4. namespace System.ServiceModel
  5. {
  6. using System.ServiceModel.Channels;
  7. public enum NetMsmqSecurityMode
  8. {
  9. None,
  10. Transport,
  11. Message,
  12. Both
  13. }
  14. static class NetMsmqSecurityModeHelper
  15. {
  16. internal static bool IsDefined(NetMsmqSecurityMode value)
  17. {
  18. return (value == NetMsmqSecurityMode.Transport
  19. || value == NetMsmqSecurityMode.Message
  20. || value == NetMsmqSecurityMode.Both
  21. || value == NetMsmqSecurityMode.None);
  22. }
  23. internal static NetMsmqSecurityMode ToSecurityMode(UnifiedSecurityMode value)
  24. {
  25. switch (value)
  26. {
  27. case UnifiedSecurityMode.None:
  28. return NetMsmqSecurityMode.None;
  29. case UnifiedSecurityMode.Transport:
  30. return NetMsmqSecurityMode.Transport;
  31. case UnifiedSecurityMode.Message:
  32. return NetMsmqSecurityMode.Message;
  33. case UnifiedSecurityMode.Both:
  34. return NetMsmqSecurityMode.Both;
  35. default:
  36. return (NetMsmqSecurityMode)value;
  37. }
  38. }
  39. }
  40. }