Hi,
You cannot extend an already defined class (will be possible in the next
version though). You could derive from it but then you need to make
reference to your own class.
Unfortunatelly Convert is marked as sealed so you cannot inherit from it.
In your particular case, I do not see how you will do it. A DateTime and a
TimeSpan represent two different concepts.You cuold only do it IF you set a
starting point only then you could do a TimeSpan.
What would be your starting point ?
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"active T" <To********@gmail.comwrote in message
news:11*********************@k35g2000prh.googlegro ups.com...
Is it possible to extend the system classes?
I want to create a function for converting a DateTime into a TimeSpan.
Any Ideas?
at the moment i've created:
public class Convert
{
public static TimeSpan DateTimeToTimeSpan(DateTime value)
{
return new TimeSpan(value.Hour, value.Minute,
value.Second);
}
}
But I like a funtction like:
DateTime inputVar
Timestamp outputVar= inputVar.GetTimeStamp
is this possible? Just extending the systemclass.
thnx