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
- DrawingState.cs
- basenumberconverter.cs
- CompareValidator.cs
- DurableInstance.cs
- FtpCachePolicyElement.cs
- TextCompositionManager.cs
- Vector3DCollectionConverter.cs
- RTLAwareMessageBox.cs
- ExternalFile.cs
- ActionItem.cs
- ListSortDescription.cs
- XsdDataContractExporter.cs
- Stack.cs
- Random.cs
- SplineQuaternionKeyFrame.cs
- CLSCompliantAttribute.cs
- ConnectionManagementElementCollection.cs
- GlyphRun.cs
- FilterEventArgs.cs
- VBCodeProvider.cs
- ExceptionRoutedEventArgs.cs
- IndentedWriter.cs
- BufferBuilder.cs
- PrintControllerWithStatusDialog.cs
- GifBitmapDecoder.cs
- Terminate.cs
- DefaultProfileManager.cs
- WebPermission.cs
- SHA384Managed.cs
- OutputCacheSettingsSection.cs
- XmlQueryCardinality.cs
- Accessors.cs
- RotateTransform3D.cs
- DirtyTextRange.cs
- BindingGroup.cs
- DrawingDrawingContext.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- PermissionRequestEvidence.cs
- TransactionScopeDesigner.cs
- Identity.cs
- WindowsGrip.cs
- TemplateBamlRecordReader.cs
- CharacterShapingProperties.cs
- LinqTreeNodeEvaluator.cs
- InheritablePropertyChangeInfo.cs
- TextOutput.cs
- ToolStripRenderer.cs
- DbConnectionHelper.cs
- BitmapEffectCollection.cs
- JsonReaderDelegator.cs
- SchemaTypeEmitter.cs
- BitmapSizeOptions.cs
- XmlSiteMapProvider.cs
- SchemaNamespaceManager.cs
- XsltContext.cs
- ContentControl.cs
- MapPathBasedVirtualPathProvider.cs
- ComMethodElement.cs
- BamlTreeMap.cs
- TextLineBreak.cs
- DecimalConstantAttribute.cs
- Pkcs9Attribute.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- UTF32Encoding.cs
- FixedMaxHeap.cs
- DataServiceRequest.cs
- ArgumentOutOfRangeException.cs
- SectionXmlInfo.cs
- SecurityHeaderLayout.cs
- xmlfixedPageInfo.cs
- ArrayConverter.cs
- SslStreamSecurityElement.cs
- RangeBaseAutomationPeer.cs
- XPathNode.cs
- TemplateManager.cs
- ObjectQuery_EntitySqlExtensions.cs
- HyperLinkColumn.cs
- XmlNodeChangedEventManager.cs
- ConsoleKeyInfo.cs
- WebPageTraceListener.cs
- InternalConfigConfigurationFactory.cs
- LoadGrammarCompletedEventArgs.cs
- ETagAttribute.cs
- RoutedUICommand.cs
- DrawingServices.cs
- DesignerActionList.cs
- MetaModel.cs
- TextReader.cs
- AbstractExpressions.cs
- Variable.cs
- CollectionChangedEventManager.cs
- CapabilitiesSection.cs
- PrintEvent.cs
- ValueOfAction.cs
- CodeDelegateCreateExpression.cs
- StateElementCollection.cs
- ZipIOCentralDirectoryBlock.cs
- ToolStripStatusLabel.cs
- DataStreamFromComStream.cs
- _CommandStream.cs