Example #1
0
 public SimpleType AddSimpleObject(Type type, string caption, NameSpace nameSpace, string description)
 {
     var t = ObjectSpace.FindObject<SimpleType>(new BinaryOperator("FullName", type.FullName));
     if (t == null)
     {
         t = ObjectSpace.CreateObject<SimpleType>();
         t.名称 = type.Name;
         t.Caption = caption;
         t.Category = nameSpace;
         t.Description = description;
         t.FullName = type.FullName;
     }
     return t;
 }
        public static BusinessObject AddBusinessObject(Type type, string caption, NameSpace nameSpace, string description, bool isRuntimeDefine,IObjectSpace ObjectSpace)
        {
            var t = ObjectSpace.FindObject<BusinessObject>(new BinaryOperator("FullName", type.FullName),true);
            if (t == null)
            {
                t = ObjectSpace.CreateObject<BusinessObject>();
                t.DisableCreateGenericParameterValues = true;
                t.Category = nameSpace;
                t.名称 = type.Name;
                t.Caption = caption;
                t.Description = description;
                t.FullName = type.FullName;
                //t.CanCustomLogic = typeof(ICustomLogic).IsAssignableFrom(type);

                t.IsGenericTypeDefine = type.IsGenericType;

                t.IsRuntimeDefine = isRuntimeDefine;
            }
            return t;
        }