Пример #1
0
        public ObjectViewModelHierarchy(object rootObject)
        {
            _rootObject = new ObjectViewModel(rootObject);

            _firstGeneration = new ReadOnlyCollection <ObjectViewModel>(
                new ObjectViewModel[]
            {
                _rootObject
            });
        }
Пример #2
0
        ObjectViewModel(object obj, PropertyInfo info, ObjectViewModel parent)
        {
            _object = obj;
            _info   = info;

            if (_object != null)
            {
                _type = obj.GetType();

                if (!IsPrintableType(_type))
                {
                    // load the _children object with an empty collection
                    // to allow the + expander to be shown
                    _children = new ReadOnlyCollection <ObjectViewModel>(
                        new ObjectViewModel[]
                    {
                        new ObjectViewModel(null)
                    });
                }
            }

            _parent = parent;
        }
        public ObjectViewModelHierarchy(object rootObject)
        {
            _rootObject = new ObjectViewModel(rootObject);

            _firstGeneration = new ReadOnlyCollection<ObjectViewModel>(
                new ObjectViewModel[] 
                { 
                    _rootObject
                });
        }
        ObjectViewModel(object obj, PropertyInfo info, ObjectViewModel parent)
        {
            _object = obj;
            _info = info;

            if (_object != null)
            {
                _type = obj.GetType();

                if (!IsPrintableType(_type))
                {
                    // load the _children object with an empty collection 
                    // to allow the + expander to be shown
                    _children = new ReadOnlyCollection<ObjectViewModel>(
                        new ObjectViewModel[] 
                        { 
                            new ObjectViewModel(null) 
                        });
                }
            }

            _parent = parent;
        }