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
- TypefaceMetricsCache.cs
- CodeSubDirectoriesCollection.cs
- DATA_BLOB.cs
- XmlLanguageConverter.cs
- TemplateControlCodeDomTreeGenerator.cs
- DataGridAddNewRow.cs
- DataFormat.cs
- BlockExpression.cs
- CodeDirectoryCompiler.cs
- InvokePattern.cs
- MSAANativeProvider.cs
- Error.cs
- ObjectRef.cs
- ScrollBar.cs
- ModelUtilities.cs
- FontWeightConverter.cs
- VirtualDirectoryMapping.cs
- ContextDataSourceContextData.cs
- PropertyChangedEventManager.cs
- ClientScriptManagerWrapper.cs
- DataGridHelper.cs
- UICuesEvent.cs
- TypeToken.cs
- RowCache.cs
- OAVariantLib.cs
- DesignerSerializationOptionsAttribute.cs
- WebPartEventArgs.cs
- input.cs
- DateBoldEvent.cs
- KnownBoxes.cs
- DesignBindingPropertyDescriptor.cs
- SqlFunctionAttribute.cs
- SingleAnimation.cs
- PageTextBox.cs
- XmlIlTypeHelper.cs
- AccessedThroughPropertyAttribute.cs
- StartUpEventArgs.cs
- QilList.cs
- StateDesigner.CommentLayoutGlyph.cs
- Journaling.cs
- ActivityExecutorOperation.cs
- KeyNotFoundException.cs
- ComponentDispatcher.cs
- HandlerBase.cs
- StylusCollection.cs
- WindowsAltTab.cs
- XmlSchemaElement.cs
- DuplicateMessageDetector.cs
- Tokenizer.cs
- SqlWebEventProvider.cs
- ClientConfigurationSystem.cs
- DataGridViewToolTip.cs
- DataColumnMappingCollection.cs
- StackOverflowException.cs
- SqlFunctionAttribute.cs
- ActivityValidator.cs
- LinqDataSourceInsertEventArgs.cs
- XamlNamespaceHelper.cs
- XmlSchemaSearchPattern.cs
- XmlDataImplementation.cs
- ObjectStateManagerMetadata.cs
- ConfigUtil.cs
- CapacityStreamGeometryContext.cs
- OracleDataAdapter.cs
- ServiceProviders.cs
- Mapping.cs
- SrgsItemList.cs
- TemplateNameScope.cs
- MinMaxParagraphWidth.cs
- DoubleAnimationBase.cs
- EventLogger.cs
- ClrPerspective.cs
- ObjectItemLoadingSessionData.cs
- ConditionedDesigner.cs
- DataGrid.cs
- TextFindEngine.cs
- CallbackValidator.cs
- ObjectHandle.cs
- ProcessingInstructionAction.cs
- BindingsCollection.cs
- TextDpi.cs
- TypeDescriptorFilterService.cs
- XmlSchemaObjectTable.cs
- IChannel.cs
- HitTestWithGeometryDrawingContextWalker.cs
- webbrowsersite.cs
- ConnectionStringsExpressionBuilder.cs
- DetailsViewInsertedEventArgs.cs
- ListViewInsertionMark.cs
- SqlFacetAttribute.cs
- TextParagraphCache.cs
- EventListener.cs
- TableLayoutPanel.cs
- DynamicQueryStringParameter.cs
- TokenBasedSet.cs
- DoubleAnimationUsingPath.cs
- DragCompletedEventArgs.cs
- AuthenticationServiceManager.cs
- CollectionDataContract.cs
- ComponentSerializationService.cs