internal NHNestedObjectSpace(ITypesInfo typesInfo, IEntityStore entityStore, IPersistenceManager persistenceManager, Dictionary<object, ObjectSpaceInstanceInfo> instances, NHObjectSpace parentObjectSpace) : base(typesInfo, entityStore, persistenceManager, instances, null) { this.parentObjectSpace = parentObjectSpace; }
public NHServerCollection(NHObjectSpace objectSpace, Type objectType, CriteriaOperator criteria, IList<SortProperty> sorting) { this.objectSpace = objectSpace; this.objectType = objectType; this.criteria = criteria; this.defaultSorting = BaseObjectSpace.ConvertSortingToString(sorting); keyExpression = objectSpace.GetKeyPropertyName(objectType); ITypeInfo typeInfo = objectSpace.TypesInfo.FindTypeInfo(objectType); entityServerModeFrontEnd = new EntityServerModeFrontEnd(this); serverModeSourceAdderRemover = new NHServerModeSourceAdderRemover(entityServerModeFrontEnd, objectSpace, objectType); InitQueryableSource(); entityServerModeFrontEnd.CatchUp(); }
public NHServerModeSourceAdderRemover(Object serverModeSource, NHObjectSpace objectSpace, Type objectType) { this.serverModeSource = serverModeSource; this.objectSpace = objectSpace; this.objectType = objectType; listServer = serverModeSource as IListServer; listServerHints = serverModeSource as IListServerHints; bindingList = serverModeSource as IBindingList; typedList = serverModeSource as ITypedList; dxCloneable = serverModeSource as IDXCloneable; addedObjects = new List<Object>(); addedObjectsDictionary = new Dictionary<Object, Byte>(); removedObjectsDictionary = new Dictionary<Object, Byte>(); bindingList.ListChanged += new ListChangedEventHandler(bindingList_ListChanged); ITypeInfo typeInfo = objectSpace.TypesInfo.FindTypeInfo(objectType); propertyDescriptorCollection = new XafPropertyDescriptorCollection(typeInfo); foreach (IMemberInfo memberInfo in NHObjectSpace.GetDefaultDisplayableMembers(typeInfo)) { propertyDescriptorCollection.CreatePropertyDescriptor(memberInfo, memberInfo.Name); } }
public void Dispose() { isDisposed = true; ListChanged = null; if (objects != null) { objects.Clear(); objects = null; } if (objectSpace != null) { objectSpace.ObjectReloaded -= new EventHandler<ObjectManipulatingEventArgs>(ObjectSpace_ObjectReloaded); objectSpace = null; } propertyDescriptorCollection = null; }
public NHCollection(NHObjectSpace objectSpace, Type objectType, CriteriaOperator criteria, IList<SortProperty> sorting, Boolean inTransaction) { this.objectSpace = objectSpace; this.objectType = objectType; this.criteria = criteria; this.sorting = new List<SortProperty>(); if (sorting != null) { this.sorting.AddRange(sorting); } this.inTransaction = inTransaction; propertyDescriptorCollection = new XafPropertyDescriptorCollection(objectSpace.TypesInfo.FindTypeInfo(objectType)); foreach (IMemberInfo memberInfo in NHObjectSpace.GetDefaultDisplayableMembers(propertyDescriptorCollection.TypeInfo)) { propertyDescriptorCollection.CreatePropertyDescriptor(memberInfo, memberInfo.Name); } newObjectIndex = -1; allowNew = true; allowEdit = true; allowRemove = true; objectSpace.ObjectReloaded += new EventHandler<ObjectManipulatingEventArgs>(ObjectSpace_ObjectReloaded); }