コード例 #1
0
 internal void FixupInstance(System.Activities.ActivityInstance parent, ActivityInstanceMap instanceMap, ActivityExecutor executor)
 {
     if (!this.IsCompleted)
     {
         if (this.Activity == null)
         {
             throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.ActivityInstanceFixupFailed));
         }
         this.parent      = parent;
         this.instanceMap = instanceMap;
         if (this.PropertyManager != null)
         {
             this.PropertyManager.OnDeserialized(this, parent, this.Activity.MemberOf, executor);
         }
         else if (this.parent != null)
         {
             this.PropertyManager = this.parent.PropertyManager;
         }
         else
         {
             this.PropertyManager = executor.RootPropertyManager;
         }
         if (!this.noSymbols)
         {
             this.environment.OnDeserialized(executor, this);
         }
     }
 }
 void ActivityInstanceMap.IActivityReference.Load(Activity activity, ActivityInstanceMap instanceMap)
 {
     if (this.activityInstance.Activity == null)
     {
         ((ActivityInstanceMap.IActivityReference) this.activityInstance).Load(activity, instanceMap);
     }
 }
コード例 #3
0
 internal void FillInstanceMap(ActivityInstanceMap instanceMap)
 {
     if (!this.IsCompleted)
     {
         this.instanceMap = instanceMap;
         ActivityUtilities.ProcessActivityInstanceTree(this, null, new Func <System.Activities.ActivityInstance, ActivityExecutor, bool>(this.GenerateInstanceMapCallback));
     }
 }
コード例 #4
0
 internal bool TryFixupChildren(ActivityInstanceMap instanceMap, ActivityExecutor executor)
 {
     if (!this.HasChildren)
     {
         return(false);
     }
     this.childList.FixupList(this, instanceMap, executor);
     return(true);
 }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
 public void FixupList(ActivityInstance parent, ActivityInstanceMap instanceMap, ActivityExecutor executor)
 {
     if (base.SingleItem != null)
     {
         base.SingleItem.FixupInstance(parent, instanceMap, executor);
     }
     else
     {
         for (var i = 0; i < base.MultipleItems.Count; i++)
         {
             base.MultipleItems[i].FixupInstance(parent, instanceMap, executor);
         }
     }
 }
コード例 #7
0
 public void PurgeActivityReferences(ActivityInstanceMap instanceMap)
 {
     if (base.SingleItem != null)
     {
         instanceMap.RemoveEntry(base.SingleItem);
     }
     else
     {
         for (int i = 0; i < base.MultipleItems.Count; i++)
         {
             instanceMap.RemoveEntry(base.MultipleItems[i]);
         }
     }
 }
コード例 #8
0
 public void FillInstanceMap(ActivityInstanceMap instanceMap)
 {
     if (base.SingleItem != null)
     {
         instanceMap.AddEntry(base.SingleItem);
     }
     else
     {
         for (int i = 0; i < base.MultipleItems.Count; i++)
         {
             ActivityInstanceReference reference = base.MultipleItems[i];
             instanceMap.AddEntry(reference);
         }
     }
 }
コード例 #9
0
                public void PurgeActivityReferences(ActivityInstanceMap instanceMap)
                {
                    Fx.Assert(this.Count > 0, "Should only call this when we have items");

                    if (this.SingleItem != null)
                    {
                        instanceMap.RemoveEntry(this.SingleItem);
                    }
                    else
                    {
                        for (var i = 0; i < this.MultipleItems.Count; i++)
                        {
                            instanceMap.RemoveEntry(this.MultipleItems[i]);
                        }
                    }
                }
コード例 #10
0
                public void FillInstanceMap(ActivityInstanceMap instanceMap)
                {
                    Fx.Assert(this.Count > 0, "Should only call this when we have items");

                    if (this.SingleItem != null)
                    {
                        instanceMap.AddEntry(this.SingleItem);
                    }
                    else
                    {
                        for (var i = 0; i < this.MultipleItems.Count; i++)
                        {
                            var reference = this.MultipleItems[i];

                            instanceMap.AddEntry(reference);
                        }
                    }
                }
