public WfMoveToSelectedResult(WfControlOperationType opType, WfControlNextStep nextStep)
        {
            this._OperationType = opType;
            IWfProcessDescriptor processDesp = WfClientContext.Current.CurrentActivity.Process.Descriptor;

            this._TargetActivityDescriptor = processDesp.Activities[nextStep.ActivityDescriptor.Key];

            if (nextStep.TransitionDescriptor != null)
                this._FromTransitionDescriptor = processDesp.FindTransitionByKey(nextStep.TransitionDescriptor.Key);

            this.Assignees.CopyFrom(nextStep.Candidates);
        }
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfControlNextStep nextStep = new WfControlNextStep();

            if (dictionary.ContainsKey("ActivityDescriptor"))
            {
                nextStep.ActivityDescriptor = JSONSerializerExecute.Deserialize <IWfActivityDescriptor>(dictionary["ActivityDescriptor"]);
            }

            if (dictionary.ContainsKey("Candidates"))
            {
                nextStep.Candidates = JSONSerializerExecute.Deserialize <WfAssigneeCollection>(dictionary["Candidates"]);
            }

            if (dictionary.ContainsKey("TransitionDescriptor"))
            {
                nextStep.TransitionDescriptor = JSONSerializerExecute.Deserialize <IWfTransitionDescriptor>(dictionary["TransitionDescriptor"]);
            }

            return(nextStep);
        }
		private void RenderOneRadio(WfControlNextStep nextStep, int i, int defaultStepIndex, Control container)
		{
			string script = this.OnChangeClientScript;

			if (string.IsNullOrEmpty(script))
			{
				script = "onWFNextStepChange();";
			}
			else
			{
				string innerScript = "var radioGroupName = event.srcElement.name;var radioBtns = document.getElementsByName(radioGroupName);for(var i=0;i<radioBtns.length;i++){radioBtns[i].disabled = true;}";
				script += innerScript;
			}
			string tranRadioValue = !string.IsNullOrEmpty(nextStep.TransitionDescriptor.Name) ? nextStep.TransitionDescriptor.Name : nextStep.TransitionDescriptor.Description;
			string actRadioValue = !string.IsNullOrEmpty(nextStep.ActivityDescriptor.Name) ? nextStep.ActivityDescriptor.Name : nextStep.ActivityDescriptor.Description;
			string html = string.Format("<input type=\"radio\" name=\"{0}_nextSteps\" style=\"cursor: hand\" value=\"{1}\" id=\"{2}\" {4} onclick=\"{6}\" {5} dataID=\"{0}_data\"/><label style=\"cursor: hand;font-family:'宋体',Arial,Helvetica,sans-serif;margin-right:4px;font-size: 12px;font-weight:bold;\" for=\"{2}\" {5}>{3}</label>",
				this.ClientID,
				i,
				this.ClientID + "_nextStepRadio_" + i,
				HttpUtility.HtmlEncode(!string.IsNullOrEmpty(tranRadioValue) ? tranRadioValue : actRadioValue),
				i == defaultStepIndex ? "checked" : string.Empty,
				Enabled ? string.Empty : "disabled",
				script);

			container.Controls.Add(new LiteralControl(html));
		}
        protected override string SaveClientState()
        {
            string result = null;

            WfControlNextStep rejectStep = null;

            if (WfClientContext.Current.CurrentActivity != null)
            {
                IWfActivity rejectActivity = null;

                switch (RejectMode)
                {
                    case WfRejectMode.RejectToDrafter:
                        rejectActivity = WfClientContext.Current.CurrentActivity.Process.RootProcess.InitialActivity;
                        break;
                }

                if (rejectActivity != null)
                {
                    rejectStep = new WfControlNextStep(rejectActivity);
                    result = JSONSerializerExecute.Serialize(rejectStep);
                }
            }

            return result;
        }