Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Tracking / TrackingRecord.cs / 1305376 / TrackingRecord.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.Tracking { using System; using System.Runtime; using System.Runtime.Serialization; using System.Diagnostics; using System.Collections.Generic; using System.Globalization; [Fx.Tag.XamlVisible(false)] [DataContract] public abstract class TrackingRecord { [DataMember(EmitDefaultValue = false)] IDictionaryannotations; static ReadOnlyDictionary readonlyEmptyAnnotations; protected TrackingRecord(Guid instanceId) { this.InstanceId = instanceId; this.EventTime = DateTime.UtcNow; this.Level = TraceLevel.Info; } protected TrackingRecord(Guid instanceId, long recordNumber) : this(instanceId) { this.RecordNumber = recordNumber; } protected TrackingRecord(TrackingRecord record) { this.InstanceId = record.InstanceId; this.RecordNumber = record.RecordNumber; this.EventTime = record.EventTime; this.Level = record.Level; if (record.HasAnnotations) { this.annotations = new ReadOnlyDictionary (record.annotations); } } [DataMember] public Guid InstanceId { get; internal set; } [DataMember] public long RecordNumber { get; internal set; } [DataMember] public DateTime EventTime { get; private set; } [DataMember] public TraceLevel Level { get; protected set; } public IDictionary Annotations { get { if (this.annotations == null) { this.annotations = ReadOnlyEmptyAnnotations; } return this.annotations; } internal set { Fx.Assert(value.IsReadOnly, "only readonly dictionary can be set for annotations"); this.annotations = value; } } static ReadOnlyDictionary ReadOnlyEmptyAnnotations { get { if (readonlyEmptyAnnotations == null) { readonlyEmptyAnnotations = new ReadOnlyDictionary (new Dictionary (0)); } return readonlyEmptyAnnotations; } } internal bool HasAnnotations { get { return (this.annotations != null && this.annotations.Count > 0); } } protected abstract internal TrackingRecord Clone(); public override string ToString() { return string.Format(CultureInfo.CurrentCulture, "InstanceId = {0}, RecordNumber = {1}, EventTime = {2}", this.InstanceId, this.RecordNumber, this.EventTime); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MimeMapping.cs
- MemberAccessException.cs
- LiteralControl.cs
- CapabilitiesUse.cs
- ThicknessAnimationBase.cs
- RequestCacheManager.cs
- DocumentViewerHelper.cs
- ClientSettingsSection.cs
- VarRefManager.cs
- TrackingDataItem.cs
- GeneralTransform2DTo3D.cs
- ClassGenerator.cs
- ScrollProperties.cs
- NotifyInputEventArgs.cs
- TypeToken.cs
- KeyGestureConverter.cs
- SocketInformation.cs
- DecimalConstantAttribute.cs
- Timer.cs
- FixedDSBuilder.cs
- ColumnMapVisitor.cs
- ThreadStaticAttribute.cs
- SqlClientPermission.cs
- precedingsibling.cs
- WinEventTracker.cs
- ManipulationInertiaStartingEventArgs.cs
- ByteStream.cs
- XPathBinder.cs
- OrderedDictionaryStateHelper.cs
- ClientBuildManager.cs
- ExpressionBindingCollection.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- StringWriter.cs
- DataRelationCollection.cs
- CredentialCache.cs
- SqlAliaser.cs
- _NTAuthentication.cs
- ImageAnimator.cs
- ConnectionPoint.cs
- TextDecoration.cs
- Quaternion.cs
- UnsafeNativeMethods.cs
- EntityDataSourceValidationException.cs
- MSHTMLHostUtil.cs
- Menu.cs
- Collection.cs
- DataListItem.cs
- DbConnectionPoolGroup.cs
- validationstate.cs
- FormViewRow.cs
- XmlBinaryWriter.cs
- EDesignUtil.cs
- _IPv6Address.cs
- FileDialog.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ConfigXmlComment.cs
- TreeNodeConverter.cs
- ListViewUpdatedEventArgs.cs
- Win32SafeHandles.cs
- PersianCalendar.cs
- RangeValidator.cs
- SqlTypeSystemProvider.cs
- ToolStripDropDownMenu.cs
- CodeDirectiveCollection.cs
- CodeParameterDeclarationExpressionCollection.cs
- AssemblyInfo.cs
- precedingsibling.cs
- DrawingBrush.cs
- MediaElementAutomationPeer.cs
- RunInstallerAttribute.cs
- Debug.cs
- WizardStepBase.cs
- Slider.cs
- Matrix3D.cs
- IApplicationTrustManager.cs
- FileSystemEventArgs.cs
- ParentQuery.cs
- DataGridViewCellFormattingEventArgs.cs
- CodeStatement.cs
- HtmlInputImage.cs
- InternalControlCollection.cs
- WebPartAuthorizationEventArgs.cs
- TaiwanCalendar.cs
- ControlParser.cs
- SqlInternalConnectionTds.cs
- QilXmlWriter.cs
- MarkupWriter.cs
- SRef.cs
- NativeMethods.cs
- DataGridParentRows.cs
- WindowsFormsLinkLabel.cs
- FileUtil.cs
- BypassElement.cs
- ExecutionScope.cs
- ContentDisposition.cs
- SQLBytes.cs
- _SafeNetHandles.cs
- GridViewColumnHeaderAutomationPeer.cs
- SqlDeflator.cs
- DetailsViewRowCollection.cs