具有不同参数类型的单个事件

时间:2017-12-13 09:01:43

标签: c# events arguments

我有一个类,其方法可以报告进程的当前状态。 我通常使用UIHandle.Writline,其中UIHandle是一个具有2种方法的接口。

UIHandle.WritLine(string StringInput)

UIHandle.WritLine(List<string> StringInput)

以这种方式使用:

UIHandle.WriteLine("Checking for error...");
UIHandle.WriteLine(CheckForMissing(newCollection)); //Where CheckForMissing returns a list of strings

我想知道是否有可能我不知道通过事件触发方法而不是类如:

TriggerTheResponseEvent("Checking for error...");
TriggerTheResponseEvent(CheckForMissing(newCollection)); 

我虽然最好避免使用当前使用的界面。我可以更轻松地添加日志文件......

0 个答案:

没有答案