예제 #1
0
        private void ShowPropertyAccessTree(PropertyAccessTree tree)
        {
            var g = new BidirectionalGraph<object, IEdge<object>>();

            foreach (var node in tree.GraphDebug_GetChildren())
            {
                var parameter_node = node as ParameterNode;
                if (parameter_node == null) continue;

                var parameter_node_name = string.Format("{0} - {1}", parameter_node.Type.UnderlyingSystemType.Name, parameter_node.Name);
                g.AddVertex(parameter_node_name);

                BuildPropertyAccessTreeGraph(g, parameter_node_name, parameter_node.Children);
            }

            graph_layout.Graph = g;
        }
예제 #2
0
        public static PropertyAccessTree Create(object obj, string property_name)
        {
            log.Trace("Building property access tree");

            PropertyAccessTree tree = new PropertyAccessTree();

            if (!TypeHelper.DoesTypeImplementINotifyPropertyChangedAndChanging(obj.GetType()))
                throw new ArgumentException("Object must implement INotifyPropertyChanging and INotifyPropertyChanged");

            var constant_node = new ConstantNode((INotifyPropertyChanged)obj, "this");
            tree.Children.Add(constant_node);

            var property_info = obj.GetType().GetProperty(property_name);
            var property_node = new PropertyNode(property_info);
            constant_node.Children.Add(property_node);

            tree.DumpToLog();
            return tree;
        }
예제 #3
0
        public static PropertyAccessTree Create(object obj, string property_name)
        {
            log.Trace("Building property access tree");

            PropertyAccessTree tree = new PropertyAccessTree();

            if (!TypeHelper.DoesTypeImplementINotifyPropertyChangedAndChanging(obj.GetType()))
            {
                throw new ArgumentException("Object must implement INotifyPropertyChanging and INotifyPropertyChanged");
            }

            var constant_node = new ConstantNode((INotifyPropertyChanged)obj, "this");

            tree.Children.Add(constant_node);

            var property_info = obj.GetType().GetProperty(property_name);
            var property_node = new PropertyNode(property_info);

            constant_node.Children.Add(property_node);

            tree.DumpToLog();
            return(tree);
        }
 public void AddDependencies(PropertyAccessTree tree, Action notification_callback)
 {
     property_access_tree = tree;
     property_access_tree.Subscribe(notification_callback);
 }