protected void CreateDesignTimeCollection(ITypesInfo typesInfo, Type classType, string propertyName) { XPClassInfo info = Dictiorary.GetClassInfo(classType); if (info.FindMember(propertyName) == null) { info.CreateMember(propertyName, typeof(XPCollection), true); typesInfo.RefreshInfo(classType); } }
void RuntimeMemberBuilderOnCustomCreateMember(object sender, CustomCreateMemberArgs customCreateMemberArgs) { var modelMemberAuditTrail = customCreateMemberArgs.ModelMemberEx as IModelMemberAuditTrail; if (modelMemberAuditTrail != null) { XPClassInfo owner = Dictiorary.GetClassInfo(modelMemberAuditTrail.ModelClass.TypeInfo.Type); if (owner.FindMember(modelMemberAuditTrail.Name) == null) { new AuditTrailCollectionMemberInfo(owner, modelMemberAuditTrail.Name, modelMemberAuditTrail.CollectionType.TypeInfo.Type); } customCreateMemberArgs.Handled = true; } }
private static void CreateXpandDefaultProperty(ITypesInfo typesInfo) { var infos = typesInfo.PersistentTypes.Select(info => new{ TypeInfo = info, Attribute = info.FindAttribute <XpandDefaultPropertyAttribute>() }) .Where(arg => arg.Attribute != null).ToList(); foreach (var info in infos.Where(arg => arg.TypeInfo.Base.FindAttribute <XpandDefaultPropertyAttribute>() == null)) { var classInfo = Dictiorary.GetClassInfo(info.TypeInfo.Type); var memberInfo = new XpandCalcMemberInfo(classInfo, info.Attribute.MemberName, typeof(string), info.Attribute.Expression); if (info.Attribute.InVisibleInAllViews) { memberInfo.AddAttribute(new InvisibleInAllViewsAttribute()); } typesInfo.RefreshInfo(info.TypeInfo); ((TypeInfo)info.TypeInfo).DefaultMember = info.TypeInfo.FindMember(info.Attribute.MemberName); } }
public override void CustomizeTypesInfo(DevExpress.ExpressApp.DC.ITypesInfo typesInfo) { base.CustomizeTypesInfo(typesInfo); var typeInfos = typesInfo.PersistentTypes.Where(info => info.FindAttribute <PessimisticLockingMessageAttribute>() != null); foreach (var typeInfo in typeInfos) { var memberInfo = typeInfo.FindMember("LockedUserMessage"); if (memberInfo == null) { var xpClassInfo = Dictiorary.GetClassInfo(typeInfo.Type); var lockedUserMessageXpMemberInfo = new LockedUserMessageXpMemberInfo(xpClassInfo); lockedUserMessageXpMemberInfo.AddAttribute(new BrowsableAttribute(false)); XafTypesInfo.Instance.RefreshInfo(typeInfo); } } }