Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# version of VFP PEMSTATUS()
Message
From
19/01/2010 17:20:22
 
 
To
19/01/2010 16:15:55
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01444636
Message ID:
01444841
Views:
39
>My favourite of
>
>>    protected override void OnTextChanged(EventArgs e)
>>    {
>>        if (this.Parent is IMyInterface)
>>        {
>>            ((IMyInterface)this.Parent).MyMethod(true);
>>        }
>>        base.OnTextChanged(e);
>>    }
>
>
>is
>
>>    protected override void OnTextChanged(EventArgs e)
>>    {
>          IMyInterface o;
>>        if ( ( o = this.Parent as IMyInterface) != null )
>>        {
>>           o.MyMethod(true);
>>        }
>>        base.OnTextChanged(e);
>>    }
>
Hmm. I defintely win on readability.
You might win on efficiency. Have you compared both in ILDASM ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform