示例#1
0
        private void RequestEvents()
        {
            // C:\public\System.Diagnostics.Eventing\Microsoft\Win32\SafeHandles;

            asyncException = null;
            Debug.Assert(_numEventsInBuffer == 0);

            bool results = false;

            do
            {
                if (!_isSubscribing)
                {
                    break;
                }

                try
                {
                    results = NativeWrapper.EvtNext(_handle, _eventsBuffer.Length, _eventsBuffer, 0, 0, ref _numEventsInBuffer);

                    if (!results)
                    {
                        return;
                    }
                }
                catch (Exception e)
                {
                    asyncException = new EventLogException();
                    asyncException.Data.Add("RealException", e);
                }

                HandleEventsRequestCompletion();
            } while (results);
        }
示例#2
0
        private void RequestEvents()
        {
            EventLogPermissionHolder.GetEventLogPermission().Demand();
            this.asyncException = null;
            bool flag = false;

            do
            {
                if (!this.isSubscribing)
                {
                    return;
                }
                try
                {
                    if (!NativeWrapper.EvtNext(this.handle, this.eventsBuffer.Length, this.eventsBuffer, 0, 0, ref this.numEventsInBuffer))
                    {
                        break;
                    }
                }
                catch (Exception exception)
                {
                    this.asyncException = new EventLogException();
                    this.asyncException.Data.Add("RealException", exception);
                }
                this.HandleEventsRequestCompletion();
            }while (flag);
        }
        private void RequestEvents() {

            EventLogPermissionHolder.GetEventLogPermission().Demand();

            this.asyncException = null;
            Debug.Assert(this. numEventsInBuffer == 0);

            bool results = false;

            do {

                if (!this.isSubscribing)
                    break;

                try {

                    results = NativeWrapper.EvtNext(this.handle, this.eventsBuffer.Length, this.eventsBuffer, 0, 0, ref this. numEventsInBuffer);

                    if (!results)
                        return;
                }
                catch (Exception e) {
                    this.asyncException = new EventLogException();
                    this.asyncException.Data.Add("RealException", e);                    
                }

                HandleEventsRequestCompletion();

            } while (results);
        }
示例#4
0
 private void RequestEvents()
 {
     EventLogPermissionHolder.GetEventLogPermission().Demand();
     this.asyncException = null;
     bool flag = false;
     do
     {
         if (!this.isSubscribing)
         {
             return;
         }
         try
         {
             if (!NativeWrapper.EvtNext(this.handle, this.eventsBuffer.Length, this.eventsBuffer, 0, 0, ref this.numEventsInBuffer))
             {
                 break;
             }
         }
         catch (Exception exception)
         {
             this.asyncException = new EventLogException();
             this.asyncException.Data.Add("RealException", exception);
         }
         this.HandleEventsRequestCompletion();
     }
     while (flag);
 }
 internal EventRecordWrittenEventArgs(EventLogException exception)
 {
     this.exception = exception;
 }
示例#6
0
 internal EventRecordWrittenEventArgs(EventLogException exception)
 {
     this.exception = exception;
 }