internal override void CacheMetadata(ActivityMetadata metadata, Activity owner, string operationName)
 {
     this.ShredParameters();
     int index = 0;
     foreach (Type type in this.argumentTypes)
     {
         if ((type == null) || (type == TypeHelper.VoidType))
         {
             metadata.AddValidationError(System.ServiceModel.Activities.SR.ArgumentCannotHaveNullOrVoidType(owner.DisplayName, this.argumentNames[index]));
         }
         if ((type == MessageDescription.TypeOfUntypedMessage) || MessageBuilder.IsMessageContract(type))
         {
             metadata.AddValidationError(System.ServiceModel.Activities.SR.ReceiveParametersContentDoesNotSupportMessage(owner.DisplayName, this.argumentNames[index]));
         }
         index++;
     }
     if (!metadata.HasViolations)
     {
         foreach (KeyValuePair<string, OutArgument> pair in this.Parameters)
         {
             RuntimeArgument argument = new RuntimeArgument(pair.Key, pair.Value.ArgumentType, ArgumentDirection.Out);
             metadata.Bind(pair.Value, argument);
             metadata.AddArgument(argument);
         }
     }
 }
Пример #2
0
        /// <summary>
        /// Create model item by activity
        /// </summary>
        public static ModelItem CreateModelItem(Activity activity)
        {
            Contract.Requires(activity != null);

            WorkflowDesigner wd = CreateWorkflowDesigner(activity, null);
            return GetSubModelItems(wd).First();
        }
 internal bool InitializeRelationship(Activity parent, bool isPublic, ref IList<ValidationError> validationErrors)
 {
     if ((this.cacheId == parent.CacheId) && (this.Owner != null))
     {
         ValidationError data = new ValidationError(System.Activities.SR.VariableAlreadyInUseOnActivity(this.Name, parent.DisplayName, this.Owner.DisplayName), false, this.Name, parent);
         ActivityUtilities.Add<ValidationError>(ref validationErrors, data);
         return false;
     }
     this.Owner = parent;
     this.cacheId = parent.CacheId;
     this.IsPublic = isPublic;
     if (this.Default == null)
     {
         return true;
     }
     ActivityWithResult innerExpression = this.Default;
     if (innerExpression is Argument.IExpressionWrapper)
     {
         innerExpression = ((Argument.IExpressionWrapper) innerExpression).InnerExpression;
     }
     if (innerExpression.ResultType != base.Type)
     {
         ActivityUtilities.Add<ValidationError>(ref validationErrors, new ValidationError(System.Activities.SR.VariableExpressionTypeMismatch(this.Name, base.Type, innerExpression.ResultType), false, this.Name, parent));
     }
     return this.Default.InitializeRelationship(this, isPublic, ref validationErrors);
 }
