【发布时间】:2019-09-28 13:50:20
【问题描述】:
我有以下遗留代码:
if (isOnMainWindow
|| (win.GetType() != typeof(winInputBox)
&& win.GetType() != typeof(winMessage)
&& win.GetType() != typeof(winMsgBox)
&& win.GetType() != typeof(winAbout))
ApplicationCommands.Close.Execute(null, win);
这看起来很可怕。有没有办法像我一样比较多种类型的对象?
【问题讨论】: