コード例 #1
0
 /// <inheritdoc />
 protected override int ComputeHashCode()
 {
     unchecked
     {
         var hash = KeyContract.GetHashCode();
         hash <<= 5;
         hash  ^= ValueContract.GetHashCode();
         return(hash);
     }
 }
コード例 #2
0
 /// <inheritdoc />
 public IWriteContract CopyTo(ContractCollection collection)
 {
     return(collection.GetOrCreate(this, () => new DictionaryWriteContract(KeyContract.CopyTo(collection), ValueContract.CopyTo(collection))));
 }
コード例 #3
0
 /// <inheritdoc />
 public bool CanReadFrom(IWriteContract writeContract, bool strict)
 {
     return(writeContract is DictionaryWriteContract ws &&
            KeyContract.CanReadFrom(ws.KeyContract, strict) &&
            ValueContract.CanReadFrom(ws.ValueContract, strict));
 }