Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- SelectionItemPattern.cs
- KoreanLunisolarCalendar.cs
- TableLayoutPanelCellPosition.cs
- CharUnicodeInfo.cs
- XPathNodeInfoAtom.cs
- CookieProtection.cs
- ReaderWriterLock.cs
- HttpRequest.cs
- SQLByteStorage.cs
- SettingsPropertyWrongTypeException.cs
- MemberDescriptor.cs
- EntityContainerEmitter.cs
- RequestStatusBarUpdateEventArgs.cs
- keycontainerpermission.cs
- DataGridViewColumn.cs
- DocumentViewerConstants.cs
- HttpProfileGroupBase.cs
- Transform.cs
- DbDeleteCommandTree.cs
- PhoneCallDesigner.cs
- SqlAliasesReferenced.cs
- RightsManagementResourceHelper.cs
- DataGridViewRowCollection.cs
- ElementAtQueryOperator.cs
- XamlRtfConverter.cs
- DependencyPropertyDescriptor.cs
- SqlUserDefinedAggregateAttribute.cs
- DataBindingCollection.cs
- ColorAnimationBase.cs
- SequentialWorkflowRootDesigner.cs
- SizeIndependentAnimationStorage.cs
- SimpleHandlerFactory.cs
- OutputCache.cs
- AuthenticationServiceManager.cs
- MLangCodePageEncoding.cs
- BatchParser.cs
- Array.cs
- DetailsViewRowCollection.cs
- PeerPresenceInfo.cs
- WebControlAdapter.cs
- SHA256.cs
- OleStrCAMarshaler.cs
- ActivityLocationReferenceEnvironment.cs
- WebPartsSection.cs
- QilLoop.cs
- SetterBaseCollection.cs
- KeyInfo.cs
- VerbConverter.cs
- ListenDesigner.cs
- WebBrowserEvent.cs
- MarkedHighlightComponent.cs
- WebEventCodes.cs
- AssemblyInfo.cs
- WebPartEventArgs.cs
- SqlDependency.cs
- LocalFileSettingsProvider.cs
- BuildManager.cs
- TargetControlTypeAttribute.cs
- Base64Encoding.cs
- XpsFilter.cs
- DiagnosticTrace.cs
- SiteMapNodeCollection.cs
- ClientSettingsSection.cs
- LogEntryDeserializer.cs
- RtType.cs
- Calendar.cs
- SQlBooleanStorage.cs
- SQLInt32.cs
- NativeMethods.cs
- SchemaImporter.cs
- LinkLabel.cs
- SecuritySessionServerSettings.cs
- LocatorManager.cs
- Stroke2.cs
- XmlSchemaSubstitutionGroup.cs
- PasswordBox.cs
- MessageQueuePermissionAttribute.cs
- ObjectViewQueryResultData.cs
- FilterQueryOptionExpression.cs
- View.cs
- ClientScriptManagerWrapper.cs
- DbgUtil.cs
- ActiveDocumentEvent.cs
- XmlSchemaAppInfo.cs
- DetailsViewRowCollection.cs
- GlobalizationSection.cs
- MinimizableAttributeTypeConverter.cs
- CommonDialog.cs
- ResourceSet.cs
- DbMetaDataFactory.cs
- Hashtable.cs
- SystemIcmpV4Statistics.cs
- BuildManager.cs
- PropertyDescriptor.cs
- ControlEvent.cs
- TrackingProfileCache.cs
- FilteredXmlReader.cs
- DoubleAnimationClockResource.cs
- MoveSizeWinEventHandler.cs
- ConfigurationManagerHelper.cs