Пример #4
0
        public static void printActivityTreeA(Activity activity)
        {
            if (tag == null)
            {
                tag = new activityStruct();
                tag.parent = null;
                tag.currentActivity = activity;
                tag.displayName = activity.DisplayName;

            }


            System.Collections.Generic.IEnumerator<Activity> list = WorkflowInspectionServices.GetActivities(activity).GetEnumerator();

            while (list.MoveNext())
            {
                activityStruct temp = new activityStruct();

                temp.parent = tag;
                temp.currentActivity = list.Current;
                temp.displayName = list.Current.DisplayName;
                printActivityTreeA(list.Current);

            }

        }
 public object InvokeExpression(int expressionId, System.Collections.Generic.IList<System.Activities.LocationReference> locations, System.Activities.ActivityContext activityContext) {
     if ((this.rootActivity == null)) {
         this.rootActivity = this;
     }
     if ((this.dataContextActivities == null)) {
         this.dataContextActivities = paper_use1_TypedDataContext2_ForReadOnly.GetDataContextActivitiesHelper(this.rootActivity, this.forImplementation);
     }
     if ((expressionId == 0)) {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = paper_use1_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 1);
         if ((cachedCompiledDataContext[0] == null)) {
             cachedCompiledDataContext[0] = new paper_use1_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         paper_use1_TypedDataContext2_ForReadOnly valDataContext0 = ((paper_use1_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[0]));
         return valDataContext0.ValueType___Expr0Get();
     }
     if ((expressionId == 1)) {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = paper_use1_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 1);
         if ((cachedCompiledDataContext[0] == null)) {
             cachedCompiledDataContext[0] = new paper_use1_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         paper_use1_TypedDataContext2_ForReadOnly valDataContext1 = ((paper_use1_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[0]));
         return valDataContext1.ValueType___Expr1Get();
     }
     return null;
 }
 private int CreateLogicalThread(Activity activity, System.Activities.ActivityInstance instance, bool primeCurrentInstance)
 {
     Stack<System.Activities.ActivityInstance> ancestors = null;
     if (!this.DebugStartedAtRoot)
     {
         ancestors = new Stack<System.Activities.ActivityInstance>();
         if (((activity != instance.Activity) || primeCurrentInstance) && (primeCurrentInstance || !IsParallelActivity(instance.Activity)))
         {
             ancestors.Push(instance);
         }
         System.Activities.ActivityInstance parent = instance.Parent;
         while ((parent != null) && !IsParallelActivity(parent.Activity))
         {
             ancestors.Push(parent);
             parent = parent.Parent;
         }
         if (((parent != null) && IsParallelActivity(parent.Activity)) && (this.GetExecutingThreadId(parent.Activity, false) < 0))
         {
             int num = this.CreateLogicalThread(parent.Activity, parent, true);
         }
     }
     string threadName = string.Empty;
     if (activity.Parent != null)
     {
         threadName = "DebuggerThread:" + activity.Parent.DisplayName;
     }
     int key = this.stateManager.CreateLogicalThread(threadName);
     Stack<Activity> stack2 = new Stack<Activity>();
     this.runningThreads.Add(key, stack2);
     if (!this.DebugStartedAtRoot && (ancestors != null))
     {
         this.PrimeCallStack(key, ancestors);
     }
     return key;
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkflowInvokerTest"/> class.
 /// </summary>
 /// <param name="activity">
 /// The activity.
 /// </param>
 public WorkflowInvokerTest(Activity activity)
 {
     this.activity = activity;
     this.Writer = new StringWriter();
     this.Invoker.Extensions.Add(this.Writer);
     this.InArguments = new WorkflowArguments();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NinjectWorkflowApplicationUnhandledExceptionEventArgs"/> class.
 /// </summary>
 /// <param name="instanceId">The instance id.</param>
 /// <param name="unhandledException">The unhandled exception.</param>
 /// <param name="exceptionSource">The exception source.</param>
 /// <param name="exceptionSourceInstanceId">The exception source instance id.</param>
 public NinjectWorkflowApplicationUnhandledExceptionEventArgs(Guid instanceId, Exception unhandledException, Activity exceptionSource, string exceptionSourceInstanceId)
     : base(instanceId)
 {
     this.UnhandledException = unhandledException;
     this.ExceptionSource = exceptionSource;
     this.ExceptionSourceInstanceId = exceptionSourceInstanceId;
 }
 internal static string GenerateValidationErrorPrefix(Activity toValidate, ActivityUtilities.ActivityCallStack parentChain, out Activity source)
 {
     bool flag = true;
     string str = "";
     source = toValidate;
     for (int i = 0; i < parentChain.Count; i++)
     {
         ActivityUtilities.ChildActivity activity = parentChain[i];
         if (activity.Activity.MemberOf.Parent != null)
         {
             flag = false;
             break;
         }
     }
     while (source.MemberOf.Parent != null)
     {
         source = source.Parent;
     }
     if (toValidate.MemberOf.Parent != null)
     {
         return System.Activities.SR.ValidationErrorPrefixForHiddenActivity(source);
     }
     if (!flag)
     {
         str = System.Activities.SR.ValidationErrorPrefixForPublicActivityWithHiddenParent(source.Parent, source);
     }
     return str;
 }
Пример #10
0
        private void InspectActivity(Activity root)
        {
            IEnumerator<Activity> activities =
                    WorkflowInspectionServices.GetActivities(root).GetEnumerator();

                while (activities.MoveNext())
                {

                    PropertyInfo propVars = activities.Current.GetType().GetProperties().FirstOrDefault(p => p.Name == "Variables" && p.PropertyType == typeof(Collection<Variable>));
                    if (propVars != null)
                    {
                        try
                        {
                            Collection<Variable> variables = (Collection<Variable>)propVars.GetValue(activities.Current, null);
                            variables.ToList().ForEach(v =>
                            {
                                Variables.Add(v.Name);

                            });
                        }
                        catch
                        {

                        }
                    }
                    InspectActivity(activities.Current);
                }
        }
 public object InvokeExpression(int expressionId, System.Collections.Generic.IList<System.Activities.LocationReference> locations, System.Activities.ActivityContext activityContext) {
     if ((this.rootActivity == null)) {
         this.rootActivity = this;
     }
     if ((this.dataContextActivities == null)) {
         this.dataContextActivities = Prompt_TypedDataContext1_ForReadOnly.GetDataContextActivitiesHelper(this.rootActivity, this.forImplementation);
     }
     if ((expressionId == 0)) {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Prompt_TypedDataContext1_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null)) {
             cachedCompiledDataContext[0] = new Prompt_TypedDataContext1_ForReadOnly(locations, activityContext, true);
         }
         Prompt_TypedDataContext1_ForReadOnly valDataContext0 = ((Prompt_TypedDataContext1_ForReadOnly)(cachedCompiledDataContext[0]));
         return valDataContext0.ValueType___Expr0Get();
     }
     if ((expressionId == 1)) {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Prompt_TypedDataContext1_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null)) {
             cachedCompiledDataContext[0] = new Prompt_TypedDataContext1_ForReadOnly(locations, activityContext, true);
         }
         Prompt_TypedDataContext1_ForReadOnly valDataContext1 = ((Prompt_TypedDataContext1_ForReadOnly)(cachedCompiledDataContext[0]));
         return valDataContext1.ValueType___Expr1Get();
     }
     if ((expressionId == 2)) {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Prompt_TypedDataContext1.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null)) {
             cachedCompiledDataContext[1] = new Prompt_TypedDataContext1(locations, activityContext, true);
         }
         Prompt_TypedDataContext1 refDataContext2 = ((Prompt_TypedDataContext1)(cachedCompiledDataContext[1]));
         return refDataContext2.GetLocation<int>(refDataContext2.ValueType___Expr2Get, refDataContext2.ValueType___Expr2Set, expressionId, this.rootActivity, activityContext);
     }
     return null;
 }
 public DefaultConfirmation()
 {
     InternalConfirm confirm = new InternalConfirm {
         Target = new InArgument<CompensationToken>(this.toConfirmToken)
     };
     this.body = confirm;
 }
 public static bool GatherAndValidateOverloads(Activity activity, out Dictionary<string, List<RuntimeArgument>> overloadGroups, out List<RuntimeArgument> requiredArgumentsNotInOverloadGroups, out OverloadGroupEquivalenceInfo equivalenceInfo, ref IList<ValidationError> validationErrors)
 {
     overloadGroups = null;
     requiredArgumentsNotInOverloadGroups = null;
     foreach (RuntimeArgument argument in activity.RuntimeArguments)
     {
         if (!argument.OverloadGroupNames.IsNullOrEmpty())
         {
             foreach (string str in argument.OverloadGroupNames)
             {
                 if (overloadGroups == null)
                 {
                     overloadGroups = new Dictionary<string, List<RuntimeArgument>>();
                 }
                 List<RuntimeArgument> list = null;
                 if (!overloadGroups.TryGetValue(str, out list))
                 {
                     list = new List<RuntimeArgument>();
                     overloadGroups.Add(str, list);
                 }
                 list.Add(argument);
             }
         }
         else if (argument.IsRequired)
         {
             if (requiredArgumentsNotInOverloadGroups == null)
             {
                 requiredArgumentsNotInOverloadGroups = new List<RuntimeArgument>();
             }
             requiredArgumentsNotInOverloadGroups.Add(argument);
         }
     }
     equivalenceInfo = GetOverloadGroupEquivalence(overloadGroups);
     return ValidateOverloadGroupDefinitions(activity, equivalenceInfo, overloadGroups, ref validationErrors);
 }
 internal void SetupWorkflowCompensationBehavior(NativeActivityContext context, BookmarkCallback callback, Activity workflowCompensationBehavior)
 {
     this.WorkflowCompensationScheduled = context.CreateBookmark(callback);
     context.ScheduleSecondaryRoot(workflowCompensationBehavior, null);
     this.Add(0L, new CompensationTokenData(0L, 0L));
     this.IsWorkflowCompensationBehaviorScheduled = true;
 }
 public MappableLocation(LocationReference locationOwner, Activity activity, System.Activities.ActivityInstance activityInstance, System.Activities.Location location)
 {
     this.Name = locationOwner.Name;
     this.OwnerDisplayName = activity.DisplayName;
     this.Location = location;
     this.MappingKeyName = string.Format(CultureInfo.InvariantCulture, "activity.{0}-{1}_{2}", new object[] { activity.Id, locationOwner.Id, activityInstance.Id });
 }
