예제 #1
0
        /// <inheritdoc />
        public bool Equals(DictionaryToken other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (Data.Count != other.Data.Count)
            {
                return(false);
            }

            foreach (var kvp in other.Data)
            {
                if (!Data.TryGetValue(kvp.Key, out var val) || !val.Equals(kvp.Value))
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
 /// <summary>
 /// Create a new <see cref="StreamToken"/>.
 /// </summary>
 /// <param name="streamDictionary">The stream dictionary.</param>
 /// <param name="data">The stream data.</param>
 public StreamToken(DictionaryToken streamDictionary, IReadOnlyList <byte> data)
 {
     StreamDictionary = streamDictionary ?? throw new ArgumentNullException(nameof(streamDictionary));
     Data             = data ?? throw new ArgumentNullException(nameof(data));
 }