private void OnStatusBroadcast(LogStatus status) { if (StatusBroadcast == null) return; var eventListeners = StatusBroadcast.GetInvocationList(); // Raising Event for (var index = 0; index < eventListeners.Count(); index++) { var methodToInvoke = (EventHandler<StatusEventArgs>)eventListeners[index]; methodToInvoke.BeginInvoke(this, new StatusEventArgs(status), EndAsyncEvent, null); } // Done Raising Event }
public void Log(LogStatus x, bool verbose = false) { switch (x.LogType) { case LogTypeEnum.Default: Log(x.Message); break; case LogTypeEnum.Subtle: if (verbose) LogSubtle(x.Message); break; case LogTypeEnum.Info: LogInfo(x.Message); break; case LogTypeEnum.Success: if (verbose) LogSuccess(x.Message); break; case LogTypeEnum.Warning: if (verbose) LogWarning(x.Message); break; case LogTypeEnum.Standout: LogStandout(x.Message); break; case LogTypeEnum.Error: LogError(x.Message); if (x.Exception != null) LogError(x.Exception.ToString()); break; case LogTypeEnum.Debug: if (verbose) LogSubtle(x.Message); break; default: throw new ArgumentOutOfRangeException(); } }
public void LogStatus(LogStatus status) { OnStatusBroadcast(status); }