Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Tracking / ActivityInfo.cs / 1305376 / ActivityInfo.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.Tracking { using System; using System.Runtime.Serialization; using System.Runtime; using System.Globalization; [Fx.Tag.XamlVisible(false)] [DataContract] public sealed class ActivityInfo { string name; string id; string instanceId; string typeName; public ActivityInfo(string name, string id, string instanceId, string typeName) { if (string.IsNullOrEmpty(name)) { throw FxTrace.Exception.ArgumentNullOrEmpty("name"); } if (string.IsNullOrEmpty(id)) { throw FxTrace.Exception.ArgumentNullOrEmpty("id"); } if (string.IsNullOrEmpty(instanceId)) { throw FxTrace.Exception.ArgumentNullOrEmpty("instanceId"); } if (string.IsNullOrEmpty(typeName)) { throw FxTrace.Exception.ArgumentNullOrEmpty("typeName"); } this.Name = name; this.Id = id; this.InstanceId = instanceId; this.TypeName = typeName; } internal ActivityInfo(ActivityInstance instance) { this.Instance = instance; } internal ActivityInstance Instance { get; private set; } [DataMember] public string Name { get { if (string.IsNullOrEmpty(this.name)) { Fx.Assert(this.Instance != null, "Instance not set"); this.name = this.Instance.Activity.DisplayName; } return this.name; } private set { Fx.Assert(!string.IsNullOrEmpty(value), "Name cannot be null or empty"); this.name = value; } } [DataMember] public string Id { get { if (String.IsNullOrEmpty(this.id)) { Fx.Assert(this.Instance != null, "Instance not set"); this.id = this.Instance.Activity.Id; } return this.id; } private set { Fx.Assert(!string.IsNullOrEmpty(value), "Id cannot be null or empty"); this.id = value; } } [DataMember] public string InstanceId { get { if (string.IsNullOrEmpty(this.instanceId)) { Fx.Assert(this.Instance != null, "Instance not set"); this.instanceId = this.Instance.Id; } return this.instanceId; } private set { Fx.Assert(!string.IsNullOrEmpty(value), "InstanceId cannot be null or empty"); this.instanceId = value; } } [DataMember] public string TypeName { get { if (string.IsNullOrEmpty(this.typeName)) { Fx.Assert(this.Instance != null, "Instance not set"); this.typeName = this.Instance.Activity.GetType().FullName; } return this.typeName; } private set { Fx.Assert(!string.IsNullOrEmpty(value), "TypeName cannot be null or empty"); this.typeName = value; } } public override string ToString() { return string.Format(CultureInfo.CurrentCulture, "Name={0}, ActivityId = {1}, ActivityInstanceId = {2}, TypeName={3}", this.Name, this.Id, this.InstanceId, this.TypeName); } } } // 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
- CompositionTarget.cs
- TypeGeneratedEventArgs.cs
- ContextInformation.cs
- ToolStripLocationCancelEventArgs.cs
- RtfNavigator.cs
- SqlDataSourceSelectingEventArgs.cs
- ReverseInheritProperty.cs
- AttachedPropertyMethodSelector.cs
- LingerOption.cs
- ConnectionPool.cs
- WSSecurityTokenSerializer.cs
- VScrollBar.cs
- XPathArrayIterator.cs
- InkCanvasInnerCanvas.cs
- mediaclock.cs
- EntitySet.cs
- StopRoutingHandler.cs
- NameValueSectionHandler.cs
- ContextMenuService.cs
- WizardForm.cs
- AncillaryOps.cs
- ChangeProcessor.cs
- BadImageFormatException.cs
- UnsettableComboBox.cs
- MemberCollection.cs
- AbandonedMutexException.cs
- KeyValuePair.cs
- sqlnorm.cs
- NameValueFileSectionHandler.cs
- XmlSubtreeReader.cs
- AppSettingsExpressionBuilder.cs
- GatewayIPAddressInformationCollection.cs
- CommandHelper.cs
- DataExchangeServiceBinder.cs
- _BaseOverlappedAsyncResult.cs
- SoapFormatterSinks.cs
- ZipQueryOperator.cs
- AuthenticationManager.cs
- Attributes.cs
- NavigatorOutput.cs
- DeferredSelectedIndexReference.cs
- NumberEdit.cs
- ObjectManager.cs
- ImportRequest.cs
- PackageFilter.cs
- ValidatorAttribute.cs
- PrimarySelectionGlyph.cs
- XmlDocumentSchema.cs
- NavigatorOutput.cs
- EntityCollection.cs
- GridLengthConverter.cs
- XmlSchemaGroup.cs
- BatchServiceHost.cs
- JsonEncodingStreamWrapper.cs
- RulePatternOps.cs
- SqlDataAdapter.cs
- ElementProxy.cs
- ConfigXmlComment.cs
- BooleanProjectedSlot.cs
- ParserHooks.cs
- ObjectQuery.cs
- PageWrapper.cs
- BrowserTree.cs
- TraceSection.cs
- SecurityStateEncoder.cs
- SchemaEntity.cs
- TriggerBase.cs
- OnOperation.cs
- LicenseException.cs
- HttpVersion.cs
- Interlocked.cs
- ApplicationFileCodeDomTreeGenerator.cs
- TransformGroup.cs
- File.cs
- ComNativeDescriptor.cs
- wmiprovider.cs
- SqlDataSourceCommandEventArgs.cs
- unitconverter.cs
- ProgressBar.cs
- ObjectQueryProvider.cs
- GradientBrush.cs
- HtmlImage.cs
- brushes.cs
- Internal.cs
- SoapExtensionImporter.cs
- ToolStripRenderer.cs
- ListViewHitTestInfo.cs
- DbConnectionOptions.cs
- SiteOfOriginContainer.cs
- NotFiniteNumberException.cs
- SemaphoreFullException.cs
- GorillaCodec.cs
- DoubleUtil.cs
- TrackingQuery.cs
- TextRunCacheImp.cs
- DBNull.cs
- Trigger.cs
- ConfigXmlText.cs
- XmlSchemaComplexContent.cs
- RepeaterItemCollection.cs