public void LogEvent(TraceEventType type, ushort eventLogCategory, uint eventId, bool shouldTrace, params string[] values) { if (canLogEvent) { try { this.SafeLogEvent(type, eventLogCategory, eventId, shouldTrace, values); } catch (SecurityException exception) { canLogEvent = false; if ((shouldTrace && (this.diagnosticTrace != null)) && TraceCore.HandledExceptionIsEnabled(this.diagnosticTrace)) { TraceCore.HandledException(this.diagnosticTrace, exception); } } } }