示例#1
0
        public TreeDiagnosticsReader(ITreeReader inner)
        {
            Inner = inner;

            LastPropertyName = "<Database>";
            Path             = new Stack <TreeDiagnostics>();
            Tree             = Open();
        }
示例#2
0
        private TreeDiagnostics Open()
        {
            TreeDiagnostics item = new TreeDiagnostics(LastPropertyName, Position);

            if (Path.Count > 0)
            {
                Path.Peek().AddChild(item);
            }
            Path.Push(item);

            return(item);
        }
示例#3
0
        public T[] ReadBlockArray <T>() where T : unmanaged
        {
            // Add array type to diagnostics for array
            TreeDiagnostics diagnostics = Path.Peek();

            diagnostics.Name = $"{typeof(T).Name}[] {diagnostics.Name ?? ""}";

            T[] array = Inner.ReadBlockArray <T>();

            // Close array (no separate end token for BlockArray)
            Close();

            return(array);
        }
示例#4
0
 public TreeDiagnostics AddChild(TreeDiagnostics child)
 {
     Children = Children ?? new List <TreeDiagnostics>();
     Children.Add(child);
     return(child);
 }
示例#5
0
        private void Close()
        {
            TreeDiagnostics item = Path.Pop();

            item.EndPosition = Position;
        }