Пример #1
0
 public override void AppendChild(Pair child)
 {
     if (Delimiter == DelimiterEnum.EC)
     {
         if (InterpolationItems == null)
         {
             InterpolationItems = new List <object>();
         }
         InterpolationItems.Add(child);
         child.InitializeParent(this);
     }
     else
     {
         base.AppendChild(child);
     }
 }
Пример #2
0
 /// <inheritdoc />
 public override void AppendChild(Pair child) //todo: how to add comment to nsDef?
 {
     if (Assignment == AssignmentEnum.EC)
     {
         if (InterpolationItems == null)
         {
             InterpolationItems = new List <object>();
         }
         InterpolationItems.Add(child);
         child.InitializeParent(this);
     }
     else
     {
         base.AppendChild(child);
     }
 }
Пример #3
0
 /// <inheritdoc />
 public override void AppendChild(Pair child)
 {
     if (Assignment == AssignmentEnum.EC)
     {
         if (InterpolationItems == null)
         {
             InterpolationItems = new List <object>();
         }
         InterpolationItems.Add(child);
         child.InitializeParent(this);
     }
     else if (BlockType == BlockType.Default && Parent is IMappedPair mp && mp.BlockType == BlockType.JsonObject &&
              (child is DOM.Alias || child is DOM.Parameter))
     {
         PairValue = child;
         child.InitializeParent(this);
     }
Пример #4
0
        /// <inheritdoc />
        public override void AppendChild(Pair child)
        {
            if (Assignment == AssignmentEnum.EC)
            {
                if (InterpolationItems == null)
                {
                    InterpolationItems = new List <object>();
                }
                InterpolationItems.Add(child);
                child.InitializeParent(this);
            }
            else
            {
                if (Assignment == AssignmentEnum.C && Parent is IMappedPair mp && mp.BlockType == BlockType.JsonObject &&
                    child is Element el && el.NameInterval != null && el.NameInterval != Interval.Empty && el.Assignment == AssignmentEnum.None)
                {
                    ValueType = ValueType.Empty; //JSON value
                }

                base.AppendChild(child);
            }
        }
Пример #5
0
 public override void AppendChild(Pair child)
 {
     if (child is NamespaceDefinition)
     {
         if (Entities.Any(e => !(e is Comment)))
         {
             throw new ApplicationException("Namespaces must be defined first");
         }
     }
     if (Delimiter == DelimiterEnum.EC)
     {
         if (InterpolationItems == null)
         {
             InterpolationItems = new List <object>();
         }
         InterpolationItems.Add(child);
         child.InitializeParent(this);
     }
     else
     {
         base.AppendChild(child);
     }
 }
Пример #6
0
 /// <inheritdoc />
 public override void AppendChild(Pair child)
 {
     if (child is NamespaceDefinition)
     {
         if (Entities.Any(e => !(e is Comment)))
         {
             throw new ApplicationException("Namespaces must be defined first");
         }
     }
     if (Assignment == AssignmentEnum.EC)
     {
         if (InterpolationItems == null)
         {
             InterpolationItems = new List <object>();
         }
         InterpolationItems.Add(child);
         child.InitializeParent(this);
     }
     else if (BlockType == BlockType.Default && Parent is IMappedPair mp && mp.BlockType == BlockType.JsonObject &&
              (child is DOM.Alias || child is DOM.Parameter))
     {
         PairValue = child;
         child.InitializeParent(this);
     }