开发者

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

开发者 https://www.devze.com 2023-01-31 10:46 出处:网络
I want to convert C# statement 开发者_运维问答Button b3 = (Button)sender; to ironpython statementAssuming sender is typed to object (in other words there are no user defined conversion operators)

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

精彩评论

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