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
- FindProgressChangedEventArgs.cs
- SoapMessage.cs
- AppSettingsSection.cs
- PointUtil.cs
- ParsedRoute.cs
- WindowsTokenRoleProvider.cs
- SeekStoryboard.cs
- VirtualPath.cs
- AttachedAnnotationChangedEventArgs.cs
- IndentTextWriter.cs
- BrushConverter.cs
- RSAPKCS1SignatureDeformatter.cs
- SAPIEngineTypes.cs
- DataSourceControl.cs
- XmlReflectionImporter.cs
- AttachedAnnotationChangedEventArgs.cs
- Errors.cs
- SafeMILHandleMemoryPressure.cs
- FormsAuthenticationEventArgs.cs
- RolePrincipal.cs
- UIElement.cs
- Claim.cs
- thaishape.cs
- BinaryMessageFormatter.cs
- SmiRequestExecutor.cs
- HtmlInputText.cs
- GCHandleCookieTable.cs
- ImportContext.cs
- ContainerUIElement3D.cs
- GenericsInstances.cs
- NumericExpr.cs
- HttpVersion.cs
- XmlIlVisitor.cs
- ServerValidateEventArgs.cs
- HitTestWithPointDrawingContextWalker.cs
- DelegateBodyWriter.cs
- ApplicationServicesHostFactory.cs
- IssuedSecurityTokenProvider.cs
- WorkflowTerminatedException.cs
- AppDomainInfo.cs
- IOException.cs
- ToolBarPanel.cs
- RandomNumberGenerator.cs
- DbConnectionPoolGroupProviderInfo.cs
- DataGridTableStyleMappingNameEditor.cs
- MultipartContentParser.cs
- RelativeSource.cs
- BinHexEncoder.cs
- PartialTrustVisibleAssembly.cs
- RenderingBiasValidation.cs
- ListView.cs
- ObjRef.cs
- RuntimeWrappedException.cs
- HybridObjectCache.cs
- MessageDescription.cs
- ControlOperationInvoker.cs
- TimeSpanStorage.cs
- WebServiceClientProxyGenerator.cs
- TextTreeDeleteContentUndoUnit.cs
- StateWorkerRequest.cs
- UdpSocketReceiveManager.cs
- HebrewNumber.cs
- Control.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- AssociationSet.cs
- CheckBoxAutomationPeer.cs
- DomainUpDown.cs
- LiteralText.cs
- PreviewKeyDownEventArgs.cs
- XmlHierarchyData.cs
- OpCodes.cs
- FrameworkTemplate.cs
- MachineKey.cs
- WinFormsUtils.cs
- CompilationLock.cs
- RankException.cs
- SystemInformation.cs
- GroupByExpressionRewriter.cs
- OutputCacheProfile.cs
- TableItemPattern.cs
- ConfigPathUtility.cs
- SrgsGrammarCompiler.cs
- Point3D.cs
- SoapEnumAttribute.cs
- WebPartExportVerb.cs
- XmlAttributeHolder.cs
- VScrollProperties.cs
- ModelVisual3D.cs
- XPathScanner.cs
- DbConnectionStringBuilder.cs
- EntityTypeBase.cs
- TextTreePropertyUndoUnit.cs
- MediaContext.cs
- Context.cs
- DataGridViewCell.cs
- CalendarModeChangedEventArgs.cs
- DataGridColumnFloatingHeader.cs
- PasswordBox.cs
- HttpRawResponse.cs
- ListControlBoundActionList.cs