示例#1
0
        public void Inspect(string name, Object o, bool autoExpand, Type t)
        {
            var insertPosition = Math.Min(2, InspectedObjects.Count);

            foreach (var currentObject in InspectedObjects)
            {
                var currentNode = currentObject;
                if (currentNode.Name == name)
                {
                    if (currentNode.Type != t)
                    {
                        InspectedObjects.Remove(currentNode);
                        currentNode = new InspectorNode(o, name, autoExpand);
                        InspectedObjects.Add(currentNode);
                    }
                    else
                    {
                        currentNode.RootTarget = o;
                    }
                    // This might be null if the window has not oppened yet.
                    if (currentNode.UIContainer != null)
                    {
                        currentNode.UIContainer.IsSelected = true;
                        currentNode.UIContainer.BringIntoView();
                    }
                    return;
                }
            }

            var root = new InspectorNode(o, name, autoExpand);

            InspectedObjects.Insert(insertPosition, root);
        }
示例#2
0
        public override void Watch(InspectorNode node)
        {
            if (_inspectorUI == null)
            {
                return;
            }

            _inspectorUI.Watch(node);
        }
示例#3
0
        public void Watch(InspectorNode node)
        {
            if (node == null)
            {
                return;
            }

            WatchedNodes.Add(node);
        }
示例#4
0
 void UpdateFilterRecursively(InspectorNode node)
 {
     if (node.ChildrenView != null)
     {
         foreach (var child in node.Children)
         {
             UpdateFilterRecursively(child);
         }
         node.ChildrenView.View.Refresh();
         if (node.UserModified && node.UIContainer != null)
         {
             node.UIContainer.IsExpanded = true;
         }
     }
 }
示例#5
0
        public void RemoveInspect(Object o)
        {
            InspectorNode container = null;

            foreach (var node in InspectedObjects)
            {
                if (node.Target == o)
                {
                    container = node;
                    break;
                }
            }
            if (container != null)
            {
                InspectedObjects.Remove(container);
            }
        }
示例#6
0
 public virtual void Watch(InspectorNode node)
 {
 }
示例#7
0
 public override void Watch(InspectorNode node)
 {
 }