开发者

how to convert "Button b3 = (Button)sender" from c# to ironpython

I want to convert C# statement

开发者_运维问答Button b3 = (Button)sender;

to ironpython statement


Assuming sender is typed to object (in other words there are no user defined conversion operators) you can just use sender like you would b3 in the C# code. The exact same code would be:

b3 = sender

C# only needs to do this because it wants to statically type objects. If instead of Button you were casting to an interface for an object where it's explicitly implemented it gets more complicated.


b3 = sender.Content()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