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
- SourceInterpreter.cs
- ConnectionOrientedTransportBindingElement.cs
- WindowsComboBox.cs
- Rotation3DAnimation.cs
- LocalValueEnumerator.cs
- ToolStripGripRenderEventArgs.cs
- BinarySerializer.cs
- brushes.cs
- FusionWrap.cs
- RoutedCommand.cs
- ClassicBorderDecorator.cs
- BeginEvent.cs
- ListViewPagedDataSource.cs
- DisplayMemberTemplateSelector.cs
- HttpModuleAction.cs
- TableItemStyle.cs
- NetPipeSectionData.cs
- ButtonFieldBase.cs
- TemplateBuilder.cs
- XmlCustomFormatter.cs
- PackWebResponse.cs
- ResolvedKeyFrameEntry.cs
- TiffBitmapDecoder.cs
- QuaternionAnimation.cs
- ExpressionQuoter.cs
- Visual3DCollection.cs
- PackageFilter.cs
- XmlWrappingReader.cs
- Trace.cs
- XmlnsCompatibleWithAttribute.cs
- StatusBarDesigner.cs
- safemediahandle.cs
- QueryAccessibilityHelpEvent.cs
- SQLDouble.cs
- StringConverter.cs
- ImageField.cs
- ExpressionStringBuilder.cs
- ClientType.cs
- DataGridTablesFactory.cs
- ProviderUtil.cs
- PageAsyncTaskManager.cs
- RuntimeDelegateArgument.cs
- Attribute.cs
- LinqDataSourceSelectEventArgs.cs
- DictionaryKeyPropertyAttribute.cs
- SqlCommandSet.cs
- AutomationPatternInfo.cs
- WinInetCache.cs
- AutomationElement.cs
- SelectionGlyphBase.cs
- RuntimeArgument.cs
- TypeContext.cs
- MetadataPropertyAttribute.cs
- ContextStaticAttribute.cs
- AttributeQuery.cs
- GridViewColumn.cs
- CommandManager.cs
- ValidationError.cs
- RoutedEventArgs.cs
- ActionFrame.cs
- WindowsTooltip.cs
- SupportsEventValidationAttribute.cs
- CodeIterationStatement.cs
- SqlMetaData.cs
- Line.cs
- X509ChainElement.cs
- QueryContinueDragEventArgs.cs
- TimersDescriptionAttribute.cs
- NativeBuffer.cs
- InlinedLocationReference.cs
- CriticalFinalizerObject.cs
- WindowClosedEventArgs.cs
- UInt64.cs
- Light.cs
- ConstructorBuilder.cs
- HttpHandlerActionCollection.cs
- XmlFileEditor.cs
- NativeMethods.cs
- LinqExpressionNormalizer.cs
- XmlDataProvider.cs
- TcpChannelFactory.cs
- CellIdBoolean.cs
- AutomationElementIdentifiers.cs
- CustomWebEventKey.cs
- XmlAttributeAttribute.cs
- AuthenticationModulesSection.cs
- Tuple.cs
- EmptyStringExpandableObjectConverter.cs
- WindowsToolbarAsMenu.cs
- TableParaClient.cs
- SerialPort.cs
- DataControlLinkButton.cs
- CheckBox.cs
- Misc.cs
- MetricEntry.cs
- SelectionProviderWrapper.cs
- XmlSchemaSimpleType.cs
- SchemaSetCompiler.cs
- _PooledStream.cs
- ImagingCache.cs