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
- AnnotationHelper.cs
- SqlMetaData.cs
- EdgeProfileValidation.cs
- CacheSection.cs
- DataContractJsonSerializer.cs
- GeneratedCodeAttribute.cs
- SmtpNegotiateAuthenticationModule.cs
- CompilationRelaxations.cs
- PixelShader.cs
- DrawingContextDrawingContextWalker.cs
- CodeDefaultValueExpression.cs
- NativeMethods.cs
- DesignParameter.cs
- HttpRequestCacheValidator.cs
- RuntimeHelpers.cs
- OracleException.cs
- HttpWrapper.cs
- PasswordDeriveBytes.cs
- AuthorizationRule.cs
- Conditional.cs
- LightweightCodeGenerator.cs
- TextBox.cs
- LogExtentCollection.cs
- ImageList.cs
- StructuredTypeEmitter.cs
- VirtualDirectoryMappingCollection.cs
- Visual3D.cs
- DoubleLink.cs
- Thread.cs
- RichTextBoxContextMenu.cs
- TableLayoutSettings.cs
- XamlFrame.cs
- ActivityCollectionMarkupSerializer.cs
- SynchronizationFilter.cs
- FrameworkElement.cs
- ExpressionBindings.cs
- MapPathBasedVirtualPathProvider.cs
- Int32CAMarshaler.cs
- CachedBitmap.cs
- PeerDuplexChannelListener.cs
- DragEventArgs.cs
- InvalidComObjectException.cs
- ReflectionPermission.cs
- ConstraintManager.cs
- TreeSet.cs
- CSharpCodeProvider.cs
- TraceUtility.cs
- Literal.cs
- SmiEventSink_Default.cs
- DataControlPagerLinkButton.cs
- Win32NamedPipes.cs
- SmtpMail.cs
- VideoDrawing.cs
- UserUseLicenseDictionaryLoader.cs
- ipaddressinformationcollection.cs
- HitTestParameters3D.cs
- AnnotationStore.cs
- OleDbFactory.cs
- TableLayoutSettingsTypeConverter.cs
- ellipse.cs
- TempEnvironment.cs
- _NegoStream.cs
- StructuralType.cs
- cryptoapiTransform.cs
- WindowsScroll.cs
- TreeNodeBinding.cs
- ButtonField.cs
- UIElement.cs
- SecurityTokenProvider.cs
- Assembly.cs
- CacheSection.cs
- VisualStyleElement.cs
- GridViewRowPresenterBase.cs
- ColumnWidthChangedEvent.cs
- CellTreeNode.cs
- ResourceContainer.cs
- WebPartCloseVerb.cs
- System.Data.OracleClient_BID.cs
- OdbcConnectionOpen.cs
- RSAOAEPKeyExchangeDeformatter.cs
- SamlAudienceRestrictionCondition.cs
- RowBinding.cs
- HostedTransportConfigurationBase.cs
- PropertyDescriptor.cs
- DataGridViewColumnCollection.cs
- RoutedCommand.cs
- TextComposition.cs
- PersonalizationDictionary.cs
- CfgSemanticTag.cs
- IPeerNeighbor.cs
- CodeDirectoryCompiler.cs
- MultiBindingExpression.cs
- ISAPIWorkerRequest.cs
- SqlDataSourceSelectingEventArgs.cs
- TypeUtil.cs
- ColumnCollection.cs
- _ChunkParse.cs
- DataServiceProviderWrapper.cs
- ConfigurationFileMap.cs
- StreamInfo.cs