e79aa3c0ed
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
62 lines
1.8 KiB
C#
62 lines
1.8 KiB
C#
//-----------------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//-----------------------------------------------------------------------------
|
|
|
|
namespace System.Activities.Runtime
|
|
{
|
|
using System;
|
|
using System.Activities.DynamicUpdate;
|
|
using System.Runtime;
|
|
using System.Runtime.Serialization;
|
|
using System.Collections.ObjectModel;
|
|
|
|
[DataContract]
|
|
class ActivityInstanceReference : ActivityInstanceMap.IActivityReference
|
|
{
|
|
ActivityInstance activityInstance;
|
|
|
|
internal ActivityInstanceReference(ActivityInstance activity)
|
|
{
|
|
this.activityInstance = activity;
|
|
}
|
|
|
|
[DataMember(Name = "activityInstance")]
|
|
internal ActivityInstance SerializedActivityInstance
|
|
{
|
|
get { return this.activityInstance; }
|
|
set { this.activityInstance = value; }
|
|
}
|
|
|
|
Activity ActivityInstanceMap.IActivityReference.Activity
|
|
{
|
|
get
|
|
{
|
|
return this.activityInstance.Activity;
|
|
}
|
|
}
|
|
|
|
|
|
public ActivityInstance ActivityInstance
|
|
{
|
|
get
|
|
{
|
|
return this.activityInstance;
|
|
}
|
|
}
|
|
|
|
void ActivityInstanceMap.IActivityReference.Load(Activity activity, ActivityInstanceMap instanceMap)
|
|
{
|
|
// The conditional calling of ActivityInstance.Load is the value
|
|
// added by this wrapper class. This is because we can't guarantee
|
|
// that multiple activities won't have a reference to the same
|
|
// ActivityInstance.
|
|
if (this.activityInstance.Activity == null)
|
|
{
|
|
((ActivityInstanceMap.IActivityReference)this.activityInstance).Load(activity, instanceMap);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|