/// <summary> /// This method initializes activity UI controls to their default values. /// </summary> /// <param name="activity">An instance of the current workflow activity. This provides a way to extract the values of the properties to display in the UI.</param> public override void LoadActivitySettings(Activity activity) { Logger.Instance.WriteMethodEntry(); try { // Cast the supplied activity as a DeleteResources activity DeleteResources wfa = activity as DeleteResources; if (wfa == null) { return; } // Set form control values based on the activity's dependency properties this.activityDisplayName.Value = wfa.ActivityDisplayName; this.targetType.Value = wfa.TargetType.ToString(); this.advanced.Value = wfa.Advanced; this.activityExecutionCondition.Value = wfa.ActivityExecutionCondition; this.iteration.Value = wfa.Iteration; this.actorType.Value = wfa.ActorType.ToString(); this.actorString.Value = wfa.ActorString; this.applyAuthorizationPolicy.Value = wfa.ApplyAuthorizationPolicy; this.targetExpression.Value = wfa.TargetExpression; } catch (Exception e) { Logger.Instance.ReportError(e); throw; } finally { Logger.Instance.WriteMethodExit(); } }
public override Activity GenerateActivityOnWorkflow(SequentialWorkflow workflow) { Logger.Instance.WriteMethodEntry(); try { // Create a new instance of the DeleteResources activity and assign // dependenty property values based on inputs to standard activity controls DeleteResources wfa = new DeleteResources { ActivityDisplayName = this.activityDisplayName.Value, Advanced = this.advanced.Value, ActivityExecutionCondition = this.activityExecutionCondition.Value, Iteration = this.iteration.Value, ActorType = GetActorType(this.actorType.Value), ActorString = this.actorString.Value, ApplyAuthorizationPolicy = this.applyAuthorizationPolicy.Value, TargetExpression = this.targetExpression.Value }; if (this.targetType.Value == DeleteResourcesTargetType.WorkflowTarget.ToString()) { wfa.TargetType = DeleteResourcesTargetType.WorkflowTarget; } else if (this.targetType.Value == DeleteResourcesTargetType.ResolveTarget.ToString()) { wfa.TargetType = DeleteResourcesTargetType.ResolveTarget; } else if (this.targetType.Value == DeleteResourcesTargetType.SearchForTarget.ToString()) { wfa.TargetType = DeleteResourcesTargetType.SearchForTarget; } return(wfa); } catch (Exception e) { Logger.Instance.ReportError(e); throw; } finally { Logger.Instance.WriteMethodExit(); } }