Пример #16
0
 public InlinedLocationReference(LocationReference innerReference, Activity validAccessor, ArgumentDirection accessDirection)
 {
     this.innerReference = innerReference;
     this.validAccessor = validAccessor;
     this.allowReads = accessDirection != ArgumentDirection.Out;
     this.allowWrites = accessDirection != ArgumentDirection.In;
 }
        public void Visit(Activity activity, bool forImplementation)
        {
            this.ForImplementation = forImplementation;
            bool exit;

            VisitRoot(activity, out exit);
        }
Пример #18
0
        static void CreateClientWorkflow()
        {
            Variable<string> message = new Variable<string>("message", "Hello!");
            Variable<string> result = new Variable<string> { Name = "result" };

            Endpoint endpoint = new Endpoint
            {
                AddressUri = new Uri(Microsoft.Samples.WorkflowServicesSamples.Common.Constants.ServiceBaseAddress),
                Binding = new BasicHttpBinding(),
            };

            Send requestEcho = new Send
            {
                ServiceContractName = XName.Get("Echo", "http://tempuri.org/"),
                Endpoint = endpoint,
                OperationName = "Echo",
                //parameters for send
                Content = new SendParametersContent
                {
                    Parameters =
                        {
                            { "message", new InArgument<string>(message) }
                        }
                }
            };
            workflow = new CorrelationScope
            {
                Body = new Sequence
                {
                    Variables = { message, result },
                    Activities =
                    {
                        new WriteLine {
                            Text = new InArgument<string>("Client is ready!")
                        },
                        requestEcho,

                        new WriteLine {
                            Text = new InArgument<string>("Message sent: Hello!")
                        },

                        new ReceiveReply
                        {
                            Request = requestEcho,
                            //parameters for the reply
                            Content = new ReceiveParametersContent
                            {
                                Parameters =
                                {
                                    { "echo", new OutArgument<string>(result) }
                                }
                            }
                        },
                        new WriteLine {
                            Text = new InArgument<string>(env => "Message received: "+result.Get(env))
                        }
                    }
                }
            };
        }
        void VisitCore(Activity activity, out bool exit)
        {
            if (activity is ITextExpression)
            {
                VisitITextExpression(activity, out exit);
                return;
            }
            // Look for variable scopes
            if (activity.RuntimeVariables != null && activity.RuntimeVariables.Count > 0)
            {
                VisitVariableScope(activity, out exit);
                if (exit)
                {
                    return;
                }
            }
            else
            {
                Visit(activity, out exit);
                if (exit)
                {
                    return;
                }
            }

            return;
        }
 void ActivityInstanceMap.IActivityReference.Load(Activity activity, ActivityInstanceMap instanceMap)
 {
     if (this.activityInstance.Activity == null)
     {
         ((ActivityInstanceMap.IActivityReference) this.activityInstance).Load(activity, instanceMap);
     }
 }
        public static Activity Resolve(Activity root, string id)
        {
            if (root == null)
            {
                throw FxTrace.Exception.ArgumentNull("root");
            }

            if (string.IsNullOrEmpty(id))
            {
                throw FxTrace.Exception.ArgumentNullOrEmpty("id");
            }

            if (!root.IsMetadataCached)
            {
                IList<ValidationError> validationErrors = null;

                ActivityUtilities.CacheRootMetadata(root, new ActivityLocationReferenceEnvironment(), ProcessActivityTreeOptions.FullCachingOptions, null, ref validationErrors);

                ActivityValidationServices.ThrowIfViolationsExist(validationErrors);
            }

            QualifiedId parsedId = QualifiedId.Parse(id);

            Activity result;
            if (!QualifiedId.TryGetElementFromRoot(root, parsedId, out result))
            {
                throw FxTrace.Exception.Argument("id", SR.IdNotFoundInWorkflow(id));
            }

            return result;
        }
 internal WorkflowApplicationUnhandledExceptionEventArgs(WorkflowApplication application, Exception exception, Activity exceptionSource, string exceptionSourceInstanceId)
     : base(application)
 {
     this.UnhandledException = exception;
     this.ExceptionSource = exceptionSource;
     this.ExceptionSourceInstanceId = exceptionSourceInstanceId;
 }
 public void Declare(LocationReference locationReference, Activity owner, ref IList<ValidationError> validationErrors)
 {
     if (locationReference.Name == null)
     {
         if (this.unnamedDeclarations == null)
         {
             this.unnamedDeclarations = new List<LocationReference>();
         }
         this.unnamedDeclarations.Add(locationReference);
     }
     else if (this.Declarations.ContainsKey(locationReference.Name))
     {
         string id = null;
         if (owner != null)
         {
             id = owner.Id;
         }
         ValidationError data = new ValidationError(System.Activities.SR.SymbolNamesMustBeUnique(locationReference.Name)) {
             Source = owner,
             Id = id
         };
         ActivityUtilities.Add<ValidationError>(ref validationErrors, data);
     }
     else
     {
         this.Declarations.Add(locationReference.Name, locationReference);
     }
 }
 /// <summary>
 /// Creates a bookmark name for the given activity.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="callback"></param>
 /// <returns></returns>
 public static string CreateTwilioBookmarkName(this NativeActivityContext context, Activity activity)
 {
     return string.Format("{0}_{1}_{2}",
         activity.Id,
         activity.DisplayName,
         Math.Abs(Guid.NewGuid().GetHashCode()));
 }
 /// <summary>
 /// The get transitions.
 /// </summary>
 /// <param name="record">
 /// The record. 
 /// </param>
 /// <param name="rootActivity">
 /// The root activity. 
 /// </param>
 /// <returns>
 /// A collection of possible transitions 
 /// </returns>
 public static IList<Transition> GetTransitions(this StateMachineStateRecord record, Activity rootActivity)
 {
     var activity = WorkflowInspectionServices.Resolve(rootActivity, record.Activity.Id);
     dynamic internalState = new ReflectionObject(activity);
     dynamic transitions = new ReflectionObject(internalState.Transitions);
     return ((ReflectionObject)transitions).Inner as IList<Transition>;
 }
 public DefaultCompensation()
 {
     InternalCompensate compensate = new InternalCompensate {
         Target = new InArgument<CompensationToken>(this.toCompensateToken)
     };
     this.body = compensate;
 }
