Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C Sharp only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C Sharp
generics
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Tony Johansson
#1
generics
Jun 27 '08, 07:57 PM
Hello!
Is it possible to use generics property?
/Tony
Peter Duniho
#2
Jun 27 '08, 07:57 PM
Re: generics
On Sat, 14 Jun 2008 02:59:07 -0700, Tony Johansson
<johansson.ande rsson@telia.com wrote:
Is it possible to use generics property?
Well, that depends on what you mean by "generics property". But really,
why don't you just try it?
For more information, you may find this helpful:
Generic classes and methods - C#
http://msdn.microsoft.com/en-us/library/512aeb7t.aspx
Learn about generics. Generic types maximize code reuse, type safety, and performance, and are commonly used to create collection classes.
Pete
Comment
Post
Cancel
Jon Skeet [C# MVP]
#3
Jun 27 '08, 07:57 PM
Re: generics
Tony Johansson <johansson.ande rsson@telia.com wrote:
Is it possible to use generics property?
You can't make a property generic in the same way that you can make a
method generic, i.e. introduce a new type parameter.
However, you *can* make a property of a type parameter, e.g in
IEnumerator<Tth ere's the property:
T Current { get; }
--
Jon Skeet - <skeet@pobox.co m>
Web site:
http://www.pobox.com/~skeet
Blog:
http://www.msmvps.com/jon.skeet
C# in Depth:
http://csharpindepth.com
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment