private DomainObject ConstructDynamicObject(Type objectType, TypeDefine define) { var constructor = ConstructorRepositoryAttribute.GetDynamicConstructor(objectType); using (var temp = ArgsPool.Borrow2()) { var args = temp.Item; args[0] = define; args[1] = false; //不为空 empty参数 return((DomainObject)constructor.CreateInstance(args)); } }
public BaseDataModule() { InitializeComponent(); foreach (TypeDefine td in TypeDefine.GetListing()) { repositoryItemComboBox1.Items.Add(td.称); } foreach (BaseData data in BaseData.GetAllBaseData()) { baseDatas.Add(data); } gridControl1.DataSource = baseDatas; }
private void AssertMenu(DomainProperty property) { //menu:{person:{id:'long',name:'string,5'},name:'string,10',parent:'menu',childs:['menu']} AssertPropertyObject(property, "Menu", "AdminMenu"); var ps = DomainProperty.GetProperties(property.PropertyType).ToArray(); AssertPropertyObject(ps[0], "Person", "AdminMenuPerson"); var person = ps[0]; var personProperties = DomainProperty.GetProperties(person.PropertyType).ToArray(); AssertPropertyValue(personProperties[0], "Id", typeof(long)); AssertPropertyValue(personProperties[1], "Name", typeof(string)); AssertPropertyValue(ps[1], "Name", typeof(string)); AssertPropertyObject(ps[2], "Parent", "AdminMenu"); var childsType = TypeDefine.GetListType(property.PropertyType); AssertPropertyList(ps[3], "Childs", childsType); }