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
- SamlAction.cs
- ListViewDeleteEventArgs.cs
- DataGridViewTextBoxEditingControl.cs
- ToolBarTray.cs
- ExceptionList.cs
- IntSecurity.cs
- SpellerStatusTable.cs
- TextProperties.cs
- IResourceProvider.cs
- SamlAction.cs
- CqlErrorHelper.cs
- GridViewUpdateEventArgs.cs
- XmlSchemaSimpleType.cs
- TextCompositionEventArgs.cs
- RowsCopiedEventArgs.cs
- RandomDelayQueuedSendsAsyncResult.cs
- Geometry.cs
- ConsoleKeyInfo.cs
- DataRowView.cs
- InertiaRotationBehavior.cs
- DocumentOrderQuery.cs
- StackOverflowException.cs
- CalendarDateChangedEventArgs.cs
- PropertyChangingEventArgs.cs
- HeaderedContentControl.cs
- PasswordDeriveBytes.cs
- Path.cs
- ToolStripItemImageRenderEventArgs.cs
- DesignerDataSourceView.cs
- SqlDataSourceEnumerator.cs
- TreeNodeBindingCollection.cs
- RecognizedAudio.cs
- ParamArrayAttribute.cs
- BatchWriter.cs
- DateTimePicker.cs
- InkCanvasInnerCanvas.cs
- TemplateInstanceAttribute.cs
- TypeSystem.cs
- XmlResolver.cs
- StandardBindingCollectionElement.cs
- LessThan.cs
- TextBounds.cs
- LayoutEngine.cs
- OleDbRowUpdatedEvent.cs
- DataGridHeaderBorder.cs
- InterleavedZipPartStream.cs
- BaseParaClient.cs
- webproxy.cs
- Byte.cs
- ClientClassGenerator.cs
- ZipFileInfoCollection.cs
- ByteFacetDescriptionElement.cs
- EnumBuilder.cs
- BaseParser.cs
- AvTrace.cs
- WebPartVerbsEventArgs.cs
- SQLGuidStorage.cs
- FilteredDataSetHelper.cs
- MaskInputRejectedEventArgs.cs
- XmlCharCheckingWriter.cs
- Point3DCollectionValueSerializer.cs
- HebrewCalendar.cs
- LineMetrics.cs
- SimpleMailWebEventProvider.cs
- WindowsGrip.cs
- AuthenticatingEventArgs.cs
- DebugInfoGenerator.cs
- HyperLink.cs
- DataGridHeaderBorder.cs
- BaseAppDomainProtocolHandler.cs
- BinaryObjectInfo.cs
- GuidelineSet.cs
- RegistryConfigurationProvider.cs
- BitArray.cs
- Tuple.cs
- EntityProviderFactory.cs
- DataRecord.cs
- BatchServiceHost.cs
- VirtualPath.cs
- Deflater.cs
- CancelRequestedQuery.cs
- HtmlControl.cs
- SqlDataSourceAdvancedOptionsForm.cs
- SerializationAttributes.cs
- LabelAutomationPeer.cs
- ClearCollection.cs
- Pkcs9Attribute.cs
- QilDataSource.cs
- SecurityState.cs
- ClientRuntimeConfig.cs
- oledbmetadatacollectionnames.cs
- DictionaryContent.cs
- SessionStateUtil.cs
- PrtTicket_Editor.cs
- WebPartTransformerCollection.cs
- LinqDataSourceValidationException.cs
- WorkflowTimerService.cs
- PlanCompiler.cs
- ReflectEventDescriptor.cs
- PassportAuthenticationModule.cs