Exemplo n.º 1
0
        public IEnumerator <KeyValuePair <TKey, ISet <TValue> > > GetEnumerator()
        {
            if (_index != null)
            {
                return(_index.GetEnumerator());
            }

            return(Enumerable.Empty <KeyValuePair <TKey, ISet <TValue> > >().GetEnumerator());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns a <see cref="VectorTime"/> being the merged min value of all observed vector clocks.
        /// </summary>
        public VectorTime Min()
        {
            using (var enumerator = observations.GetEnumerator())
            {
                if (!enumerator.MoveNext())
                {
                    return(VectorTime.Zero);
                }

                var result = enumerator.Current.Value;
                while (enumerator.MoveNext())
                {
                    result = result.MergeMin(enumerator.Current.Value);
                }

                return(result);
            }
        }
 IEnumerator <KeyValuePair <TKey, TValue> > IEnumerable <KeyValuePair <TKey, TValue> > .GetEnumerator()
 {
     return(inner.GetEnumerator());
 }
Exemplo n.º 4
0
 protected override ImmutableDictionary <TKey, TValue> .Enumerator GetSourceEnumerator(ImmutableDictionary <TKey, TValue> source)
 {
     return(source.GetEnumerator());
 }
Exemplo n.º 5
0
 /// <inheritdoc />
 public IEnumerator <KeyValuePair <char, int> > GetEnumerator()
 {
     return(_powers.GetEnumerator());
 }
 /// <summary>
 /// Get an enumerator over the entries.
 /// </summary>
 IEnumerator <KeyValuePair <string, T> > IEnumerable <KeyValuePair <string, T> > .GetEnumerator()
 {
     return(_backing.GetEnumerator());
 }
 public IEnumerator <KeyValuePair <string, PropertyInfo> > GetEnumerator()
 {
     return(_dictionary.GetEnumerator());
 }
Exemplo n.º 8
0
 public IEnumerator <KeyValuePair <T, V> > GetEnumerator()
 {
     return(_items.GetEnumerator());
 }
 public IEnumerator <KeyValuePair <int, ProcessWatcher> > GetEnumerator( ) => watchers.GetEnumerator( );
Exemplo n.º 10
0
 public IEnumerator <KeyValuePair <IKey, IValue> > GetEnumerator() => _value?.GetEnumerator()
 ?? Enumerable.Empty <KeyValuePair <IKey, IValue> >().GetEnumerator();
Exemplo n.º 11
0
 public IEnumerator <KeyValuePair <TKey, ISet <TValue> > > GetEnumerator() => _index.GetEnumerator();
Exemplo n.º 12
0
 public IEnumerator <KeyValuePair <string, object> > GetEnumerator() => _values.GetEnumerator();
Exemplo n.º 13
0
 public ImmutableDictionary <string, BlockchainApiClient> .Enumerator GetApiClientsEnumerator()
 {
     return(_apiClients.GetEnumerator());
 }
Exemplo n.º 14
0
 /// <summary>
 /// Returns an enumerator over all dependencies in the project tree.
 /// </summary>
 /// <returns></returns>
 public ImmutableDictionary <string, IDependency> .Enumerator GetEnumerator()
 {
     return(_worldBuilder.GetEnumerator());
 }
 public ImmutableDictionary <TKey, TValue> .Enumerator Invoke(ImmutableDictionary <TKey, TValue> source)
 => source.GetEnumerator();
Exemplo n.º 16
0
        public static void SerializeStatic(ref JsonWriter writer, ImmutableDictionary <string, TValue> value, JsonSerializerOptions options)
#endif
        {
            if (value is null)
            {
                writer.WriteNull();
                return;
            }

            if (writer.Depth >= options.MaxDepth)
            {
                writer.Writer.WriteEmptyObject();
                return;
            }

            ++writer.Depth;
            writer.WriteBeginObject();

            var e = value.GetEnumerator();

            try
            {
                if (!e.MoveNext())
                {
                    goto END;
                }

                var tuple        = e.Current;
                var propertyName = tuple.Key;
                Debug.Assert(propertyName != null, nameof(propertyName) + " != null");
                writer.WritePropertyName(propertyName);
#if !ENABLE_IL2CPP
                var valueSerializer = options.Resolver.GetSerializeStatic <TValue>();
                if (valueSerializer.ToPointer() != null)
                {
                    writer.Serialize(tuple.Value, options, valueSerializer);
                    while (e.MoveNext())
                    {
                        writer.WriteValueSeparator();
                        tuple        = e.Current;
                        propertyName = tuple.Key;
                        Debug.Assert(propertyName != null, nameof(propertyName) + " != null");
                        writer.WritePropertyName(propertyName);
                        writer.Serialize(tuple.Value, options, valueSerializer);
                    }
                    goto END;
                }
#endif
                var valueFormatter = options.Resolver.GetFormatterWithVerify <TValue>();
                valueFormatter.Serialize(ref writer, tuple.Value, options);
                while (e.MoveNext())
                {
                    writer.WriteValueSeparator();
                    tuple        = e.Current;
                    propertyName = tuple.Key;
                    Debug.Assert(propertyName != null, nameof(propertyName) + " != null");
                    writer.WritePropertyName(propertyName);
                    valueFormatter.Serialize(ref writer, tuple.Value, options);
                }
            }
            finally
            {
                e.Dispose();
            }

END:
            writer.WriteEndObject();
            --writer.Depth;
        }
Exemplo n.º 17
0
 public ImmutableDictionary <string, string> .Enumerator GetEnumerator() =>
 table.GetEnumerator();