Пример #27
0
        public static GenericVariableCollection GetVariables(NativeActivityContext context, Activity activity)
        {
            Contract.Requires(context != null);
            Contract.Requires(activity != null);

            return GetVariables(context, activity.Id);
        }
 /// <summary>
 /// The get transitions.
 /// </summary>
 /// <param name="record">
 /// The record. 
 /// </param>
 /// <param name="rootActivity">
 /// The root activity. 
 /// </param>
 /// <returns>
 /// A collection of possible transitions 
 /// </returns>
 public static List<string> GetTransitionNames(this StateMachineStateRecord record, Activity rootActivity)
 {
     var transitions = GetTransitions(record, rootActivity);
     return transitions != null
                ? transitions.Select(transition => transition.DisplayName).ToList()
                : new List<string>();
 }
Пример #29
0
 public InlinedLocationReference(LocationReference innerReference, Activity validAccessor)
 {
     this.innerReference = innerReference;
     this.validAccessor = validAccessor;
     this.allowReads = true;
     this.allowWrites = true;
     this.allowGetLocation = true;
 }
 private void CollectSubRoot(Activity activity)
 {
     string fileName = XamlDebuggerXmlReader.GetFileName(activity) as string;
     if (!string.IsNullOrEmpty(fileName))
     {
         this.uninstrumentedSubRoots.Add(activity, fileName);
     }
 }
 public object InvokeExpression(int expressionId, System.Collections.Generic.IList <System.Activities.Location> locations)
 {
     if ((this.rootActivity == null))
     {
         this.rootActivity = this;
     }
     if ((expressionId == 0))
     {
         LoginWorkFlow_TypedDataContext3 refDataContext0 = new LoginWorkFlow_TypedDataContext3(locations, true);
         return(refDataContext0.GetLocation <string>(refDataContext0.ValueType___Expr0Get, refDataContext0.ValueType___Expr0Set));
     }
     if ((expressionId == 1))
     {
         LoginWorkFlow_TypedDataContext4_ForReadOnly valDataContext1 = new LoginWorkFlow_TypedDataContext4_ForReadOnly(locations, true);
         return(valDataContext1.ValueType___Expr1Get());
     }
     if ((expressionId == 2))
     {
         LoginWorkFlow_TypedDataContext4 refDataContext2 = new LoginWorkFlow_TypedDataContext4(locations, true);
         return(refDataContext2.GetLocation <string>(refDataContext2.ValueType___Expr2Get, refDataContext2.ValueType___Expr2Set));
     }
     return(null);
 }
 public object InvokeExpression(int expressionId, System.Collections.Generic.IList <System.Activities.Location> locations)
 {
     if ((this.rootActivity == null))
     {
         this.rootActivity = this;
     }
     if ((expressionId == 0))
     {
         BaseActivity_TypedDataContext1_ForReadOnly valDataContext0 = new BaseActivity_TypedDataContext1_ForReadOnly(locations, true);
         return(valDataContext0.ValueType___Expr0Get());
     }
     if ((expressionId == 1))
     {
         BaseActivity_TypedDataContext2_ForReadOnly valDataContext1 = new BaseActivity_TypedDataContext2_ForReadOnly(locations, true);
         return(valDataContext1.ValueType___Expr1Get());
     }
     if ((expressionId == 2))
     {
         BaseActivity_TypedDataContext2_ForReadOnly valDataContext2 = new BaseActivity_TypedDataContext2_ForReadOnly(locations, true);
         return(valDataContext2.ValueType___Expr2Get());
     }
     return(null);
 }
