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
- Vector3DCollection.cs
- ModuleElement.cs
- XamlWriter.cs
- XPathDocument.cs
- HttpApplication.cs
- NativeActivityMetadata.cs
- WinEventQueueItem.cs
- AccessibleObject.cs
- DependencyPropertyKind.cs
- UnsafeNativeMethods.cs
- PageThemeCodeDomTreeGenerator.cs
- Brushes.cs
- AsyncPostBackTrigger.cs
- ClientScriptManagerWrapper.cs
- ExecutionPropertyManager.cs
- AuthorizationSection.cs
- QilTypeChecker.cs
- UncommonField.cs
- ModelUIElement3D.cs
- ResXDataNode.cs
- HasCopySemanticsAttribute.cs
- CodeDirectionExpression.cs
- DbDataReader.cs
- AuthenticationModulesSection.cs
- sortedlist.cs
- TypeRefElement.cs
- StateDesigner.cs
- CharacterBuffer.cs
- Activator.cs
- FixedLineResult.cs
- ProtocolsConfigurationEntry.cs
- CounterSetInstance.cs
- DateTimeConstantAttribute.cs
- PixelShader.cs
- VScrollBar.cs
- MemberAccessException.cs
- UiaCoreProviderApi.cs
- GenericIdentity.cs
- WebScriptMetadataMessage.cs
- HtmlHead.cs
- WebPartChrome.cs
- EncodingInfo.cs
- KernelTypeValidation.cs
- LineInfo.cs
- PagePropertiesChangingEventArgs.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- TextElementCollectionHelper.cs
- SecurityListenerSettingsLifetimeManager.cs
- Marshal.cs
- ReachSerializationCacheItems.cs
- sqlstateclientmanager.cs
- AnnotationResourceCollection.cs
- CryptoStream.cs
- NestPullup.cs
- SizeAnimationClockResource.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- WizardSideBarListControlItem.cs
- XMLUtil.cs
- ClientSettings.cs
- DataGridViewRowEventArgs.cs
- XmlSchemaProviderAttribute.cs
- UriTemplateHelpers.cs
- TextSelectionHighlightLayer.cs
- FileStream.cs
- ProxyElement.cs
- DrawingContextWalker.cs
- DispatchChannelSink.cs
- CachedPathData.cs
- ImageButton.cs
- StoreAnnotationsMap.cs
- ConcurrentDictionary.cs
- ParserStreamGeometryContext.cs
- DoubleMinMaxAggregationOperator.cs
- newinstructionaction.cs
- HebrewCalendar.cs
- MatrixStack.cs
- DynamicQueryableWrapper.cs
- ImageDrawing.cs
- TreeViewImageGenerator.cs
- HwndStylusInputProvider.cs
- _AutoWebProxyScriptWrapper.cs
- InvokeHandlers.cs
- storepermission.cs
- CacheMemory.cs
- XsltContext.cs
- CapiSymmetricAlgorithm.cs
- ArgumentOutOfRangeException.cs
- CounterSampleCalculator.cs
- UriTemplateLiteralPathSegment.cs
- ObjectConverter.cs
- JapaneseLunisolarCalendar.cs
- HostingEnvironment.cs
- _SslState.cs
- Vector3DCollection.cs
- StrongNameMembershipCondition.cs
- SiteMapDataSource.cs
- CompositeDispatchFormatter.cs
- DBConnection.cs
- SessionSwitchEventArgs.cs
- DataGridViewCellStyleEditor.cs