Resharper建议改变以下内容:
Type foo = typeof( Foo );
Type bar = typeof( Bar );
if( foo.Equals( bar ) ) { ... }
Run Code Online (Sandbox Code Playgroud)
至:
if( foo == bar ) { ... }
Run Code Online (Sandbox Code Playgroud)
operator ==
// Summary:
// Indicates whether two System.Type objects are equal.
//
// Parameters:
// left:
// The first object to compare.
//
// right:
// The second object to compare.
//
// Returns:
// true if left is equal to right; otherwise, false.
public static bool operator ==( …Run Code Online (Sandbox Code Playgroud) 我有一个绑定到模型的输入表单.该模型具有TimeSpan属性,但只有当我输入时间为hh:mm或hh:mm:ss时,它才能正确获取值.我想要的是它捕获值,即使它被写为hhmm或hh.mm或hh.mm.ss或...我想要正确解析许多不同的格式.这可能吗?
谢谢!