Lawo.EmberPlusSharp.Ember.EmberReader.CopyToEndContainer C# (CSharp) Méthode

CopyToEndContainer() public méthode

Reads data and writes it to writer until the end of the current container is reached.

While Read returns true and InnerNumber is not equal to Ember.InnerNumber.EndContainer, calls Copy.

has been called.
public CopyToEndContainer ( EmberWriter writer, EmberId outerId ) : object
writer EmberWriter
outerId EmberId
Résultat object
        public object CopyToEndContainer(EmberWriter writer, EmberId? outerId)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            object result = null;
            var inner = -1;

            while (this.Read() && ((inner = this.innerNumber.GetValueOrDefault()) != Ember.InnerNumber.EndContainer))
            {
                var candidate = this.CopyCore(writer, inner);

                if (this.outer.HasValue && (this.outer.Value == outerId))
                {
                    result = candidate;
                }
            }

            if (inner == Ember.InnerNumber.EndContainer)
            {
                writer.WriteEndContainer();
            }

            return result;
        }