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
- TypeSource.cs
- HttpApplication.cs
- PropertyTab.cs
- InteropAutomationProvider.cs
- CompositeCollectionView.cs
- CharStorage.cs
- ColorBlend.cs
- IndexedEnumerable.cs
- XsdDateTime.cs
- RegistrySecurity.cs
- DependencyPropertyHelper.cs
- BufferedWebEventProvider.cs
- DirectoryNotFoundException.cs
- PreviewKeyDownEventArgs.cs
- DbDataRecord.cs
- ModifierKeysValueSerializer.cs
- GridViewAutoFormat.cs
- QueryCacheEntry.cs
- DocumentViewer.cs
- EntryIndex.cs
- CharacterBufferReference.cs
- Directory.cs
- RenderTargetBitmap.cs
- EventMappingSettingsCollection.cs
- DesignerActionItemCollection.cs
- MimeAnyImporter.cs
- RepeaterDataBoundAdapter.cs
- StorageTypeMapping.cs
- XmlEncoding.cs
- BitmapEffectRenderDataResource.cs
- dataobject.cs
- SystemIcmpV6Statistics.cs
- GeneralTransformCollection.cs
- TimeZone.cs
- TemplateComponentConnector.cs
- odbcmetadatafactory.cs
- DefaultParameterValueAttribute.cs
- MouseButton.cs
- HeaderedContentControl.cs
- WmpBitmapDecoder.cs
- ToolStripScrollButton.cs
- AsnEncodedData.cs
- SBCSCodePageEncoding.cs
- Stack.cs
- QilValidationVisitor.cs
- SynchronizedInputPattern.cs
- PropertyPath.cs
- ReadOnlyTernaryTree.cs
- XamlFilter.cs
- TypeToken.cs
- SingleConverter.cs
- AppLevelCompilationSectionCache.cs
- Mappings.cs
- OleStrCAMarshaler.cs
- RbTree.cs
- ItemMap.cs
- MetadataUtilsSmi.cs
- AssemblyResourceLoader.cs
- WindowsButton.cs
- BindingNavigator.cs
- VariableBinder.cs
- SelectionRange.cs
- CellTreeNodeVisitors.cs
- DataComponentGenerator.cs
- ArraySegment.cs
- Point.cs
- IdnMapping.cs
- ControlBuilderAttribute.cs
- DesignOnlyAttribute.cs
- KeyPressEvent.cs
- AnnotationAuthorChangedEventArgs.cs
- MonthCalendar.cs
- DataReaderContainer.cs
- TdsParameterSetter.cs
- SecurityContextTokenCache.cs
- ResourceManager.cs
- HttpBrowserCapabilitiesWrapper.cs
- ManagedWndProcTracker.cs
- ListViewItemMouseHoverEvent.cs
- DBCommand.cs
- DragCompletedEventArgs.cs
- DataRowComparer.cs
- FunctionCommandText.cs
- PingOptions.cs
- SQLByteStorage.cs
- EntityModelBuildProvider.cs
- ProtocolsSection.cs
- State.cs
- Profiler.cs
- X509Utils.cs
- ForEachAction.cs
- DllNotFoundException.cs
- PingOptions.cs
- XmlDataSourceNodeDescriptor.cs
- DesignTimeValidationFeature.cs
- Errors.cs
- StateElementCollection.cs
- ResourceType.cs
- ArgumentNullException.cs
- DataControlButton.cs