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
- SuppressMergeCheckAttribute.cs
- __Filters.cs
- EventLogPermissionHolder.cs
- TrustVersion.cs
- XPathArrayIterator.cs
- ViewService.cs
- AssertFilter.cs
- TypeUnloadedException.cs
- TransactionCache.cs
- MenuEventArgs.cs
- followingsibling.cs
- XmlArrayItemAttributes.cs
- EntityDataSourceState.cs
- DesignerVerb.cs
- InkCollectionBehavior.cs
- ObservableDictionary.cs
- documentsequencetextcontainer.cs
- ScrollProviderWrapper.cs
- NamespaceDecl.cs
- EncoderParameter.cs
- RelativeSource.cs
- DesignerMetadata.cs
- DispatchWrapper.cs
- COM2ExtendedBrowsingHandler.cs
- SafeRightsManagementPubHandle.cs
- HashAlgorithm.cs
- StringConverter.cs
- TreeNodeSelectionProcessor.cs
- FatalException.cs
- ManagementClass.cs
- ThreadAttributes.cs
- TrackingProfile.cs
- SourceFilter.cs
- QueryCacheEntry.cs
- PropertyValueUIItem.cs
- MouseButton.cs
- CryptographicAttribute.cs
- AnalyzedTree.cs
- XmlBoundElement.cs
- TableDetailsCollection.cs
- AttachmentCollection.cs
- SymmetricAlgorithm.cs
- Constant.cs
- CharStorage.cs
- SqlDependencyListener.cs
- GrammarBuilderRuleRef.cs
- EntityException.cs
- ZipQueryOperator.cs
- SqlReferenceCollection.cs
- XPathAxisIterator.cs
- Utils.cs
- Logging.cs
- GeneralTransform3DTo2DTo3D.cs
- DecoderExceptionFallback.cs
- Viewport3DAutomationPeer.cs
- CommandBinding.cs
- metadatamappinghashervisitor.cs
- IPHostEntry.cs
- PrivilegeNotHeldException.cs
- UserNamePasswordValidator.cs
- DateTimeEditor.cs
- XPathMessageFilterElement.cs
- DynamicILGenerator.cs
- FontWeights.cs
- TCPListener.cs
- CngKeyCreationParameters.cs
- ValidationError.cs
- HttpHandler.cs
- CopyOnWriteList.cs
- DLinqColumnProvider.cs
- MetadataArtifactLoader.cs
- ExpressionTable.cs
- TargetInvocationException.cs
- ScrollChrome.cs
- RotateTransform.cs
- OperandQuery.cs
- SHA256.cs
- DispatcherOperation.cs
- UniqueID.cs
- DetailsViewPagerRow.cs
- SymbolMethod.cs
- DrawingGroup.cs
- MachineKeySection.cs
- DoubleAnimationBase.cs
- ZoneIdentityPermission.cs
- XmlSchemaExporter.cs
- ConfigurationSectionGroupCollection.cs
- TypeReference.cs
- XPathAncestorQuery.cs
- TransformCryptoHandle.cs
- DispatcherProcessingDisabled.cs
- WindowsFormsHelpers.cs
- EntityTypeEmitter.cs
- DragCompletedEventArgs.cs
- followingsibling.cs
- ApplicationSecurityManager.cs
- IChannel.cs
- RubberbandSelector.cs
- GetPageNumberCompletedEventArgs.cs
- Set.cs