Esempio n. 1
0
        /// <summary>
        /// 注册校验类
        /// </summary>
        /// <param name="type"></param>
        public static void RegisterClass(Type type)
        {
            ValidatorSchema os = WboSchemaRegisterUtils.BuildObjectSchema <ValidatorSchema>(type);

            if (!ValidatorSchemaContainer.Instance().Contains(os.Id))
            {
                ValidatorSchemaContainer.Instance().AddItem(os.Id, os);
            }
        }
Esempio n. 2
0
        private static Validator CreateValidator(string name)
        {
            WboSchema objSchema = ValidatorSchemaContainer.Instance().GetItem(name);
            object    obj       = ObjectFactory.CreateObject(objSchema);

            if (!(obj is Validator))
            {
                throw new XException("加载的对象没有继承校验接口,不是校验器类型");
            }
            return(obj as Validator);
        }
Esempio n. 3
0
        public List <ValidatorSchema> GetValidatorSchemaList()
        {
            List <ValidatorSchema> ret = new List <ValidatorSchema>();

            string[] Ids = ValidatorSchemaContainer.Instance().GetSchemaIds();
            for (int i = 0; i < Ids.Length; i++)
            {
                string          id = Ids[i];
                ValidatorSchema vs = ValidatorSchemaContainer.Instance().GetItem(id);
                ret.Add(vs);
            }
            return(ret);
        }
Esempio n. 4
0
 public string[] GetValidatorSchemaIds()
 {
     return(ValidatorSchemaContainer.Instance().GetSchemaIds());
 }
Esempio n. 5
0
 public ValidatorSchema GetValidatorSchema(string id)
 {
     return(ValidatorSchemaContainer.Instance().GetItem(id));
 }