class-hierarchy

Is there a way of finding what .NET classes implements a certain interface?

落花浮王杯 提交于 2019-12-05 22:37:33
For example if I wanted to see what my .NET options were for something implementing IList or IDictionary. Is there a way to find that for example in the MSDN documentation? To find it in MSDN, I usually go to Google, type something like "MSDN IList", and to get to IList Interface which has a section "Classes that Implement IList". That's true for any of the interface classes. If you find a base class such as DictionaryBase , there will be a link called Derived Classes which will take you to a tree showing the inheritance hierarchy . I think it's possible using Reflector You can also do this

Can anonymous modules and class be nested in Ruby?

非 Y 不嫁゛ 提交于 2019-12-05 19:26:59
I can define an anonymous class within an anonymous module: c = nil m = Module.new do c = Class.new end m #=> #<Module:0x007fad3a055660> c #=> #<Class:0x007fad3a0555e8> Is the above equivalent to: m = Module.new c = Class.new In other words: does the concept of "nesting" actually apply to anonymous modules? It is not about being anonymous. Assigning a dynamically created class to a constant makes it named: Foo = Class.new # => Foo foo = Class.new # => #<Class:0x007fe5dd45d650> Yet it still doesn't nest further: module Bar Baz = Module.new do p Module.nesting # => [Bar] end end Or even about

What is the opposite of c++ `override` / `final` specifier?

萝らか妹 提交于 2019-12-05 03:13:15
In c++11 the override specifier protects from not overriding an intended virtual base function (because the signatures do not match). The final specifier protects from unintentionally overriding a function in a derived class. => Is there a specifier (something like maybe first or no_override ) that protects from overriding an unknown base function? I'd like to get a compiler error when a virtual function was added to a base class with the same signature as an already existing virtual function in a derived class. EDIT 4 : To keep this question simple and answers relevant, here is again the

Tool to Show Class Hierarchies in .NET

我的未来我决定 提交于 2019-12-05 00:07:15
Is there a way/tool that could show me all the classes/interfaces that implement a certain interface in my project? In Eclipse (Java) I would use the context menu "Open Type Hierarchy" option, which would show me a (pretty) tree of types that extend the selected type. Is there a tool to do the same in .NET? I second Marc's recommendation of .NET Reflector - and would like to add that there is an impressive series of add-in available at CodePlex . Just a few of the add-ins I use with regularity: Deblector - This add-in allows to debug processes from within Reflector. Graph - This add-in draws

Common Lisp class hierarchy

让人想犯罪 __ 提交于 2019-12-04 17:41:00
Greg Pfeil's Class Hierarchy diagram provides a comprehensive picture the Common Lisp type system. But I'm trying to better understand the class relationships at the top of the hierarchy. For a simple example, let (defstruct person name age) , and then (defparameter *p1* (make-person :name "Yosh" :age 19) . Now (typep *p1* 'person) T (typep *p1* 'structure) T (typep *p1* 'structure-object) T (typep *p1* 'atom) T (typep *p1* t) T The Hyperspec says the precedence list for structure-object is only itself and t . Are atom and structure not types in the hierarchy? What are all the direct subtypes

Can I see interfaces in Eclipse's type hierarchy view?

家住魔仙堡 提交于 2019-12-04 15:39:19
问题 When I check the type hierarchy of a class that is derived from an interface in Eclipse, it doesn't show the interfaces. Is there a way to configure Eclipse to display the interfaces in the type hierarchy? Or is there any other way to see this information? 回答1: CTRL-T is what you want. Highlight the name of the class in the editor, hit CTRL-T twice. This will show you the supertype hierarchy in a little popup. But wait, it gets better. Go to your interface. Put your cursor on a definition.

How to link “parallel” class hierarchy?

霸气de小男生 提交于 2019-12-04 10:59:27
I've got a little class hierarchy where each class corresponds to a certain TComponent descendent (say base class TDefaultFrobber with descendents TActionFrobber and TMenuItemFrobber, corresponding to TComponent, TCustomAction and TMenuItem, respectively). Now I want a factory (?) function something like this: function CreateFrobber(AComponent: TComponent): IFrobber; begin if AComponent is TCustomAction then Result := TActionFrobber.Create(TCustomAction(AComponent)) else if AComponent is TMenuItem then Result := TMenuItemFrobber.Create(TMenuItem(AComponent)) else Result := TDefaultFrobber

Create inheritance graphs/trees for Django templates

拟墨画扇 提交于 2019-12-04 05:22:08
Is there any tool out there that would take a directory with a Django application, scan it for templates and draw/print/list a hierarchy of inheritance between templates? Seeing which blocks are being overridden at every level would be an especially helpful feature in such a tool. Old question but FWIW there is (or was) django-template-graph that should work with Django 1.7. It doesn't (yet) work with Django 1.8+ when the template logic changed a bit so it needs to be patched, I opened an issue for that and will probably release a fix soon. 来源: https://stackoverflow.com/questions/19495407

Can I see interfaces in Eclipse's type hierarchy view?

纵然是瞬间 提交于 2019-12-03 10:46:43
When I check the type hierarchy of a class that is derived from an interface in Eclipse, it doesn't show the interfaces. Is there a way to configure Eclipse to display the interfaces in the type hierarchy? Or is there any other way to see this information? CTRL-T is what you want. Highlight the name of the class in the editor, hit CTRL-T twice. This will show you the supertype hierarchy in a little popup. But wait, it gets better. Go to your interface. Put your cursor on a definition. CTRL-T (once) will show you all the classes that implement the interface. If you select one of these classes

Class and Interface hierarchies in Entity Framework?

房东的猫 提交于 2019-12-03 10:20:01
问题 I have two related classes which share a common interface and are both stored in the same underlying database table. However, the Entity Framework generates one common class, where I really need the two distinct classes. How do I resolve this? Is it best to use a base class rather than an interface? How do I change the EF model to provide two classes mapped over one table? Edit: the AccountType property determines the type of class; user or group. Some simple code: public interface IAccount {