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
- ThreadInterruptedException.cs
- CategoryAttribute.cs
- CookieHandler.cs
- TableLayoutSettingsTypeConverter.cs
- PointKeyFrameCollection.cs
- TextCompositionEventArgs.cs
- ScriptControl.cs
- DataGridRowDetailsEventArgs.cs
- LambdaCompiler.Lambda.cs
- HierarchicalDataSourceControl.cs
- EastAsianLunisolarCalendar.cs
- CheckPair.cs
- RecognitionResult.cs
- XmlSignatureProperties.cs
- MetadataArtifactLoaderFile.cs
- OracleColumn.cs
- Attribute.cs
- Composition.cs
- RsaEndpointIdentity.cs
- TextHidden.cs
- CacheAxisQuery.cs
- PlacementWorkspace.cs
- MessageBuffer.cs
- SqlMetaData.cs
- TransformDescriptor.cs
- KeyTime.cs
- ButtonBaseAdapter.cs
- InternalsVisibleToAttribute.cs
- SystemPens.cs
- WizardPanel.cs
- InputLanguage.cs
- designeractionlistschangedeventargs.cs
- MetadataArtifactLoaderResource.cs
- ProcessModuleCollection.cs
- ReadOnlyActivityGlyph.cs
- DataGrid.cs
- StandardCommands.cs
- SchemaElement.cs
- DoWorkEventArgs.cs
- _NegoState.cs
- BuiltInPermissionSets.cs
- MouseBinding.cs
- CapabilitiesAssignment.cs
- DataPagerFieldCommandEventArgs.cs
- MenuItemBindingCollection.cs
- FormViewUpdatedEventArgs.cs
- SystemBrushes.cs
- SafeBitVector32.cs
- NavigationWindowAutomationPeer.cs
- GeneralTransform.cs
- SBCSCodePageEncoding.cs
- XmlSchemaExporter.cs
- SplitterDesigner.cs
- ComponentConverter.cs
- CodeCommentStatement.cs
- RawStylusInputCustomDataList.cs
- UnmanagedMemoryStream.cs
- DescendantBaseQuery.cs
- LiteralControl.cs
- FixedSOMElement.cs
- StringInfo.cs
- ItemContainerPattern.cs
- ResourceWriter.cs
- VerificationAttribute.cs
- DataPagerFieldItem.cs
- BitmapMetadataEnumerator.cs
- Sql8ExpressionRewriter.cs
- DialogWindow.cs
- MailWriter.cs
- DesignerCategoryAttribute.cs
- PipelineModuleStepContainer.cs
- NoPersistScope.cs
- RawContentTypeMapper.cs
- SecurityPermission.cs
- _BufferOffsetSize.cs
- MediaContext.cs
- HostedElements.cs
- RadioButtonFlatAdapter.cs
- FakeModelPropertyImpl.cs
- BitmapScalingModeValidation.cs
- EntityDataSourceReferenceGroup.cs
- FormViewPagerRow.cs
- FusionWrap.cs
- DependencyProperty.cs
- RootBuilder.cs
- ListSourceHelper.cs
- BaseParser.cs
- Buffer.cs
- BrowserCapabilitiesFactoryBase.cs
- Attributes.cs
- TextBlockAutomationPeer.cs
- cookie.cs
- Rect3DValueSerializer.cs
- ValidationPropertyAttribute.cs
- And.cs
- EventMappingSettingsCollection.cs
- UnsafeNativeMethods.cs
- MinimizableAttributeTypeConverter.cs
- SubMenuStyleCollection.cs
- filewebrequest.cs