Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The creature that won't die
Message
De
25/03/2010 05:08:59
 
 
À
25/03/2010 04:52:52
Information générale
Forum:
Visual FoxPro
Catégorie:
VFP Compiler for .NET
Divers
Thread ID:
01456123
Message ID:
01457111
Vues:
67
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform