private static bool LoggedIntoEventlog(Icon popupIcon, string infoMessage) { if (WindowsServiceHelper.IsRunningInServiceContext) { if (popupIcon == SystemIcons.Error) { WindowsEventLog.LogError(infoMessage); } else if (popupIcon == SystemIcons.Warning) { WindowsEventLog.LogWarning(infoMessage); } else { WindowsEventLog.LogInformation(infoMessage); } return(true); } return(false); }