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
- ChannelPool.cs
- FieldDescriptor.cs
- ComponentDispatcherThread.cs
- Dictionary.cs
- SslStream.cs
- TextBox.cs
- RepeaterItem.cs
- Nodes.cs
- DetailsViewDeleteEventArgs.cs
- ViewStateException.cs
- ServiceModelExtensionElement.cs
- ColorConvertedBitmap.cs
- TypeDependencyAttribute.cs
- ProcessStartInfo.cs
- HttpContextWrapper.cs
- IDataContractSurrogate.cs
- EntityContainerEmitter.cs
- ChangePassword.cs
- OdbcConnection.cs
- EntityObject.cs
- ContentTypeSettingDispatchMessageFormatter.cs
- Token.cs
- COAUTHIDENTITY.cs
- ContextStaticAttribute.cs
- StringConcat.cs
- Soap12ProtocolImporter.cs
- TaskFileService.cs
- SchemaNamespaceManager.cs
- ConsoleEntryPoint.cs
- PrintPageEvent.cs
- Stack.cs
- TableParagraph.cs
- ChangeProcessor.cs
- SimpleLine.cs
- VirtualizedCellInfoCollection.cs
- IgnoreDataMemberAttribute.cs
- AttributeEmitter.cs
- DataGridViewMethods.cs
- XmlBinaryReaderSession.cs
- Int64KeyFrameCollection.cs
- TreeNodeMouseHoverEvent.cs
- Convert.cs
- SqlConnection.cs
- safemediahandle.cs
- ViewBox.cs
- PersonalizationEntry.cs
- IntSecurity.cs
- XmlEntity.cs
- SystemResourceKey.cs
- RegexStringValidator.cs
- SecureUICommand.cs
- ReverseQueryOperator.cs
- bindurihelper.cs
- XsltArgumentList.cs
- XsltSettings.cs
- CommandManager.cs
- XmlDataCollection.cs
- sqlser.cs
- Win32Native.cs
- PageCatalogPartDesigner.cs
- Unit.cs
- SessionState.cs
- OrderingInfo.cs
- DataTableReader.cs
- EventWaitHandleSecurity.cs
- TransformCollection.cs
- TogglePattern.cs
- XPathBinder.cs
- ObjectStateFormatter.cs
- MimeTypePropertyAttribute.cs
- SqlRowUpdatedEvent.cs
- EntityConnection.cs
- CollectionsUtil.cs
- GenericIdentity.cs
- HttpCacheParams.cs
- EditorPartCollection.cs
- SafeBitVector32.cs
- ScrollData.cs
- BulletChrome.cs
- precedingsibling.cs
- ProfileInfo.cs
- RuntimeConfigLKG.cs
- RuleRef.cs
- ZipIOLocalFileHeader.cs
- UMPAttributes.cs
- IsolatedStorage.cs
- SizeLimitedCache.cs
- XpsResourceDictionary.cs
- DesignerInterfaces.cs
- DescriptionCreator.cs
- StyleXamlParser.cs
- StateInitialization.cs
- Transform3D.cs
- RedBlackList.cs
- FixedTextBuilder.cs
- DataGridColumnEventArgs.cs
- FusionWrap.cs
- ScriptRef.cs
- Util.cs
- LoginName.cs