5
ReSharper好奇心:“参数仅用于前提条件检查。”
为什么ReSharper会要求我提供此代码? private Control GetCorrespondingInputControl(SupportedType supportedType, object settingValue) { this.ValidateCorrespondingValueType(supportedType, settingValue); switch(supportedType) { case SupportedType.String: return new TextBox { Text = (string)settingValue }; case SupportedType.DateTime: return new MonthPicker { Value = (DateTime)settingValue, ShowUpDown = true }; default: throw new ArgumentOutOfRangeException(string.Format("The supported type value, {0} has no corresponding user control defined.", supportedType)); …
102
c#
resharper
preconditions