Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventLogQuery.cs / 1305376 / EventLogQuery.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventLogQuery ** ** Purpose: ** This public class allows a user to define events of interest. ** An instance of this class is passed to an EventReader to actually ** obtain the EventRecords. The EventLogQuery can be as ** simple specifying that all events are of interest, or it can contain ** query / xpath expressions that indicate exactly what characteristics ** events should have. ** ============================================================*/ using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace System.Diagnostics.Eventing.Reader { ////// Allows a user to define events of interest. An instance of this /// class is passed to an EventReader to actually obtain the EventRecords. /// The EventLogQuery can be as simple specifying that all events are of /// interest, or it can contain query / xpath expressions that indicate exactly /// what characteristics events should have. /// public class EventLogQuery { private string query; private string path; private EventLogSession session; private PathType pathType; private bool tolerateErrors = false; private bool reverseDirection = false; public EventLogQuery(string path, PathType pathType) : this(path, pathType, null) { } public EventLogQuery(string path, PathType pathType, string query) { this.session = EventLogSession.GlobalSession; this.path = path; // can be null this.pathType = pathType; if (query == null) { if (path == null) throw new ArgumentNullException("path"); } else { this.query = query; } } public EventLogSession Session { get { return this.session; } set { this.session = value; } } public bool TolerateQueryErrors { get { return this.tolerateErrors; } set { this.tolerateErrors = value; } } public bool ReverseDirection { get { return this.reverseDirection; } set { this.reverseDirection = value; } } internal string Path { get { return this.path; } } internal PathType ThePathType { get { return this.pathType; } } internal string Query { get { return this.query; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventLogQuery ** ** Purpose: ** This public class allows a user to define events of interest. ** An instance of this class is passed to an EventReader to actually ** obtain the EventRecords. The EventLogQuery can be as ** simple specifying that all events are of interest, or it can contain ** query / xpath expressions that indicate exactly what characteristics ** events should have. ** ============================================================*/ using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace System.Diagnostics.Eventing.Reader { ////// Allows a user to define events of interest. An instance of this /// class is passed to an EventReader to actually obtain the EventRecords. /// The EventLogQuery can be as simple specifying that all events are of /// interest, or it can contain query / xpath expressions that indicate exactly /// what characteristics events should have. /// public class EventLogQuery { private string query; private string path; private EventLogSession session; private PathType pathType; private bool tolerateErrors = false; private bool reverseDirection = false; public EventLogQuery(string path, PathType pathType) : this(path, pathType, null) { } public EventLogQuery(string path, PathType pathType, string query) { this.session = EventLogSession.GlobalSession; this.path = path; // can be null this.pathType = pathType; if (query == null) { if (path == null) throw new ArgumentNullException("path"); } else { this.query = query; } } public EventLogSession Session { get { return this.session; } set { this.session = value; } } public bool TolerateQueryErrors { get { return this.tolerateErrors; } set { this.tolerateErrors = value; } } public bool ReverseDirection { get { return this.reverseDirection; } set { this.reverseDirection = value; } } internal string Path { get { return this.path; } } internal PathType ThePathType { get { return this.pathType; } } internal string Query { get { return this.query; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventDescriptor.cs
- EventSourceCreationData.cs
- LoadWorkflowCommand.cs
- InputLanguageSource.cs
- InArgument.cs
- TextRange.cs
- CursorInteropHelper.cs
- InternalRelationshipCollection.cs
- IISMapPath.cs
- AllMembershipCondition.cs
- RangeBase.cs
- UserPreferenceChangedEventArgs.cs
- FixedFindEngine.cs
- XmlILIndex.cs
- MethodImplAttribute.cs
- DetailsViewDeletedEventArgs.cs
- FamilyTypeface.cs
- ReflectionTypeLoadException.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- RuntimeUtils.cs
- DesignerVerbCollection.cs
- _OverlappedAsyncResult.cs
- GroupQuery.cs
- PageTheme.cs
- TemplatedWizardStep.cs
- ObjectSet.cs
- WindowProviderWrapper.cs
- Guid.cs
- Viewport3DAutomationPeer.cs
- ExceptionWrapper.cs
- BrushConverter.cs
- ITreeGenerator.cs
- TailPinnedEventArgs.cs
- MimeAnyImporter.cs
- CommandID.cs
- DesignerActionMethodItem.cs
- WebBaseEventKeyComparer.cs
- MSAANativeProvider.cs
- CmsInterop.cs
- DesignTimeParseData.cs
- OledbConnectionStringbuilder.cs
- ProxyAttribute.cs
- BindingManagerDataErrorEventArgs.cs
- DatatypeImplementation.cs
- TagPrefixAttribute.cs
- EditingCommands.cs
- CodeVariableReferenceExpression.cs
- _LazyAsyncResult.cs
- BaseResourcesBuildProvider.cs
- Visitors.cs
- DependencyPropertyAttribute.cs
- DistinctQueryOperator.cs
- FormViewModeEventArgs.cs
- Component.cs
- DataSourceNameHandler.cs
- GridViewRowEventArgs.cs
- AuthenticationSection.cs
- ZipIOCentralDirectoryFileHeader.cs
- InheritedPropertyDescriptor.cs
- ListItemParagraph.cs
- CheckPair.cs
- DocumentViewerConstants.cs
- WebPartZoneCollection.cs
- AppModelKnownContentFactory.cs
- HttpListener.cs
- DiscreteKeyFrames.cs
- BitmapFrame.cs
- CommonGetThemePartSize.cs
- SiteMapNode.cs
- DataFormats.cs
- DataServiceClientException.cs
- ToolStripSplitStackLayout.cs
- OpacityConverter.cs
- TransformerConfigurationWizardBase.cs
- LinqDataSourceView.cs
- DocumentSchemaValidator.cs
- HtmlInputPassword.cs
- UndoManager.cs
- SafeBitVector32.cs
- PropertyDescriptor.cs
- BinaryNode.cs
- SystemWebCachingSectionGroup.cs
- DBCSCodePageEncoding.cs
- URLIdentityPermission.cs
- BindingList.cs
- BasicCellRelation.cs
- SqlMultiplexer.cs
- ExceptionHelpers.cs
- FontNamesConverter.cs
- controlskin.cs
- _SecureChannel.cs
- Clock.cs
- TimeEnumHelper.cs
- RegexFCD.cs
- RegexTypeEditor.cs
- FilteredXmlReader.cs
- MulticastNotSupportedException.cs
- CatalogZoneBase.cs
- HMACSHA1.cs
- DataTemplate.cs