public static int CompareListItems(MemoryExplorerListItemViewModel item1, MemoryExplorerListItemViewModel item2)
        {
            // We sort the items in the same way that the SelectedEntityListView wants to show them.
            // This ensures that objects with many members are loaded up and displayed smoothly
            // when the item population is animated by the PopulatePropertiesAndFields method.

            if (item1 == null)
            {
                return(item2 == null ? 0 : -1);
            }

            if (item2 == null)
            {
                return(+1);
            }

            if (item1.GroupByCategory != item2.GroupByCategory)
            {
                return(item1.GroupByCategory.CompareTo(item2.GroupByCategory));
            }
            else
            {
                return(item1.DisplayName.CompareTo(item2.DisplayName));
            }
        }
Example #2
0
        public ObjectViewModel(object instance, MemoryExplorerViewModel memoryExplorer, MemoryExplorerListItemViewModel referencedBy)
        {
            if (instance == null)
                throw new ArgumentNullException("instance");

            if (memoryExplorer == null)
                throw new ArgumentNullException("memoryExplorer");

            _instance = instance;
            _memoryExplorer = memoryExplorer;
            _referencedBy = referencedBy;
            _filterSettings = new MemoryExplorerListFilterSettingsViewModel(_memoryExplorer);

            base.DisplayName = _instance.GetType().FullName;
        }
Example #3
0
        public ObjectViewModel(object instance, MemoryExplorerViewModel memoryExplorer, MemoryExplorerListItemViewModel referencedBy)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            if (memoryExplorer == null)
            {
                throw new ArgumentNullException("memoryExplorer");
            }

            _instance       = instance;
            _memoryExplorer = memoryExplorer;
            _referencedBy   = referencedBy;
            _filterSettings = new MemoryExplorerListFilterSettingsViewModel(_memoryExplorer);

            base.DisplayName = _instance.GetType().FullName;
        }
        public static int CompareListItems(MemoryExplorerListItemViewModel item1, MemoryExplorerListItemViewModel item2)
        {
            // We sort the items in the same way that the SelectedEntityListView wants to show them.
            // This ensures that objects with many members are loaded up and displayed smoothly
            // when the item population is animated by the PopulatePropertiesAndFields method.

            if (item1 == null)
                return item2 == null ? 0 : -1;

            if (item2 == null)
                return +1;

            if (item1.GroupByCategory != item2.GroupByCategory)
                return item1.GroupByCategory.CompareTo(item2.GroupByCategory);
            else
                return item1.DisplayName.CompareTo(item2.DisplayName);
        }