Esempio n. 1
0
        /// <summary>
        /// Append an Ion value to this datagram.
        /// </summary>
        private void AppendValue(IonValue value)
        {
            if (_annotations.Count > 0)
            {
                value.ClearAnnotations();
                foreach (var annotation in _annotations)
                {
                    value.AddTypeAnnotation(annotation);
                }

                _annotations.Clear();
            }

            if (IsInStruct)
            {
                var field = AssumeFieldNameSymbol();
                ClearFieldName();
                if (field == default)
                {
                    throw new InvalidOperationException("Field name is missing");
                }

                var structContainer = _currentContainer as IonStruct;
                Debug.Assert(structContainer != null);
                structContainer.Add(field, value);
            }
            else
            {
                _currentContainer.Add(value);
            }

            Debug.Assert(value.Container == _currentContainer);
        }
Esempio n. 2
0
 protected override void DoAdd(IonContainer container, IonValue item)
 {
     container.Add(item);
 }
Esempio n. 3
0
 internal override void DoAdd(IonContainer container, IonValue item)
 {
     container.Add(item);
 }