Akka.Configuration.Hocon.HoconValue.NewValue C# (CSharp) Метод

NewValue() публичный Метод

Creates a fresh list of elements inside this HoconValue and adds the given value to the list.
public NewValue ( IHoconElement value ) : void
value IHoconElement The element to add to the list.
Результат void
        public void NewValue(IHoconElement value)
        {
            Values.Clear();
            Values.Add(value);
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Parses the object.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="root">if set to <c>true</c> [root].</param>
        private void ParseObject(HoconValue owner, bool root)
        {
            if (owner.IsObject())
            {
                //the value of this KVP is already an object
            }
            else
            {
                //the value of this KVP is not an object, thus, we should add a new
                owner.NewValue(new HoconObject());
            }

            HoconObject currentObject = owner.GetObject();

            while (!reader.EoF)
            {
                Token t = reader.PullNext();
                switch (t.Type)
                {
                    case TokenType.EoF:
                        break;
                    case TokenType.Key:
                        HoconValue value = currentObject.GetOrCreateKey(t.Value);
                        ParseKeyContent(value);
                        if (!root)
                            return;
                        break;

                    case TokenType.ObjectEnd:
                        return;
                }
            }
        }
All Usage Examples Of Akka.Configuration.Hocon.HoconValue::NewValue