asperhaps better if the resulting expression is used later; isjust as good if not. For instance.
if (sender is Button) {
Button button = (Button)sender; // just use `as`, as suggested
button.Push();
(I thought ReSharper only gave a warning / hint in the case where the duplicate can be deleted, for example this.)
In doing so, I use the structure
Button button;
if ((button = sender as Button) != null) {
button.Push();
, ( ) - as #/ReSharper [] .
. :
"" CLR - "/()", " ", , . " "" " .
: "as" "" ?, .