MetadataConversionError.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. namespace System.ServiceModel.Description
  5. {
  6. using System.Collections.ObjectModel;
  7. using System.ServiceModel.Channels;
  8. public class MetadataConversionError
  9. {
  10. string message;
  11. bool isWarning;
  12. public MetadataConversionError(string message) : this(message, false) { }
  13. public MetadataConversionError(string message, bool isWarning)
  14. {
  15. if (message == null)
  16. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message");
  17. this.message = message;
  18. this.isWarning = isWarning;
  19. }
  20. public string Message { get { return message; } }
  21. public bool IsWarning { get { return isWarning; } }
  22. public override bool Equals(object obj)
  23. {
  24. MetadataConversionError otherError = obj as MetadataConversionError;
  25. if (otherError == null)
  26. return false;
  27. return otherError.IsWarning == this.IsWarning && otherError.Message == this.Message;
  28. }
  29. public override int GetHashCode()
  30. {
  31. return message.GetHashCode();
  32. }
  33. }
  34. }