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
- HttpListenerRequest.cs
- WindowsGraphicsWrapper.cs
- CustomGrammar.cs
- SvcMapFileSerializer.cs
- StorageAssociationTypeMapping.cs
- NamespaceList.cs
- StackSpiller.cs
- QilTypeChecker.cs
- ExtendedTransformFactory.cs
- SqlReorderer.cs
- NavigationEventArgs.cs
- ListViewItem.cs
- BCLDebug.cs
- StrongNameUtility.cs
- ExpressionList.cs
- XappLauncher.cs
- SizeAnimationBase.cs
- PartEditor.cs
- MobileControlsSection.cs
- SettingsPropertyValueCollection.cs
- CheckBoxStandardAdapter.cs
- VBCodeProvider.cs
- ImageButton.cs
- SimpleTextLine.cs
- TypeUtil.cs
- WorkflowValidationFailedException.cs
- LineBreak.cs
- WebProxyScriptElement.cs
- _SecureChannel.cs
- FileNotFoundException.cs
- GridViewDeleteEventArgs.cs
- DragEventArgs.cs
- DataGridClipboardHelper.cs
- VectorAnimationBase.cs
- XmlSchemaSimpleType.cs
- RecordManager.cs
- baseshape.cs
- documentsequencetextpointer.cs
- HeaderCollection.cs
- XmlSchemaAny.cs
- Size3D.cs
- Parallel.cs
- EnumUnknown.cs
- HttpFileCollection.cs
- EventHandlersStore.cs
- LoaderAllocator.cs
- PackageRelationship.cs
- LingerOption.cs
- AuthenticationService.cs
- ProtocolViolationException.cs
- EnvironmentPermission.cs
- AssemblyAttributesGoHere.cs
- CompositeScriptReferenceEventArgs.cs
- FixedSOMPageElement.cs
- DataGridViewMethods.cs
- SynchronizedMessageSource.cs
- DefaultTextStore.cs
- AtomEntry.cs
- ColorBlend.cs
- TraceHandler.cs
- XmlSchemaCompilationSettings.cs
- FixedSOMFixedBlock.cs
- TableLayoutSettingsTypeConverter.cs
- GridItemProviderWrapper.cs
- MultipleViewProviderWrapper.cs
- Cursors.cs
- SecurityElement.cs
- RSAOAEPKeyExchangeFormatter.cs
- SmtpCommands.cs
- WindowsClaimSet.cs
- SecurityAttributeGenerationHelper.cs
- NodeFunctions.cs
- DesignRelation.cs
- AnnotationHelper.cs
- ConfigurationProperty.cs
- DynamicValueConverter.cs
- MissingManifestResourceException.cs
- IsolatedStorageException.cs
- SatelliteContractVersionAttribute.cs
- MetadataPropertyvalue.cs
- XPathNodePointer.cs
- ExclusiveHandle.cs
- SafeNativeMethods.cs
- SmtpReplyReader.cs
- ClientTargetSection.cs
- ConfigurationConverterBase.cs
- MenuTracker.cs
- Error.cs
- basecomparevalidator.cs
- WebPartDisplayModeCancelEventArgs.cs
- HtmlTable.cs
- RegexCapture.cs
- TreeNode.cs
- EntityClassGenerator.cs
- AliasedSlot.cs
- CompositeActivityValidator.cs
- OTFRasterizer.cs
- ArcSegment.cs
- AutomationPattern.cs
- WebConfigurationManager.cs