コード例 #1
0
        public WfClientUISwitches FillByProcess(IWfProcess process, string originalActivityID, IUser user)
        {
            if (process != null)
            {
                this.CanMoveTo = process.GetInMoveToMode(originalActivityID, user) ||
                                 (process.GetInMoveToStatus(originalActivityID) && process.GetIsProcessAdmin(user));

                this.CanSave = (process.GetInMoveToMode(originalActivityID, user) && process.CurrentActivity.Descriptor.Properties.GetValue("AllowSave", true)) ||
                               (process.GetInMoveToStatus(originalActivityID) && process.GetIsProcessAdmin(user));

                this.CanPause = process.CanPause && process.GetIsProcessAdmin(user);

                this.CanResume = process.CanResume && process.GetIsProcessAdmin(user);

                this.CanRestore = process.CanRestore && (process.GetInAssignees(originalActivityID, user) || process.GetIsProcessAdmin(user));

                this.CanWithdraw = process.CanWithdraw(user);
                this.CanCancel   = process.CanCancel(originalActivityID, user);
            }

            return(this);
        }