Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The creature that won't die
Message
From
25/03/2010 05:08:59
 
 
General information
Forum:
Visual FoxPro
Category:
VFP Compiler for .NET
Miscellaneous
Thread ID:
01456123
Message ID:
01457111
Views:
66
public void Doit (object toObj)
>        {
>            Timer t = toObj as Timer;
>            if (t != null)
>            {
>                if (t.Enabled && t.Interval > 0)
>                {
>                    t.Enabled = false;
>                    t.Interval = 0;
>                }
>            }
>        }
I'd do a bit more type checking in the first one if it was for production - but even as it stands it is safer than the VFP version....

I like the AS operator

You don't have to cast
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform