I am using DTE in Visual Studio 2010 to learn C # classes and automatically generate code.
When I come across a class that implements a common interface, I want to access the type of constraint as a CodeType object.
Example:
class ServiceProviderCollection : IList<IServiceProvider> {}
I have a CodeClass object that represents a ServiceProviderCollection . I can get the CodeInterface object for IList<IServiceProvider> using CodeClass.ImplementedInterfaces . But I donβt know how to get from there to the CodeInterface object that the IServiceProvider represents.
I can find the name of the type constraint by parsing CodeInterface.FullName and capturing the string between <and>, but this is not enough.
I use C # to implement this, if that matters.
c # visual-studio-2010 code-generation envdte
dss539
source share