private void CheckActivityType(WfClientActivityType activityType, string errorMessage)
 {
     foreach (WfClientActivityDescriptor act in base.List)
     {
         (act.ActivityType == activityType).TrueThrow(Translator.Translate(Define.DefaultCulture, errorMessage));
     }
 }
        protected override WfClientKeyedDescriptorBase CreateInstance(string key, IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientActivityType activityType = DictionaryHelper.GetValue(dictionary, "activityType", WfClientActivityType.NormalActivity);

            return(new WfClientActivityDescriptor(activityType)
            {
                Key = key
            });
        }
        public static WfClientActivityDescriptor CreateSimpleClientActivityWithUser(string key, string name, string userKey, WfClientActivityType actType)
        {
            WfClientActivityDescriptor actDesp = CreateSimpleClientActivity(key, name, actType);

            actDesp.Resources.Add(new WfClientUserResourceDescriptor(Consts.Users[userKey]));
            actDesp.EnterEventReceivers.Add(new WfClientUserResourceDescriptor(Consts.Users[userKey]));
            actDesp.LeaveEventReceivers.Add(new WfClientUserResourceDescriptor(Consts.Users[userKey]));

            return actDesp;
        }
        /// <summary>
        /// 创建一个不带资源的简单活动
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="actType"></param>
        /// <returns></returns>
        public static WfClientActivityDescriptor CreateSimpleClientActivity(string key, string name, WfClientActivityType actType)
        {
            WfClientActivityDescriptor actDesp = new WfClientActivityDescriptor(actType);

            actDesp.Key = key;
            actDesp.Name = name;

            actDesp.RelativeLinks.Add(new WfClientRelativeLinkDescriptor("AR1") { Category = "Activity", Url = "http://www.ak47.com" });

            return actDesp;
        }
        public static WfClientActivityDescriptor CreateSimpleClientActivityWithUser(string key, string name, string userKey, WfClientActivityType actType)
        {
            WfClientActivityDescriptor actDesp = CreateSimpleClientActivity(key, name, actType);

            actDesp.Resources.Add(new WfClientUserResourceDescriptor(Consts.Users[userKey]));
            actDesp.EnterEventReceivers.Add(new WfClientUserResourceDescriptor(Consts.Users[userKey]));
            actDesp.LeaveEventReceivers.Add(new WfClientUserResourceDescriptor(Consts.Users[userKey]));

            return(actDesp);
        }
        /// <summary>
        /// 创建一个不带资源的简单活动
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="actType"></param>
        /// <returns></returns>
        public static WfClientActivityDescriptor CreateSimpleClientActivity(string key, string name, WfClientActivityType actType)
        {
            WfClientActivityDescriptor actDesp = new WfClientActivityDescriptor(actType);

            actDesp.Key  = key;
            actDesp.Name = name;

            actDesp.RelativeLinks.Add(new WfClientRelativeLinkDescriptor("AR1")
            {
                Category = "Activity", Url = "http://www.ak47.com"
            });

            return(actDesp);
        }
Example #7
0
 public static WfActivityType ToActivityType(this WfClientActivityType cat)
 {
     return((WfActivityType)cat);
 }
 public WfClientActivityDescriptor(WfClientActivityType activityType)
 {
     this.ActivityType = activityType;
 }