Пример #33
0
        private static SqlWorkflowInstanceStore CreateInstanceStore(System.Activities.Activity workflow, out InstanceHandle ownerHandle)
        {
            try
            {
                var store = new SqlWorkflowInstanceStore(ConnectionString);
                ownerHandle = store.CreateInstanceHandle();

                var wfHostTypeName = GetWorkflowHostTypeName(workflow);
                var WorkflowHostTypePropertyName = GetWorkflowHostTypePropertyName();

                var ownerCommand = new CreateWorkflowOwnerCommand()
                {
                    InstanceOwnerMetadata = { { WorkflowHostTypePropertyName, new InstanceValue(wfHostTypeName) } }
                };
                var owner = store.Execute(ownerHandle, ownerCommand, TimeSpan.FromSeconds(30)).InstanceOwner;
                ownerHandle.Free();
                store.DefaultInstanceOwner = owner;
                return(store);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 internal new static System.Activities.XamlIntegration.CompiledDataContext[] GetCompiledDataContextCacheHelper(object dataContextActivities, System.Activities.ActivityContext activityContext, System.Activities.Activity compiledRoot, bool forImplementation, int compiledDataContextCount)
 {
     return(System.Activities.XamlIntegration.CompiledDataContext.GetCompiledDataContextCache(dataContextActivities, activityContext, compiledRoot, forImplementation, compiledDataContextCount));
 }
 internal static object GetDataContextActivitiesHelper(System.Activities.Activity compiledRoot, bool forImplementation)
 {
     return(System.Activities.XamlIntegration.CompiledDataContext.GetDataContextActivities(compiledRoot, forImplementation));
 }
Пример #36
0
 public object InvokeExpression(int expressionId, System.Collections.Generic.IList <System.Activities.LocationReference> locations, System.Activities.ActivityContext activityContext)
 {
     if ((this.rootActivity == null))
     {
         this.rootActivity = this;
     }
     if ((this.dataContextActivities == null))
     {
         this.dataContextActivities = LoginActivity_TypedDataContext2.GetDataContextActivitiesHelper(this.rootActivity, this.forImplementation);
     }
     if ((expressionId == 0))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = LoginActivity_TypedDataContext2.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new LoginActivity_TypedDataContext2(locations, activityContext, true);
         }
         LoginActivity_TypedDataContext2 refDataContext0 = ((LoginActivity_TypedDataContext2)(cachedCompiledDataContext[0]));
         return(refDataContext0.GetLocation <LoginServiceWFConractFirst.User>(refDataContext0.ValueType___Expr0Get, refDataContext0.ValueType___Expr0Set, expressionId, this.rootActivity, activityContext));
     }
     if ((expressionId == 1))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = LoginActivity_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new LoginActivity_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         LoginActivity_TypedDataContext2_ForReadOnly valDataContext1 = ((LoginActivity_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[1]));
         return(valDataContext1.ValueType___Expr1Get());
     }
     if ((expressionId == 2))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = LoginActivity_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new LoginActivity_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         LoginActivity_TypedDataContext2_ForReadOnly valDataContext2 = ((LoginActivity_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[1]));
         return(valDataContext2.ValueType___Expr2Get());
     }
     if ((expressionId == 3))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = LoginActivity_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new LoginActivity_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         LoginActivity_TypedDataContext2_ForReadOnly valDataContext3 = ((LoginActivity_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[1]));
         return(valDataContext3.ValueType___Expr3Get());
     }
     if ((expressionId == 4))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = LoginActivity_TypedDataContext2.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new LoginActivity_TypedDataContext2(locations, activityContext, true);
         }
         LoginActivity_TypedDataContext2 refDataContext4 = ((LoginActivity_TypedDataContext2)(cachedCompiledDataContext[0]));
         return(refDataContext4.GetLocation <bool>(refDataContext4.ValueType___Expr4Get, refDataContext4.ValueType___Expr4Set, expressionId, this.rootActivity, activityContext));
     }
     if ((expressionId == 5))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = LoginActivity_TypedDataContext2.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new LoginActivity_TypedDataContext2(locations, activityContext, true);
         }
         LoginActivity_TypedDataContext2 refDataContext5 = ((LoginActivity_TypedDataContext2)(cachedCompiledDataContext[0]));
         return(refDataContext5.GetLocation <bool>(refDataContext5.ValueType___Expr5Get, refDataContext5.ValueType___Expr5Set, expressionId, this.rootActivity, activityContext));
     }
     return(null);
 }
