我有以下签名指定命名参数
public static void raiseEventtoForm(string message, Color fc, Color bc, int messageType,
EventLogEntryType eventType = EventLogEntryType.Information, bool frmSQL = false)
{
if(eventType != EventLogEntryType.Information && !frmSQL)
postEventLog(message, eventType);
MessageEvent(message, fc, bc, frmSQL);
}
功能但是,当我尝试调用它,并把它我收到一个无效的参数传递,我试图通过以下方式。我究竟做错了什么?
ProgramEvents.raiseEventtoFrom("example", Color.Black, Color.White, frmSQL:true);
ProgramEvents.raiseEventtoFrom("example", Color.Black, Color.White, frmSQL:= true);
编辑: 错误:没有重载采用4个参数
*这是一个/捂脸情况,我错过了有目共睹
请张贴确切的错误信息。它很可能抱怨没有传递像'message'这样的必要参数。 –
既然这是一个愚蠢的,不应该看到这个明显的问题,我应该删除它还是离开它? – alykins
我不知道 - 你有答案 - 所以随时保留它。如果您决定保留 - 通过添加错误消息并格式化代码以避免水平滚动,可以更好地提出问题。确保添加错误代码(如CSxxxx)和消息。 –