Re: Generics in CodeDom of .NET 2.0?
From: Mark (field027_at_idonotlikejunkmail.umn.edu)
Date: 01/20/05
- Next message: Ram: "Validating XML Using XML Schema"
- Previous message: MuZZy: "Re: Unable to Abort a listening thread"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: Generics in CodeDom of .NET 2.0?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 19 Jan 2005 23:57:18 -0600
Excellent. This inspired me to dig further, and I succeeded with the
following:
CodeTypeDeclaration newClass = new CodeTypeDeclaration("MyCollectionClass");
newClass.BaseTypes.Add( new CodeTypeReference("Collection",
new CodeTypeReference[] {
new
CodeTypeReference("MyBaseClass")
}));
// This results in code like:
public class MyCollectionClass : Collection<MyBaseClass>
{
//woo hoo!
}
"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:%23UvQtqY$EHA.2568@TK2MSFTNGP11.phx.gbl...
> Mark,
>
> Check the TypeParameters property of the CodeTypeDeclaration class.
It
> represents the type parameters that the type has. I'm pretty sure that
your
> method declaration class instance has the same property exposed as well.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
>
> "Mark" <field027@idonotlikejunkmail.umn.edu> wrote in message
> news:Oki$HJN$EHA.2112@TK2MSFTNGP14.phx.gbl...
> > I'm looking at the CodeDom namespace in .NET 2.0 class library online
> > (http://msdn2.microsoft.com/library/za6cc751.aspx). I'm not seeing any
> > class that would allow me to create Generics. Any suggestions?
> >
> > Thanks in advance.
> >
> > Mark
> >
> >
>
>
- Next message: Ram: "Validating XML Using XML Schema"
- Previous message: MuZZy: "Re: Unable to Abort a listening thread"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: Generics in CodeDom of .NET 2.0?"
- Messages sorted by: [ date ] [ thread ]