Пример #1
0
 public int GetHashCode(ChannelOption obj)
 {
     return
         (obj == null ? 0 :
          obj.Type == ChannelOption.OptionType.Integer ?
          EqualityHelpers.CombineHashCodes(obj.IntValue, obj.Name.GetHashCode(), (int)obj.Type) :
          obj.Type == ChannelOption.OptionType.String ?
          EqualityHelpers.CombineHashCodes(obj.StringValue.GetHashCode(), obj.Name.GetHashCode(), (int)obj.Type) :
          throw new ArgumentException("Unexpected channel option type: " + obj.Type));
 }
Пример #2
0
 public override int GetHashCode() =>
 EqualityHelpers.CombineHashCodes(
     Endpoint.GetHashCode(),
     EqualityHelpers.GetListHashCode(Options, ChannelOptionComparer.Instance));