Example #1
0
        private ObjectMemberViewModel(ObjectViewModel instance)
            : base(instance.MemoryExplorer)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            _instance = instance;
        }
Example #2
0
        public ObjectMemberViewModel(ObjectViewModel instance, PropertyInfo property)
            : this(instance)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            _member           = _property = property;
            _field            = null;
            _isCollectionItem = false;

            base.DisplayName = _property.Name;
        }
Example #3
0
        public ObjectMemberViewModel(ObjectViewModel instance, FieldInfo field)
            : this(instance)
        {
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }

            _member           = _field = field;
            _property         = null;
            _isCollectionItem = false;

            base.DisplayName = _field.Name;
        }
Example #4
0
        public ObjectMemberViewModel(ObjectViewModel instance, object collectionItem, int collectionIndex)
            : this(instance)
        {
            _isCollectionItem = true;
            _collectionIndex  = collectionIndex;
            _value            = collectionItem;

            string indexString = collectionIndex.ToString();
            if (collectionIndex < 10)
            {
                indexString = "00" + indexString;
            }
            else if (collectionIndex < 100)
            {
                indexString = "0" + indexString;
            }
            else if (collectionIndex == Int32.MaxValue)
            {
                indexString = "END";
            }

            base.DisplayName = String.Format("[{0}]", indexString);
        }