Пример #37
0
        private static void GenerateAddKeyInstance(string key, string hostName, int port, string password, Mock <IResourceCatalog> mockResourceCatalog, out Dictionary <string, string> eval, out TestRedisActivity sut, Activity innerActivity)
        {
            eval = new Dictionary <string, string> {
                { "", "" }
            };
            var impl = new RedisCacheImpl(hostName, port, password);

            sut = new TestRedisActivity(mockResourceCatalog.Object, impl)
            {
                Key          = key,
                TTL          = 3000,
                ActivityFunc = new ActivityFunc <string, bool>
                {
                    Handler = innerActivity
                }
            };
        }
Пример #38
0
 public QueueItem(System.Activities.Activity element, TransactedReceiveScope parent, TransactedReceiveScope rootTransactedReceiveScope)
 {
     this.activity = element;
     this.parent   = parent;
     this.rootTransactedReceiveScope = rootTransactedReceiveScope;
 }
 public WorkflowServiceBehavior(System.Activities.Activity activity)
 {
     this.Activity = activity;
 }
 public WizardHostHelper(System.Activities.Activity workflow) : this(workflow, null)
 {
 }
Пример #41
0
 public object InvokeExpression(int expressionId, System.Collections.Generic.IList <System.Activities.LocationReference> locations, System.Activities.ActivityContext activityContext)
 {
     if ((this.rootActivity == null))
     {
         this.rootActivity = this;
     }
     if ((this.dataContextActivities == null))
     {
         this.dataContextActivities = Workflow_TypedDataContext2.GetDataContextActivitiesHelper(this.rootActivity, this.forImplementation);
     }
     if ((expressionId == 0))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Workflow_TypedDataContext2.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new Workflow_TypedDataContext2(locations, activityContext, true);
         }
         Workflow_TypedDataContext2 refDataContext0 = ((Workflow_TypedDataContext2)(cachedCompiledDataContext[0]));
         return(refDataContext0.GetLocation <Microsoft.Activities.DynamicValue>(refDataContext0.ValueType___Expr0Get, refDataContext0.ValueType___Expr0Set, expressionId, this.rootActivity, activityContext));
     }
     if ((expressionId == 1))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Workflow_TypedDataContext2.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new Workflow_TypedDataContext2(locations, activityContext, true);
         }
         Workflow_TypedDataContext2 refDataContext1 = ((Workflow_TypedDataContext2)(cachedCompiledDataContext[0]));
         return(refDataContext1.GetLocation <double>(refDataContext1.ValueType___Expr1Get, refDataContext1.ValueType___Expr1Set, expressionId, this.rootActivity, activityContext));
     }
     if ((expressionId == 2))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Workflow_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new Workflow_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         Workflow_TypedDataContext2_ForReadOnly valDataContext2 = ((Workflow_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[1]));
         return(valDataContext2.ValueType___Expr2Get());
     }
     if ((expressionId == 3))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Workflow_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new Workflow_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         Workflow_TypedDataContext2_ForReadOnly valDataContext3 = ((Workflow_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[1]));
         return(valDataContext3.ValueType___Expr3Get());
     }
     if ((expressionId == 4))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Workflow_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new Workflow_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         Workflow_TypedDataContext2_ForReadOnly valDataContext4 = ((Workflow_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[1]));
         return(valDataContext4.ValueType___Expr4Get());
     }
     if ((expressionId == 5))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Workflow_TypedDataContext2.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new Workflow_TypedDataContext2(locations, activityContext, true);
         }
         Workflow_TypedDataContext2 refDataContext5 = ((Workflow_TypedDataContext2)(cachedCompiledDataContext[0]));
         return(refDataContext5.GetLocation <int>(refDataContext5.ValueType___Expr5Get, refDataContext5.ValueType___Expr5Set, expressionId, this.rootActivity, activityContext));
     }
     if ((expressionId == 6))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = Workflow_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new Workflow_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         Workflow_TypedDataContext2_ForReadOnly valDataContext6 = ((Workflow_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[1]));
         return(valDataContext6.ValueType___Expr6Get());
     }
     return(null);
 }
        private static void CreateRedisActivity(string key, string hostName, int port, string password, Mock <IResourceCatalog> mockResourceCatalog, out TestRedisActivity sut, Activity innerActivity)
        {
            var impl = new RedisCacheImpl(hostName, port, password);

            sut = new TestRedisActivity(mockResourceCatalog.Object, impl)
            {
                Key          = key,
                TTL          = 30,
                ActivityFunc = new ActivityFunc <string, bool>
                {
                    Handler = innerActivity
                }
            };
        }
