private void FillBasicWmiDataFields(ref UnsafeNativeMethods.WmiData wmiData, WebBaseEvent eventRaised) { WebApplicationInformation applicationInformation = WebBaseEvent.ApplicationInformation; wmiData.eventType = (int)WebBaseEvent.WebEventTypeFromWebEvent(eventRaised); wmiData.eventCode = eventRaised.EventCode; wmiData.eventDetailCode = eventRaised.EventDetailCode; wmiData.eventTime = this.WmiFormatTime(eventRaised.EventTime); wmiData.eventMessage = eventRaised.Message; wmiData.sequenceNumber = eventRaised.EventSequence.ToString(CultureInfo.InstalledUICulture); wmiData.occurrence = eventRaised.EventOccurrence.ToString(CultureInfo.InstalledUICulture); wmiData.eventId = eventRaised.EventID.ToString("N", CultureInfo.InstalledUICulture); wmiData.appDomain = applicationInformation.ApplicationDomain; wmiData.trustLevel = applicationInformation.TrustLevel; wmiData.appVirtualPath = applicationInformation.ApplicationVirtualPath; wmiData.appPath = applicationInformation.ApplicationPath; wmiData.machineName = applicationInformation.MachineName; if (eventRaised.IsSystemEvent) { wmiData.details = string.Empty; } else { WebEventFormatter formatter = new WebEventFormatter(); eventRaised.FormatCustomEventDetails(formatter); wmiData.details = formatter.ToString(); } }
private void AddBasicDataFields(ArrayList dataFields, WebBaseEvent eventRaised) { WebApplicationInformation applicationInformation = WebBaseEvent.ApplicationInformation; dataFields.Add(eventRaised.EventCode.ToString(CultureInfo.InstalledUICulture)); dataFields.Add(eventRaised.Message); dataFields.Add(eventRaised.EventTime.ToString()); dataFields.Add(eventRaised.EventTimeUtc.ToString()); dataFields.Add(eventRaised.EventID.ToString("N", CultureInfo.InstalledUICulture)); dataFields.Add(eventRaised.EventSequence.ToString(CultureInfo.InstalledUICulture)); dataFields.Add(eventRaised.EventOccurrence.ToString(CultureInfo.InstalledUICulture)); dataFields.Add(eventRaised.EventDetailCode.ToString(CultureInfo.InstalledUICulture)); dataFields.Add(applicationInformation.ApplicationDomain); dataFields.Add(applicationInformation.TrustLevel); dataFields.Add(applicationInformation.ApplicationVirtualPath); dataFields.Add(applicationInformation.ApplicationPath); dataFields.Add(applicationInformation.MachineName); if (eventRaised.IsSystemEvent) { dataFields.Add(null); } else { WebEventFormatter formatter = new WebEventFormatter(); eventRaised.FormatCustomEventDetails(formatter); dataFields.Add(formatter.ToString()); } }
private void AddBasicDataFields(ArrayList dataFields, WebBaseEvent eventRaised) { WebApplicationInformation applicationInformation = WebBaseEvent.ApplicationInformation; dataFields.Add(eventRaised.EventCode.ToString(CultureInfo.InstalledUICulture)); dataFields.Add(eventRaised.Message); dataFields.Add(eventRaised.EventTime.ToString()); dataFields.Add(eventRaised.EventTimeUtc.ToString()); dataFields.Add(eventRaised.EventID.ToString("N", CultureInfo.InstalledUICulture)); dataFields.Add(eventRaised.EventSequence.ToString(CultureInfo.InstalledUICulture)); dataFields.Add(eventRaised.EventOccurrence.ToString(CultureInfo.InstalledUICulture)); dataFields.Add(eventRaised.EventDetailCode.ToString(CultureInfo.InstalledUICulture)); dataFields.Add(applicationInformation.ApplicationDomain); dataFields.Add(applicationInformation.TrustLevel); dataFields.Add(applicationInformation.ApplicationVirtualPath); dataFields.Add(applicationInformation.ApplicationPath); dataFields.Add(applicationInformation.MachineName); if (eventRaised.IsSystemEvent) { dataFields.Add(null); } else { WebEventFormatter formatter = new WebEventFormatter(); eventRaised.FormatCustomEventDetails(formatter); dataFields.Add(formatter.ToString()); } }
void FillBasicWmiDataFields(ref UnsafeNativeMethods.WmiData wmiData, WebBaseEvent eventRaised) { WebApplicationInformation appInfo = WebBaseEvent.ApplicationInformation; wmiData.eventType = (int)WebBaseEvent.WebEventTypeFromWebEvent(eventRaised); // Note: WMI sint64 requires a string param // Data contained in WebBaseEvent wmiData.eventCode = eventRaised.EventCode; wmiData.eventDetailCode = eventRaised.EventDetailCode; wmiData.eventTime = WmiFormatTime(eventRaised.EventTime); wmiData.eventMessage = eventRaised.Message; wmiData.sequenceNumber = eventRaised.EventSequence.ToString(CultureInfo.InstalledUICulture); wmiData.occurrence = eventRaised.EventOccurrence.ToString(CultureInfo.InstalledUICulture); wmiData.eventId = eventRaised.EventID.ToString("N", CultureInfo.InstalledUICulture); wmiData.appDomain = appInfo.ApplicationDomain; wmiData.trustLevel = appInfo.TrustLevel; wmiData.appVirtualPath = appInfo.ApplicationVirtualPath; wmiData.appPath = appInfo.ApplicationPath; wmiData.machineName = appInfo.MachineName; if (eventRaised.IsSystemEvent) { wmiData.details = String.Empty; } else { WebEventFormatter formatter = new WebEventFormatter(); eventRaised.FormatCustomEventDetails(formatter); wmiData.details = formatter.ToString(); } }