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
- PointUtil.cs
- StateMachineAction.cs
- SubordinateTransaction.cs
- sqlnorm.cs
- SystemIPGlobalProperties.cs
- InternalConfigRoot.cs
- ObjectTag.cs
- CurrencyManager.cs
- RawStylusActions.cs
- DataRow.cs
- MultipleViewPattern.cs
- SpotLight.cs
- SelectedGridItemChangedEvent.cs
- ColumnWidthChangingEvent.cs
- Route.cs
- OciLobLocator.cs
- UnmanagedHandle.cs
- MailDefinition.cs
- UnsafeNativeMethods.cs
- RightsManagementPermission.cs
- XmlDigitalSignatureProcessor.cs
- CultureNotFoundException.cs
- ExecutorLocksHeldException.cs
- OutputScopeManager.cs
- ViewSimplifier.cs
- Attachment.cs
- DeclarativeCatalogPart.cs
- QilGenerator.cs
- VirtualStackFrame.cs
- XmlNamespaceMapping.cs
- SqlCacheDependencyDatabaseCollection.cs
- NodeLabelEditEvent.cs
- GlyphRunDrawing.cs
- VScrollBar.cs
- TdsParser.cs
- ITextView.cs
- AliasExpr.cs
- FacetValueContainer.cs
- HTTPNotFoundHandler.cs
- SqlStatistics.cs
- SubstitutionList.cs
- WebPartExportVerb.cs
- ReferencedCollectionType.cs
- StylusButton.cs
- DisableDpiAwarenessAttribute.cs
- ExtensionElement.cs
- UIPermission.cs
- regiisutil.cs
- SqlMetaData.cs
- XPathSingletonIterator.cs
- PerformanceCounterLib.cs
- HTMLTextWriter.cs
- NullableLongAverageAggregationOperator.cs
- RtfControlWordInfo.cs
- MenuRenderer.cs
- WebPartMenuStyle.cs
- HttpDictionary.cs
- RandomNumberGenerator.cs
- PersonalizationState.cs
- DataGridViewCellCancelEventArgs.cs
- NullableDecimalMinMaxAggregationOperator.cs
- Configuration.cs
- PreProcessor.cs
- Shape.cs
- ToolStripButton.cs
- GridViewAutomationPeer.cs
- UserControl.cs
- WinFormsComponentEditor.cs
- MediaContextNotificationWindow.cs
- SafeLocalAllocation.cs
- WebPartManager.cs
- EpmCustomContentWriterNodeData.cs
- HWStack.cs
- ListBindingHelper.cs
- MetaModel.cs
- TcpTransportSecurityElement.cs
- XPathNavigatorReader.cs
- Switch.cs
- MetaType.cs
- CodeTypeOfExpression.cs
- SendSecurityHeaderElementContainer.cs
- WebException.cs
- RectConverter.cs
- StrongNameMembershipCondition.cs
- ExpandCollapseProviderWrapper.cs
- ResourceBinder.cs
- ListViewCancelEventArgs.cs
- BuildProvider.cs
- SqlTriggerContext.cs
- DBSqlParserTableCollection.cs
- ListComponentEditor.cs
- VariableQuery.cs
- OpCopier.cs
- ComPlusDiagnosticTraceRecords.cs
- SlotInfo.cs
- StylusPlugInCollection.cs
- DataRowView.cs
- SqlMethodCallConverter.cs
- InstanceValue.cs
- DataSourceProvider.cs