コード例 #11
0
        internal bool Initialize(System.Activities.ActivityInstance parent, ActivityInstanceMap instanceMap, LocationEnvironment parentEnvironment, long instanceId, ActivityExecutor executor, int delegateParameterCount)
        {
            this.parent      = parent;
            this.instanceMap = instanceMap;
            this.id          = instanceId;
            if (this.instanceMap != null)
            {
                this.instanceMap.AddEntry(this);
            }
            if (this.parent != null)
            {
                if (this.parent.PropertyManager != null)
                {
                    this.PropertyManager = this.parent.PropertyManager;
                }
                if (parentEnvironment == null)
                {
                    parentEnvironment = this.parent.Environment;
                }
            }
            int capacity = this.Activity.SymbolCount + delegateParameterCount;

            if (capacity == 0)
            {
                if (parentEnvironment == null)
                {
                    this.environment = new LocationEnvironment(executor, this.Activity);
                }
                else
                {
                    this.noSymbols   = true;
                    this.environment = parentEnvironment;
                }
                return(false);
            }
            this.environment = new LocationEnvironment(executor, this.Activity, parentEnvironment, capacity);
            this.substate    = Substate.ResolvingArguments;
            return(true);
        }
コード例 #12
0
 public void FillInstanceMap(ActivityInstanceMap instanceMap)
 {
     if (this.firstWorkItem != null)
     {
         ActivityInstanceMap.IActivityReference firstWorkItem = this.firstWorkItem as ActivityInstanceMap.IActivityReference;
         if (firstWorkItem != null)
         {
             instanceMap.AddEntry(firstWorkItem, true);
         }
         if ((this.workItemQueue != null) && (this.workItemQueue.Count > 0))
         {
             for (int i = 0; i < this.workItemQueue.Count; i++)
             {
                 firstWorkItem = this.workItemQueue[i] as ActivityInstanceMap.IActivityReference;
                 if (firstWorkItem != null)
                 {
                     instanceMap.AddEntry(firstWorkItem, true);
                 }
             }
         }
     }
 }
コード例 #13
0
 internal bool Initialize(System.Activities.ActivityInstance parent, ActivityInstanceMap instanceMap, LocationEnvironment parentEnvironment, long instanceId, ActivityExecutor executor)
 {
     return(this.Initialize(parent, instanceMap, parentEnvironment, instanceId, executor, 0));
 }
コード例 #14
0
 public void FillInstanceMap(ActivityInstanceMap instanceMap)
 {
     this.activityReferences.FillInstanceMap(instanceMap);
 }
        /// <summary>
        /// Fix up activity reference after persistence
        /// </summary>
        /// <param name="activity">The persisted activity reference</param>
        /// <param name="instanceMap">The map containing persisted activity references</param>
        void ActivityInstanceMap.IActivityReference.Load(Activity activity, ActivityInstanceMap instanceMap)
        {
            ActivityWithResult activityWithResult = activity as ActivityWithResult;
            if (activityWithResult == null)
            {
                throw FxTrace.Exception.AsError(
                    new ValidationException(SR.ActivityTypeMismatch(activity.DisplayName, typeof(ActivityWithResult).Name)));
            }

            this.expressionActivity = activityWithResult;
        }
コード例 #16
0
 public void PurgeActivityReferences(ActivityInstanceMap instanceMap)
 {
     this.activityReferences.PurgeActivityReferences(instanceMap);
 }
コード例 #17
0
 void ActivityInstanceMap.IActivityReference.Load(System.Activities.Activity activity, ActivityInstanceMap instanceMap)
 {
     if (activity.GetType().Name != this.OwnerName)
     {
         throw FxTrace.Exception.AsError(new ValidationException(System.Activities.SR.ActivityTypeMismatch(activity.DisplayName, this.OwnerName)));
     }
     this.Activity = activity;
 }