J
Jay Dee
Hi all.
I have bean studying the use of Interfaces, and from what I understand
if you create a class that inherits from an interface, that class must
poses a member that represents each member of the derived interface.
Well this all seams sensible because otherwise it would defy the
principles behind inheritance,
I was studying the class “System.Collections.Generic.List<T>”.
This class states that it derives from the interface
“System.Collections.Icollection”
Therefore I would assume that it would possess all the members that
the interface contains.
This is where I become very confused.
“System.Collections.Generic.List<T>” douse not poses the members:
IsSynchronized
SyncRoot
Trying to find an answerer to this I ran the code
<Code>
System.Collections.ICollection i = new
System.Collections.Generic.List<string>();
System.Windows.Forms.MessageBox.Show(i.IsSynchronized.ToString());
</Code>
I found that it ran successfully and displayed the value “False”.
This states to me that the class douse in fact poses the member
“IsSynchronized” but fore some reason douse not give you access to it
at design time.
Could anybody please explain this to me?
Thanks Jay Dee
I have bean studying the use of Interfaces, and from what I understand
if you create a class that inherits from an interface, that class must
poses a member that represents each member of the derived interface.
Well this all seams sensible because otherwise it would defy the
principles behind inheritance,
I was studying the class “System.Collections.Generic.List<T>”.
This class states that it derives from the interface
“System.Collections.Icollection”
Therefore I would assume that it would possess all the members that
the interface contains.
This is where I become very confused.
“System.Collections.Generic.List<T>” douse not poses the members:
IsSynchronized
SyncRoot
Trying to find an answerer to this I ran the code
<Code>
System.Collections.ICollection i = new
System.Collections.Generic.List<string>();
System.Windows.Forms.MessageBox.Show(i.IsSynchronized.ToString());
</Code>
I found that it ran successfully and displayed the value “False”.
This states to me that the class douse in fact poses the member
“IsSynchronized” but fore some reason douse not give you access to it
at design time.
Could anybody please explain this to me?
Thanks Jay Dee