Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Monitoring / system / Diagnosticts / EventData.cs / 1305376 / EventData.cs
using System.ComponentModel; using System.Security.Permissions; using System.Security; namespace System.Diagnostics { public class EventInstance { private int _categoryNumber; private EventLogEntryType _entryType = EventLogEntryType.Information; private long _instanceId; public EventInstance(long instanceId, int categoryId) { CategoryId = categoryId; InstanceId = instanceId; } public EventInstance(long instanceId, int categoryId, EventLogEntryType entryType) : this (instanceId, categoryId) { EntryType = entryType; } public int CategoryId { get { return _categoryNumber; } set { if (value > UInt16.MaxValue || value < 0) throw new ArgumentOutOfRangeException("value"); _categoryNumber = value; } } public EventLogEntryType EntryType { get { return _entryType; } set { if (!Enum.IsDefined(typeof(EventLogEntryType), value)) throw new InvalidEnumArgumentException("value", (int)value, typeof(EventLogEntryType)); _entryType = value; } } public long InstanceId { get { return _instanceId; } set { if (value > UInt32.MaxValue || value < 0) throw new ArgumentOutOfRangeException("value"); _instanceId = value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System.ComponentModel; using System.Security.Permissions; using System.Security; namespace System.Diagnostics { public class EventInstance { private int _categoryNumber; private EventLogEntryType _entryType = EventLogEntryType.Information; private long _instanceId; public EventInstance(long instanceId, int categoryId) { CategoryId = categoryId; InstanceId = instanceId; } public EventInstance(long instanceId, int categoryId, EventLogEntryType entryType) : this (instanceId, categoryId) { EntryType = entryType; } public int CategoryId { get { return _categoryNumber; } set { if (value > UInt16.MaxValue || value < 0) throw new ArgumentOutOfRangeException("value"); _categoryNumber = value; } } public EventLogEntryType EntryType { get { return _entryType; } set { if (!Enum.IsDefined(typeof(EventLogEntryType), value)) throw new InvalidEnumArgumentException("value", (int)value, typeof(EventLogEntryType)); _entryType = value; } } public long InstanceId { get { return _instanceId; } set { if (value > UInt32.MaxValue || value < 0) throw new ArgumentOutOfRangeException("value"); _instanceId = value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ConnectionStringsSection.cs
- DataPager.cs
- FormViewPagerRow.cs
- DesignerUtils.cs
- ContextMarshalException.cs
- SessionStateSection.cs
- ErrorStyle.cs
- XpsS0ValidatingLoader.cs
- PageParserFilter.cs
- MoveSizeWinEventHandler.cs
- WeakReferenceList.cs
- ObjectTag.cs
- HideDisabledControlAdapter.cs
- MultipleViewPattern.cs
- DbConnectionPoolGroupProviderInfo.cs
- NavigationCommands.cs
- SessionState.cs
- BulletedList.cs
- OdbcDataAdapter.cs
- MarshalDirectiveException.cs
- ContextMenuAutomationPeer.cs
- BufferedStream2.cs
- PrtCap_Public_Simple.cs
- Point3DAnimation.cs
- CustomTrackingRecord.cs
- LinkTarget.cs
- ServerValidateEventArgs.cs
- X509Utils.cs
- SimpleExpression.cs
- XmlCharCheckingWriter.cs
- X509PeerCertificateAuthenticationElement.cs
- TableRowsCollectionEditor.cs
- AppDomainProtocolHandler.cs
- FormsAuthenticationConfiguration.cs
- BitmapSourceSafeMILHandle.cs
- DescendantOverDescendantQuery.cs
- NullRuntimeConfig.cs
- SRDisplayNameAttribute.cs
- SystemUnicastIPAddressInformation.cs
- ButtonColumn.cs
- Line.cs
- Compiler.cs
- WindowPatternIdentifiers.cs
- DbSourceCommand.cs
- MemberDomainMap.cs
- DefaultClaimSet.cs
- SQLBytes.cs
- SinglePhaseEnlistment.cs
- TableCell.cs
- PolicyUnit.cs
- baseaxisquery.cs
- BamlResourceSerializer.cs
- safex509handles.cs
- Vector3DCollectionConverter.cs
- InProcStateClientManager.cs
- SqlPersonalizationProvider.cs
- PeerCollaborationPermission.cs
- EntityContainerAssociationSet.cs
- DetectRunnableInstancesTask.cs
- ReadingWritingEntityEventArgs.cs
- GeometryDrawing.cs
- LoadGrammarCompletedEventArgs.cs
- Material.cs
- ServiceDescription.cs
- TextComposition.cs
- COM2FontConverter.cs
- JavaScriptObjectDeserializer.cs
- OperationCanceledException.cs
- SafeCryptoHandles.cs
- XMLSyntaxException.cs
- ArraySubsetEnumerator.cs
- FileDetails.cs
- LaxModeSecurityHeaderElementInferenceEngine.cs
- SiteMapDataSourceView.cs
- SchemaDeclBase.cs
- StateMachineAction.cs
- FormatVersion.cs
- SQLDoubleStorage.cs
- GB18030Encoding.cs
- StylusPlugInCollection.cs
- SemanticResolver.cs
- ModelPropertyCollectionImpl.cs
- HttpSysSettings.cs
- ObjectPropertyMapping.cs
- MediaPlayerState.cs
- DoubleAnimationUsingPath.cs
- DocumentApplication.cs
- _RequestCacheProtocol.cs
- login.cs
- TextModifier.cs
- JulianCalendar.cs
- PreservationFileWriter.cs
- InstanceLockTracking.cs
- Vector3dCollection.cs
- InheritablePropertyChangeInfo.cs
- BezierSegment.cs
- StylusLogic.cs
- PixelFormatConverter.cs
- Int32.cs
- GeometryModel3D.cs