Это наименее ленивый ответ (я просто горжусь этим ответом:)
У меня нет ReSharper, пробовал раньше, но не хотел его покупать.
Я попробовал диаграмму классов, но это совсем не практично, потому что иерархическая диаграмма охватывает мир три раза, а экран моего ноутбука не имеет бесконечной ширины.
Поэтому мое естественное и простое решение было написать некоторый код Windows Forms для итерации по типам в сборке и использовать отражение для добавления узлов в древовидное представление следующим образом:
пожалуйста, предположите, что у вас есть текстовое поле, древовидное представление и другие вещи, необходимые в форме, в которой этот код выполняется
//Go through all the types and either add them to a tree node, or add a tree
//node or more to them depending whether the type is a base or derived class.
//If neither base or derived, just add them to the dictionary so that they be
//checked in the next iterations for being a parent a child or just remain a
//root level node.
var types = typeof(TYPEOFASSEMBLY).Assembly.GetExportedTypes().ToList();
Dictionary<Type, TreeNode> typeTreeDictionary = new Dictionary<Type, TreeNode>();
foreach (var t in types)
{
var tTreeNode = FromType(t);
typeTreeDictionary.Add(t, tTreeNode);
//either a parent or a child, never in between
bool foundPlaceAsParent = false;
bool foundPlaceAsChild = false;
foreach (var d in typeTreeDictionary.Keys)
{
if (d.BaseType.Equals(t))
{
//t is parent to d
foundPlaceAsParent = true;
tTreeNode.Nodes.Add(typeTreeDictionary[d]);
//typeTreeDictionary.Remove(d);
}
else if (t.BaseType.Equals(d))
{
//t is child to d
foundPlaceAsChild = true;
typeTreeDictionary[d].Nodes.Add(tTreeNode);
}
}
if (!foundPlaceAsParent && !foundPlaceAsChild)
{
//classHierarchyTreeView.Nodes.Add(tn);
}
}
foreach (var t in typeTreeDictionary.Keys)
{
if (typeTreeDictionary[t].Level == 0)
{
classHierarchyTreeView.Nodes.Add(typeTreeDictionary[t]);
}
}
StringBuilder sb = new StringBuilder();
foreach (TreeNode t in classHierarchyTreeView.Nodes)
{
sb.Append(GetStringRepresentation(t, 0));
}
textBox2.Text = sb.ToString();