示例#1
0
        public override void StepIn(IonType type)
        {
            IonContainer c;

            switch (type)
            {
            case IonType.List:
                c = new IonList();
                break;

            case IonType.Sexp:
                c = new IonSexp();
                break;

            case IonType.Struct:
                c = new IonStruct();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }

            _containers.Push(c);
            AppendValue(c);
            _currentContainer = c;
        }
示例#2
0
 public override void StepOut()
 {
     if (_containers.Count > 0)
     {
         _containers.Pop();
         _currentContainer = _containers.Peek();
     }
     else
     {
         throw new InvalidOperationException("Cannot step out of top level value");
     }
 }
示例#3
0
 public IIonWriter NewWriter(IIonContainer container)
 {
     throw new NotImplementedException();
 }
示例#4
0
 public IonTreeWriter(IonContainer root)
 {
     Debug.Assert(root != null);
     _currentContainer = root;
     _containers.Push(root);
 }
示例#5
0
 public IonTreeWriter(IonContainer root)
 {
     Debug.Assert(root != null, "root is null");
     this.currentContainer = root;
     this.containers.Push(root);
 }