0

I have a class with methods that report the current state of the process. I usually use a UIHandle.Writline where UIHandle is an interface with 2 methods.

UIHandle.WritLine(string StringInput)

Or

UIHandle.WritLine(List<string> StringInput)

Which is used this way:

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

I was wondering if there is a possibility that I was not aware of to trigger the methods through an event rather than the class such as:

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

I though it would be better to avoid interface as I currently use. And I could add a log file more easily...

Yoyo
  • 101
  • 1
  • 11
  • 1
    *"to trigger the methods through an event rather than the class"* - can you explain this? You don't like prefixing interface for [explicitly implemented interface](https://stackoverflow.com/q/143405/1997232) methods or what? What events have to do with it? Or are those simple static methods? – Sinatr Dec 13 '17 at 09:07
  • I am using interface right now, it obviously works fine. I was just wondering if it there was a way to pass different argument type to events without using object. – Yoyo Dec 13 '17 at 09:21

0 Answers0