public TypeViewModel(TypeDefinition typeDefinition) { _isExpanded = true; _typeDefinition = typeDefinition; if (_typeDefinition.BaseType != null) { BaseType = new TypeViewModel(_typeDefinition.BaseType.Resolve()); } }
public AncestryBrowserWindowViewModel(TypeDefinition typeDefinition) { _typeDefinition = typeDefinition; ExpandCollapseAllCommand = new DelegateCommand(ExpandCollapseAllCommandHandler); _options = new MemberOptions { ShowProperties = true, ShowEvents = true, ShowMethods = true, ShowProtected = true, ShowProtectedInternal = true, ShowPublic = true }; _typeViewModel = new TypeViewModel(_typeDefinition); _ancestry = _typeViewModel.Ancestry.ToList(); _ancestry.Last().IsLast = true; _assemblies = _ancestry .GroupBy(t => t.TypeDefinition.Module.Assembly) .Select(g => new AssemblyViewModel(g.Key, g)) .ToList(); int currentIndex = 0; foreach (var assembly in _assemblies) { var brush = BrushProvider.BrushPairs[currentIndex].Background as SolidColorBrush; brush = new SolidColorBrush( new Color { A = 72, R = brush.Color.R, G = brush.Color.G, B = brush.Color.B}); assembly.BackgroundBrush = brush; assembly.CaptionBrush = BrushProvider.BrushPairs[currentIndex].Caption; currentIndex++; if (currentIndex == BrushProvider.BrushPairs.Count) { currentIndex = 0; } } UpdateMembers(); }