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
- FormViewPagerRow.cs
- CollectionViewGroup.cs
- FormViewInsertEventArgs.cs
- LinkArea.cs
- AnnotationAdorner.cs
- TableLayoutPanelBehavior.cs
- RIPEMD160Managed.cs
- KeyValuePair.cs
- BaseHashHelper.cs
- SafeNativeMethods.cs
- IApplicationTrustManager.cs
- EntityParameterCollection.cs
- MenuItemStyleCollection.cs
- SqlDependencyUtils.cs
- sapiproxy.cs
- SHA256Managed.cs
- DefaultEventAttribute.cs
- ResourcesBuildProvider.cs
- GeneralTransform2DTo3D.cs
- ServiceChannelManager.cs
- StorageModelBuildProvider.cs
- LocatorGroup.cs
- SemanticBasicElement.cs
- PropertyFilter.cs
- X509Extension.cs
- DataSet.cs
- MgmtConfigurationRecord.cs
- RegexRunnerFactory.cs
- DesignerHierarchicalDataSourceView.cs
- SoapAttributes.cs
- Utils.cs
- DataGridViewCellParsingEventArgs.cs
- WorkflowLayouts.cs
- ReflectEventDescriptor.cs
- JapaneseLunisolarCalendar.cs
- XmlSchemaProviderAttribute.cs
- Membership.cs
- wmiprovider.cs
- IsolatedStorageFilePermission.cs
- XmlILIndex.cs
- MembershipUser.cs
- XPathNodeIterator.cs
- HitTestWithPointDrawingContextWalker.cs
- ProfileBuildProvider.cs
- SiteMapNode.cs
- ValidationEventArgs.cs
- BitmapCodecInfo.cs
- Msmq4SubqueuePoisonHandler.cs
- Vector3DKeyFrameCollection.cs
- IntegerFacetDescriptionElement.cs
- XmlText.cs
- SqlDataSourceCommandEventArgs.cs
- ListControlDataBindingHandler.cs
- listitem.cs
- PointLightBase.cs
- BitmapFrameEncode.cs
- ManualResetEventSlim.cs
- OracleCommandBuilder.cs
- AssociationSet.cs
- Item.cs
- PropertyValue.cs
- MetadataSerializer.cs
- StringUtil.cs
- ListControlStringCollectionEditor.cs
- MemberAccessException.cs
- TransactionInformation.cs
- SqlDataSourceSelectingEventArgs.cs
- ProgressBarAutomationPeer.cs
- Latin1Encoding.cs
- Matrix.cs
- RuleInfoComparer.cs
- ReadWriteObjectLock.cs
- TableLayoutSettingsTypeConverter.cs
- Transform.cs
- Int64Storage.cs
- DesignerOptionService.cs
- StatusBarAutomationPeer.cs
- Module.cs
- DBSqlParserColumn.cs
- BuildProviderUtils.cs
- SQlBooleanStorage.cs
- TypeName.cs
- CodeMemberField.cs
- AsyncPostBackErrorEventArgs.cs
- ReferentialConstraint.cs
- ContainsRowNumberChecker.cs
- DBConnectionString.cs
- CheckedListBox.cs
- NetworkInformationException.cs
- StylusTip.cs
- IgnoreFileBuildProvider.cs
- LocalizabilityAttribute.cs
- RIPEMD160.cs
- SessionStateUtil.cs
- ContentElement.cs
- ContextStaticAttribute.cs
- Material.cs
- ConditionalAttribute.cs
- ActivityDesignerAccessibleObject.cs
- CustomErrorCollection.cs