Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventLogLink.cs / 1305376 / EventLogLink.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventLogLink ** ** Purpose: ** This public class describes the metadata for a specific Log ** Reference defined by a Provider. An instance of this class is obtained from ** a ProviderMetadata object. ** ============================================================*/ using System.Collections.Generic; namespace System.Diagnostics.Eventing.Reader { ////// Describes the metadata for a specific Log Reference defined /// by a Provider. An instance of this class is obtained from /// a ProviderMetadata object. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class EventLogLink { private string channelName; private bool isImported; private string displayName; private uint channelId; private bool dataReady; ProviderMetadata pmReference; object syncObject; internal EventLogLink(uint channelId, ProviderMetadata pmReference) { this.channelId = channelId; this.pmReference = pmReference; this.syncObject = new object(); } internal EventLogLink(string channelName, bool isImported, string displayName, uint channelId) { this.channelName = channelName; this.isImported = isImported; this.displayName = displayName; this.channelId = channelId; this.dataReady = true; this.syncObject = new object(); } private void PrepareData() { if (dataReady == true) return; lock (syncObject) { if (dataReady == true) return; IEnumerableresult = pmReference.LogLinks; this.channelName = null; this.isImported = false; this.displayName = null; this.dataReady = true; foreach (EventLogLink ch in result) { if (ch.ChannelId == this.channelId) { this.channelName = ch.LogName; this.isImported = ch.IsImported; this.displayName = ch.DisplayName; this.dataReady = true; break; } } } } public string LogName { get { this.PrepareData(); return this.channelName; } } public bool IsImported { get { this.PrepareData(); return this.isImported; } } public string DisplayName { get { this.PrepareData(); return this.displayName; } } internal uint ChannelId { get { return channelId; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventLogLink ** ** Purpose: ** This public class describes the metadata for a specific Log ** Reference defined by a Provider. An instance of this class is obtained from ** a ProviderMetadata object. ** ============================================================*/ using System.Collections.Generic; namespace System.Diagnostics.Eventing.Reader { /// /// Describes the metadata for a specific Log Reference defined /// by a Provider. An instance of this class is obtained from /// a ProviderMetadata object. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class EventLogLink { private string channelName; private bool isImported; private string displayName; private uint channelId; private bool dataReady; ProviderMetadata pmReference; object syncObject; internal EventLogLink(uint channelId, ProviderMetadata pmReference) { this.channelId = channelId; this.pmReference = pmReference; this.syncObject = new object(); } internal EventLogLink(string channelName, bool isImported, string displayName, uint channelId) { this.channelName = channelName; this.isImported = isImported; this.displayName = displayName; this.channelId = channelId; this.dataReady = true; this.syncObject = new object(); } private void PrepareData() { if (dataReady == true) return; lock (syncObject) { if (dataReady == true) return; IEnumerableresult = pmReference.LogLinks; this.channelName = null; this.isImported = false; this.displayName = null; this.dataReady = true; foreach (EventLogLink ch in result) { if (ch.ChannelId == this.channelId) { this.channelName = ch.LogName; this.isImported = ch.IsImported; this.displayName = ch.DisplayName; this.dataReady = true; break; } } } } public string LogName { get { this.PrepareData(); return this.channelName; } } public bool IsImported { get { this.PrepareData(); return this.isImported; } } public string DisplayName { get { this.PrepareData(); return this.displayName; } } internal uint ChannelId { get { return channelId; } } } } // 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
- DoubleAnimationUsingPath.cs
- EventBuilder.cs
- OpCellTreeNode.cs
- DesignTimeValidationFeature.cs
- SupportingTokenDuplexChannel.cs
- PixelFormat.cs
- CultureMapper.cs
- RC2.cs
- Operator.cs
- MessageTraceRecord.cs
- DelegateTypeInfo.cs
- FrameAutomationPeer.cs
- ModuleElement.cs
- ConfigurationStrings.cs
- UserControlDesigner.cs
- DrawingImage.cs
- SessionPageStatePersister.cs
- CodeGeneratorOptions.cs
- LayoutExceptionEventArgs.cs
- FontEmbeddingManager.cs
- _NegoState.cs
- ToolStripMenuItemDesigner.cs
- WebControlsSection.cs
- OutputCacheSection.cs
- DateTimeValueSerializer.cs
- Pen.cs
- DirtyTextRange.cs
- MenuBase.cs
- DrawListViewColumnHeaderEventArgs.cs
- WebControlAdapter.cs
- HttpListenerResponse.cs
- DiscoveryServerProtocol.cs
- iisPickupDirectory.cs
- DES.cs
- DataQuery.cs
- DbBuffer.cs
- SafeEventLogWriteHandle.cs
- SrgsDocumentParser.cs
- Win32Exception.cs
- IndexedSelectQueryOperator.cs
- TableRowCollection.cs
- FixedSOMTextRun.cs
- SafeFindHandle.cs
- CapiSafeHandles.cs
- SharedHttpsTransportManager.cs
- FormsAuthenticationModule.cs
- RoutedUICommand.cs
- Button.cs
- SqlXmlStorage.cs
- x509utils.cs
- ValidationErrorCollection.cs
- EntityModelSchemaGenerator.cs
- FileSystemInfo.cs
- WebServiceData.cs
- ComboBoxItem.cs
- NotSupportedException.cs
- ComponentChangingEvent.cs
- DataGridViewCellCancelEventArgs.cs
- SoapConverter.cs
- Thumb.cs
- MimeBasePart.cs
- AuthorizationRuleCollection.cs
- SmtpFailedRecipientsException.cs
- _FixedSizeReader.cs
- ProgressBarRenderer.cs
- WebPageTraceListener.cs
- FlowLayoutPanel.cs
- LinkArea.cs
- SizeLimitedCache.cs
- InvalidCardException.cs
- InvalidPropValue.cs
- BatchParser.cs
- PermissionToken.cs
- RowParagraph.cs
- TableParagraph.cs
- SecurityKeyUsage.cs
- TemplateLookupAction.cs
- MatrixTransform.cs
- XmlLinkedNode.cs
- CaseStatementSlot.cs
- XmlTextReader.cs
- TreeNodeStyleCollection.cs
- InfoCardBaseException.cs
- ConversionValidationRule.cs
- CompilerScope.cs
- ListViewPagedDataSource.cs
- PageThemeBuildProvider.cs
- Roles.cs
- GetResponse.cs
- InkCanvasSelectionAdorner.cs
- InfoCardMetadataExchangeClient.cs
- KeyConverter.cs
- securitymgrsite.cs
- DataSourceCacheDurationConverter.cs
- DataKeyPropertyAttribute.cs
- ServiceInfoCollection.cs
- OracleConnectionStringBuilder.cs
- Rfc2898DeriveBytes.cs
- MeshGeometry3D.cs
- TakeOrSkipWhileQueryOperator.cs