473,387 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get typeof declared item in generic List

Hello,

I need to get the type of item in the declared generic List.

This is my class and my List derrived from List<MyItemClass>

public class MyList : List<MyItemClass>
{

}

public class MyItemClass
{
}
Type t = typeof(MyList);

how to get from 't' the information about type of declared generic type (in
this case typeof(MyItemClass))

thanks

Mar 30 '06 #1
1 1590
I believe Type.GetGenericArguments

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx
Mar 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Robert Mark Bram | last post by:
Hi All! I have the following code in an asp page whose language tag is: <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> // Find request variables. var edition = Request.Form ("edition"); var...
23
by: Darryl Kerkeslager | last post by:
I frequently use OpenArgs to pass a value to a form; it would be nice if there was a similarly easy way to return a value from a called form. Darryl Kerkeslager
8
by: sara | last post by:
I am learning Access and programming. I wanted to have the user select the departments for an ad from the list of all departments. Found code (that I could understand) on this site, and it works....
4
by: Alex Sedow | last post by:
Method invocation will consist of the following steps: 1. Member lookup (14.3) - evaluate method group set (Base.f() and Derived.f()) .Standart say: "The compile-time processing of a method...
3
by: snesbit | last post by:
I have a structure called SearchAreaListItem. The structure has some properties. The application implements this as a collection.generic.list(of SearchAreaListItem) I load the collection up ...
12
by: Jorge Varas | last post by:
Let's say that you have: class A { T DoSomething<T>() where T : class, new() { T ThisObj = new T(); // Do something usefull... return ThisObj; }
2
by: Smokey Grindel | last post by:
I have a list of items that is in the list of <Tformat... and then in that are objects I created that implement the IComparable interface... now if I took this list and did a...
5
by: Doug | last post by:
Hi I have a text box that can be used for input and I would like to check if the value in the text box that someone types is already in a list of items. I know how to do this in other languages...
3
by: Stefan Hoffmann | last post by:
hi @all, I have the following interface declaration: public interface IBaseDao<Twhere T : BasePOJO { List<TFindAll(Type entityClass); } The parameter entityClass should be typeof(T).
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.