dxcore - How to get the classes that implement an interface in CodeRush? -
i trying write method returns list of classes implements interface, not it.
some method
public list<class> getimplementedclasses(interface interface1) { . . . }
i tried use interface1.allchildren , many other tries. non of them gave results.
is possible write such method using dxcore apis?
example:
if pass interface1, should class1 , class2 method getimplementedclasses.
thanks in advance.
there's "getdescendants" method in intrerface class might useful task. code similar this:
public list<class> getimplementedclasses(interface interface1) { list<class> result = new list<class>(); if (interface1 != null) { itypeelement[] descendants = interface1.getdescendants(); foreach (itypeelement descendant in descendants) { if (!descendant.inreferencedassembly) { class classdescendant = descendant.tolanguageelement() class; if (classdescendant != null) result.add(classdescendant); } } } return result; }
Comments
Post a Comment