예제 #1
0
        private static void CreateAttributes(XPTypeInfo ti, IPersistentTypeInfo info)
        {
            throw new NotImplementedException();
//            foreach (IPersistentAttributeInfo a in info.TypeAttributes) {
//                ti.AddAttribute(a.Create());
//            }
        }
예제 #2
0
        private static void CreateAttributes(XPTypeInfo ti,IPersistentTypeInfo info)
        {
            throw new NotImplementedException();
//            foreach (IPersistentAttributeInfo a in info.TypeAttributes) {
//                ti.AddAttribute(a.Create());
//            }
        }
예제 #3
0
        public static void SetTypeValue(this IPersistentTypeInfo persistentTypeInfo, ref IPersistentClassInfo persistentClassInfo, ref Type type, string typeFullName)
        {
            var session = persistentTypeInfo.Session;

            if (!string.IsNullOrEmpty(typeFullName))
            {
                IPersistentClassInfo classInfo = PersistentClassInfoQuery.Find(session, typeFullName);
                if (classInfo != null)
                {
                    persistentClassInfo = classInfo;
                }
                else
                {
                    type = ReflectionHelper.GetType(typeFullName.Substring(typeFullName.LastIndexOf(".", StringComparison.Ordinal) + 1));
                }
            }
        }
예제 #4
0
        protected override string GetPredefinedValues(IModelMember wrapper)
        {
            var currentObject = (IPersistentModelDefaultAttribute)View.CurrentObject;

            if (currentObject == null)
            {
                return(null);
            }

            IPersistentTypeInfo owner = currentObject.Owner;

            if (owner is IExtendedMemberInfo || owner is IPersistentMemberInfo)
            {
                return(GetModelProperties <IModelMember>());
            }
            if (owner is IPersistentClassInfo)
            {
                return(GetModelProperties <IModelClass>());
            }

            return(null);
        }
예제 #5
0
 static string GetAttributesCode(IPersistentTypeInfo persistentClassInfo)
 {
     return((persistentClassInfo.TypeAttributes.Aggregate <IPersistentAttributeInfo, string>(null, (current, persistentAttributeInfo) => current + GenerateCode(persistentAttributeInfo) + Environment.NewLine) + "").TrimEnd(Environment.NewLine.ToCharArray()));
 }
예제 #6
0
 static string GetInjectCode(IPersistentTypeInfo persistentTypeInfo)
 {
     return(persistentTypeInfo.TemplateInfos.Aggregate <ITemplateInfo, string>(null, (current, codeTemplate) => current + (codeTemplate.TemplateCode + Environment.NewLine)));
 }
예제 #7
0
 static string GetAttributesCode(IPersistentTypeInfo persistentClassInfo) {
     return (persistentClassInfo.TypeAttributes.Aggregate<IPersistentAttributeInfo, string>(null, (current, persistentAttributeInfo) => current + GenerateCode(persistentAttributeInfo) + Environment.NewLine) + "").TrimEnd(Environment.NewLine.ToCharArray());
 }
예제 #8
0
 static string GetInjectCode(IPersistentTypeInfo persistentTypeInfo) {
     return persistentTypeInfo.TemplateInfos.Aggregate<ITemplateInfo, string>(null, (current, codeTemplate) => current + (codeTemplate.TemplateCode + Environment.NewLine));
 }