コード例 #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;
        }