>>> A method belongs to one and only one class, doesn't it?
>>>
>>
>>Except, perhaps, when your are dealing with extension methods
>>
>>Here's one that applies to all classes
>>
>>
>>public static partial class ExtensionMethods
>>{
>> static public string MyToString<T>(this T s)
>> {
>> return "<" + s.ToString() + ">";
>> }
>>
>>}
>>
>>
>>or
>>
>>public static partial class ExtensionMethods
>>{
>> static public string MyToString(this object s)
>> {
>> return "<" + s.ToString() + ">";
>> }
>>
>>}
>>
>>
>>
>>Here's one that applies to all classes which implement IEquatable< T >
>>
>>
>>public static partial class ExtensionMethods
>>{
>> public static bool InList<T>(this T s, params T[] list) where T : IEquatable<T>
>> {
>> return list.Contains(s);
>> }
>>}
>>
>
>Thanks. Extension methods are still over my head at this point. I kinda sorta understand generics and interfaces, but have not gotten to extension methods. Yet ;-)
hey - I just wanted to point it out - and the first and third use generics
Seriously, I am about one meter high on the c# mountain. By the time you'll have finished your course, you'll know far more than I
Enjoy,
Gregory