Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Services / Monitoring / system / Diagnosticts / EventData.cs / 1 / 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
- ThreadStateException.cs
- TypeUnloadedException.cs
- PropertyReference.cs
- OracleParameterCollection.cs
- CfgParser.cs
- VisualBasicDesignerHelper.cs
- PropertyHelper.cs
- TextEndOfSegment.cs
- SliderAutomationPeer.cs
- DiagnosticStrings.cs
- HttpRuntimeSection.cs
- Accessible.cs
- CfgParser.cs
- PagerSettings.cs
- AffineTransform3D.cs
- MailWriter.cs
- AuthenticationService.cs
- WebBrowsableAttribute.cs
- Tuple.cs
- FontInfo.cs
- UpdatePanelTriggerCollection.cs
- XmlCharacterData.cs
- HttpListenerRequest.cs
- FastPropertyAccessor.cs
- WeakReference.cs
- JsonByteArrayDataContract.cs
- DiscoveryClientProtocol.cs
- EntityDataSourceWizardForm.cs
- SymbolMethod.cs
- Geometry3D.cs
- LocationEnvironment.cs
- HttpHeaderCollection.cs
- SocketInformation.cs
- httpstaticobjectscollection.cs
- InputScopeNameConverter.cs
- safePerfProviderHandle.cs
- AssemblyName.cs
- SafeProcessHandle.cs
- LineInfo.cs
- TcpHostedTransportConfiguration.cs
- CommentAction.cs
- GridToolTip.cs
- Bold.cs
- SizeChangedEventArgs.cs
- ObjectDataSourceDisposingEventArgs.cs
- SplitContainer.cs
- KeyGestureValueSerializer.cs
- OdbcPermission.cs
- IDReferencePropertyAttribute.cs
- RepeaterItemCollection.cs
- DataGridCellClipboardEventArgs.cs
- AssemblyAttributes.cs
- ReadContentAsBinaryHelper.cs
- ListViewItem.cs
- HwndSourceParameters.cs
- FixedPageProcessor.cs
- XmlSchemaInfo.cs
- HandlerBase.cs
- ObjectConverter.cs
- PackUriHelper.cs
- DoubleCollection.cs
- VisualTreeHelper.cs
- HttpContext.cs
- DependencyPropertyKey.cs
- SqlDataSourceCommandEventArgs.cs
- CodeAttributeArgumentCollection.cs
- EntityCommandCompilationException.cs
- FrameworkElementFactoryMarkupObject.cs
- TreeViewImageIndexConverter.cs
- BatchStream.cs
- DataColumnCollection.cs
- TextBoxLine.cs
- ResXResourceSet.cs
- ReadWriteSpinLock.cs
- RegisteredScript.cs
- _AuthenticationState.cs
- Table.cs
- EmbeddedMailObject.cs
- DesignBindingValueUIHandler.cs
- FileFormatException.cs
- InsufficientMemoryException.cs
- MsdtcWrapper.cs
- SpinLock.cs
- Publisher.cs
- ProcessInputEventArgs.cs
- DataPagerFieldCollection.cs
- Internal.cs
- CatalogZone.cs
- TransactionWaitAsyncResult.cs
- ScaleTransform3D.cs
- SafeArchiveContext.cs
- ManifestSignatureInformation.cs
- TableItemPatternIdentifiers.cs
- StorageEndPropertyMapping.cs
- ValueOfAction.cs
- BitHelper.cs
- IPAddress.cs
- WebSysDefaultValueAttribute.cs
- messageonlyhwndwrapper.cs
- AvtEvent.cs