private void WriteLogEntry(string message, EventLogEntryType type = EventLogEntryType.Information) { if (!EventLog.SourceExists("Raffling")) EventLog.CreateEventSource("Raffling", "Application"); EventLog.WriteEntry("Raffling", message, type); }