Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Monitoring / system / Diagnosticts / EventData.cs / 1305376 / 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
- Literal.cs
- AdPostCacheSubstitution.cs
- MultiView.cs
- AutoCompleteStringCollection.cs
- FileAuthorizationModule.cs
- Claim.cs
- VirtualDirectoryMappingCollection.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- InstallerTypeAttribute.cs
- HttpModuleAction.cs
- WindowHideOrCloseTracker.cs
- ContentType.cs
- ReadOnlyHierarchicalDataSource.cs
- BitmapVisualManager.cs
- InstancePersistenceException.cs
- DetailsViewUpdateEventArgs.cs
- XmlSchemaException.cs
- GridViewUpdatedEventArgs.cs
- EntityStoreSchemaFilterEntry.cs
- PathFigureCollectionConverter.cs
- PathSegmentCollection.cs
- MessageDecoder.cs
- SplitContainerDesigner.cs
- SmtpMail.cs
- HtmlToClrEventProxy.cs
- TextElementCollectionHelper.cs
- TextElementCollection.cs
- TemplateParser.cs
- _SpnDictionary.cs
- CodeAttributeArgument.cs
- DtdParser.cs
- ModuleElement.cs
- ClassHandlersStore.cs
- MimeFormatExtensions.cs
- CodeTypeDelegate.cs
- IgnoreFileBuildProvider.cs
- PanelStyle.cs
- ItemsControlAutomationPeer.cs
- WebPartAuthorizationEventArgs.cs
- TemplateBamlRecordReader.cs
- XPathCompileException.cs
- XmlNamespaceMappingCollection.cs
- SmiXetterAccessMap.cs
- TextRenderer.cs
- ResourceDescriptionAttribute.cs
- ListSortDescriptionCollection.cs
- UseManagedPresentationBindingElement.cs
- PolyBezierSegment.cs
- DataServiceContext.cs
- DirectionalLight.cs
- JsonStringDataContract.cs
- DateTimeEditor.cs
- DependencyObjectType.cs
- WebServicesSection.cs
- OneToOneMappingSerializer.cs
- ClientScriptItemCollection.cs
- EmptyQuery.cs
- OleDbInfoMessageEvent.cs
- PackageController.cs
- ServerValidateEventArgs.cs
- XmlAttributes.cs
- StyleSheetDesigner.cs
- SecurityUtils.cs
- PropertyDescriptorComparer.cs
- RelationshipConverter.cs
- CheckBoxList.cs
- LockCookie.cs
- CustomExpressionEventArgs.cs
- Pair.cs
- GroupDescription.cs
- TraceData.cs
- BackgroundFormatInfo.cs
- PasswordRecovery.cs
- ToolStripTextBox.cs
- IndentTextWriter.cs
- FileDetails.cs
- ToolStrip.cs
- DetailsViewUpdatedEventArgs.cs
- SqlRewriteScalarSubqueries.cs
- ReservationNotFoundException.cs
- PathSegmentCollection.cs
- RectAnimationBase.cs
- GatewayDefinition.cs
- MatrixCamera.cs
- CompensationTokenData.cs
- ConfigurationSection.cs
- SafeRightsManagementQueryHandle.cs
- Token.cs
- unsafenativemethodsother.cs
- RuntimeConfigLKG.cs
- ProcessThreadCollection.cs
- HtmlHead.cs
- WindowsListViewSubItem.cs
- Icon.cs
- ParameterCollection.cs
- CriticalFinalizerObject.cs
- NamespaceList.cs
- ValueTypeFixupInfo.cs
- Byte.cs
- WebPartConnectionsConfigureVerb.cs