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();
            }
        }
        public override string ToString()
        {
            WebEventFormatter formatter = new WebEventFormatter();

            this.FormatToString(formatter);
            return(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());
     }
 }
示例#4
0
        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());
            }
        }
示例#5
0
        public virtual string ToString(bool includeAppInfo, bool includeCustomEventDetails)
        {
            WebEventFormatter formatter = new WebEventFormatter();

            this.FormatToString(formatter, includeAppInfo);
            if (!this.IsSystemEvent && includeCustomEventDetails)
            {
                formatter.AppendLine(string.Empty);
                formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_custom_event_details"));
                formatter.IndentationLevel++;
                this.FormatCustomEventDetails(formatter);
                formatter.IndentationLevel--;
            }
            return(formatter.ToString());
        }
 public virtual string ToString(bool includeAppInfo, bool includeCustomEventDetails)
 {
     WebEventFormatter formatter = new WebEventFormatter();
     this.FormatToString(formatter, includeAppInfo);
     if (!this.IsSystemEvent && includeCustomEventDetails)
     {
         formatter.AppendLine(string.Empty);
         formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_custom_event_details"));
         formatter.IndentationLevel++;
         this.FormatCustomEventDetails(formatter);
         formatter.IndentationLevel--;
     }
     return formatter.ToString();
 }
示例#7
0
        public virtual string ToString(bool includeAppInfo, bool includeCustomEventDetails) {
            WebEventFormatter   formatter = new WebEventFormatter();

            FormatToString(formatter, includeAppInfo);

            if (!IsSystemEvent && includeCustomEventDetails) {
                formatter.AppendLine(String.Empty);
                formatter.AppendLine(WebBaseEvent.FormatResourceStringWithCache(SR.Webevent_event_custom_event_details));
                formatter.IndentationLevel += 1;
                FormatCustomEventDetails(formatter);
                formatter.IndentationLevel -= 1;
            }

            return formatter.ToString();
        }
示例#8
0
        public override string ToString() {
            WebEventFormatter formatter = new WebEventFormatter();

            FormatToString(formatter);
            return 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();
            }
        }