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
- List.cs
- TextBox.cs
- BitmapEffect.cs
- CodeNamespaceImportCollection.cs
- ConvertEvent.cs
- Html32TextWriter.cs
- NotSupportedException.cs
- SharedStatics.cs
- ADMembershipProvider.cs
- DbConnectionStringBuilder.cs
- CompoundFileIOPermission.cs
- CompilationUtil.cs
- DesignerOptionService.cs
- DataServiceQueryProvider.cs
- PrintDialog.cs
- SettingsContext.cs
- IntegerCollectionEditor.cs
- ScriptManagerProxy.cs
- newinstructionaction.cs
- UnrecognizedAssertionsBindingElement.cs
- TemplateXamlParser.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- QueryAccessibilityHelpEvent.cs
- FocusChangedEventArgs.cs
- DynamicMethod.cs
- FtpRequestCacheValidator.cs
- RecipientIdentity.cs
- EventLog.cs
- ComponentGlyph.cs
- SimpleWebHandlerParser.cs
- WebPartHelpVerb.cs
- RequestQueue.cs
- SequentialWorkflowRootDesigner.cs
- BitmapEffectState.cs
- StreamReader.cs
- StringOutput.cs
- BrowserCapabilitiesFactory.cs
- FunctionParameter.cs
- GlobalId.cs
- TypeUsage.cs
- ContentOnlyMessage.cs
- SafeMarshalContext.cs
- WebBrowserDesigner.cs
- TiffBitmapEncoder.cs
- PrintController.cs
- QilExpression.cs
- InternalReceiveMessage.cs
- ViewGenResults.cs
- ProcessModelInfo.cs
- ServiceObjectContainer.cs
- TimeSpanValidatorAttribute.cs
- ChangeBlockUndoRecord.cs
- Vector3D.cs
- X509WindowsSecurityToken.cs
- SecurityUtils.cs
- WebRequestModuleElementCollection.cs
- Subset.cs
- ExportFileRequest.cs
- FrameworkPropertyMetadata.cs
- UntrustedRecipientException.cs
- BrowserCapabilitiesCompiler.cs
- GatewayIPAddressInformationCollection.cs
- NotifyIcon.cs
- XmlHierarchicalEnumerable.cs
- SystemUnicastIPAddressInformation.cs
- TrackBar.cs
- OleDbError.cs
- Pipe.cs
- BamlRecordReader.cs
- ListSourceHelper.cs
- FocusTracker.cs
- BitmapSizeOptions.cs
- QilInvoke.cs
- AccessKeyManager.cs
- SecurityTokenTypes.cs
- LocatorBase.cs
- TimerElapsedEvenArgs.cs
- XmlWriter.cs
- TypeDescriptor.cs
- UpdatePanelTriggerCollection.cs
- BlobPersonalizationState.cs
- XmlAnyElementAttributes.cs
- CaseInsensitiveOrdinalStringComparer.cs
- GlobalEventManager.cs
- DocumentPageHost.cs
- TypeConverterHelper.cs
- XslTransform.cs
- FormsAuthenticationUser.cs
- XmlSiteMapProvider.cs
- SplitterEvent.cs
- TileBrush.cs
- XmlUrlResolver.cs
- FusionWrap.cs
- ProxyWebPartConnectionCollection.cs
- XmlValueConverter.cs
- ComponentFactoryHelpers.cs
- CompilerErrorCollection.cs
- SystemMulticastIPAddressInformation.cs
- SevenBitStream.cs
- ColorConvertedBitmapExtension.cs