Пример #43
0
 private static XName GetWorkflowHostTypeName(System.Activities.Activity workflowDefinition)
 {
     return(XName.Get(workflowDefinition.GetType().FullName, "http://www.baseeam.com/2016/workflow"));
 }
Пример #44
0
 public DynamicActivityTypeDescriptor(Activity owner)
 {
     this.owner      = owner;
     this.Properties = new ActivityPropertyCollection(this);
 }
Пример #45
0
 public object InvokeExpression(int expressionId, System.Collections.Generic.IList <System.Activities.LocationReference> locations, System.Activities.ActivityContext activityContext)
 {
     if ((this.rootActivity == null))
     {
         this.rootActivity = this;
     }
     if ((this.dataContextActivities == null))
     {
         this.dataContextActivities = RackRateStatus_TypedDataContext1_ForReadOnly.GetDataContextActivitiesHelper(this.rootActivity, this.forImplementation);
     }
     if ((expressionId == 0))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = RackRateStatus_TypedDataContext1_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new RackRateStatus_TypedDataContext1_ForReadOnly(locations, activityContext, true);
         }
         RackRateStatus_TypedDataContext1_ForReadOnly valDataContext0 = ((RackRateStatus_TypedDataContext1_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext0.ValueType___Expr0Get());
     }
     if ((expressionId == 1))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = RackRateStatus_TypedDataContext1.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new RackRateStatus_TypedDataContext1(locations, activityContext, true);
         }
         RackRateStatus_TypedDataContext1 refDataContext1 = ((RackRateStatus_TypedDataContext1)(cachedCompiledDataContext[1]));
         return(refDataContext1.GetLocation <BrokerageOnline.TransferObjects.ViewAction>(refDataContext1.ValueType___Expr1Get, refDataContext1.ValueType___Expr1Set, expressionId, this.rootActivity, activityContext));
     }
     if ((expressionId == 2))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = RackRateStatus_TypedDataContext1_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new RackRateStatus_TypedDataContext1_ForReadOnly(locations, activityContext, true);
         }
         RackRateStatus_TypedDataContext1_ForReadOnly valDataContext2 = ((RackRateStatus_TypedDataContext1_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext2.ValueType___Expr2Get());
     }
     if ((expressionId == 3))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = RackRateStatus_TypedDataContext1_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new RackRateStatus_TypedDataContext1_ForReadOnly(locations, activityContext, true);
         }
         RackRateStatus_TypedDataContext1_ForReadOnly valDataContext3 = ((RackRateStatus_TypedDataContext1_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext3.ValueType___Expr3Get());
     }
     if ((expressionId == 4))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = RackRateStatus_TypedDataContext1_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new RackRateStatus_TypedDataContext1_ForReadOnly(locations, activityContext, true);
         }
         RackRateStatus_TypedDataContext1_ForReadOnly valDataContext4 = ((RackRateStatus_TypedDataContext1_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext4.ValueType___Expr4Get());
     }
     if ((expressionId == 5))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = RackRateStatus_TypedDataContext1.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new RackRateStatus_TypedDataContext1(locations, activityContext, true);
         }
         RackRateStatus_TypedDataContext1 refDataContext5 = ((RackRateStatus_TypedDataContext1)(cachedCompiledDataContext[1]));
         return(refDataContext5.GetLocation <string>(refDataContext5.ValueType___Expr5Get, refDataContext5.ValueType___Expr5Set, expressionId, this.rootActivity, activityContext));
     }
     if ((expressionId == 6))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = RackRateStatus_TypedDataContext1.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new RackRateStatus_TypedDataContext1(locations, activityContext, true);
         }
         RackRateStatus_TypedDataContext1 refDataContext6 = ((RackRateStatus_TypedDataContext1)(cachedCompiledDataContext[1]));
         return(refDataContext6.GetLocation <string>(refDataContext6.ValueType___Expr6Get, refDataContext6.ValueType___Expr6Set, expressionId, this.rootActivity, activityContext));
     }
     if ((expressionId == 7))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = RackRateStatus_TypedDataContext1.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 2);
         if ((cachedCompiledDataContext[1] == null))
         {
             cachedCompiledDataContext[1] = new RackRateStatus_TypedDataContext1(locations, activityContext, true);
         }
         RackRateStatus_TypedDataContext1 refDataContext7 = ((RackRateStatus_TypedDataContext1)(cachedCompiledDataContext[1]));
         return(refDataContext7.GetLocation <string>(refDataContext7.ValueType___Expr7Get, refDataContext7.ValueType___Expr7Set, expressionId, this.rootActivity, activityContext));
     }
     return(null);
 }
 public object InvokeExpression(int expressionId, System.Collections.Generic.IList <System.Activities.LocationReference> locations, System.Activities.ActivityContext activityContext)
 {
     if ((this.rootActivity == null))
     {
         this.rootActivity = this;
     }
     if ((this.dataContextActivities == null))
     {
         this.dataContextActivities = TrainingWorkflowService_TypedDataContext2_ForReadOnly.GetDataContextActivitiesHelper(this.rootActivity, this.forImplementation);
     }
     if ((expressionId == 0))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = TrainingWorkflowService_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 1);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new TrainingWorkflowService_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         TrainingWorkflowService_TypedDataContext2_ForReadOnly valDataContext0 = ((TrainingWorkflowService_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext0.ValueType___Expr0Get());
     }
     if ((expressionId == 1))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = TrainingWorkflowService_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 1);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new TrainingWorkflowService_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         TrainingWorkflowService_TypedDataContext2_ForReadOnly valDataContext1 = ((TrainingWorkflowService_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext1.ValueType___Expr1Get());
     }
     if ((expressionId == 2))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = TrainingWorkflowService_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 1);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new TrainingWorkflowService_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         TrainingWorkflowService_TypedDataContext2_ForReadOnly valDataContext2 = ((TrainingWorkflowService_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext2.ValueType___Expr2Get());
     }
     if ((expressionId == 3))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = TrainingWorkflowService_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 1);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new TrainingWorkflowService_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         TrainingWorkflowService_TypedDataContext2_ForReadOnly valDataContext3 = ((TrainingWorkflowService_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext3.ValueType___Expr3Get());
     }
     if ((expressionId == 4))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = TrainingWorkflowService_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 1);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new TrainingWorkflowService_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         TrainingWorkflowService_TypedDataContext2_ForReadOnly valDataContext4 = ((TrainingWorkflowService_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext4.ValueType___Expr4Get());
     }
     if ((expressionId == 5))
     {
         System.Activities.XamlIntegration.CompiledDataContext[] cachedCompiledDataContext = TrainingWorkflowService_TypedDataContext2_ForReadOnly.GetCompiledDataContextCacheHelper(this.dataContextActivities, activityContext, this.rootActivity, this.forImplementation, 1);
         if ((cachedCompiledDataContext[0] == null))
         {
             cachedCompiledDataContext[0] = new TrainingWorkflowService_TypedDataContext2_ForReadOnly(locations, activityContext, true);
         }
         TrainingWorkflowService_TypedDataContext2_ForReadOnly valDataContext5 = ((TrainingWorkflowService_TypedDataContext2_ForReadOnly)(cachedCompiledDataContext[0]));
         return(valDataContext5.ValueType___Expr5Get());
     }
     return(null);
 }