public override void Notify(BoundListEventType eventType)
        {
            var session = OwnerRecord.Session;

            switch (eventType)
            {
            case BoundListEventType.SavingChanges:
                if (OwnerRecord.Status == EntityStatus.Deleting)
                {
                    return;
                }
                if (IsLoaded && IsOrdered && Modified)
                {
                    AssignPersistentOrder();
                }
                break;

            case BoundListEventType.SavedChanges:
                if (session.RecordsChanged.Any(r => r.EntityInfo == TargetEntity))
                {
                    Entities = null; //to force reload
                }
                Modified = false;
                break;

            case BoundListEventType.CanceledChanges:
                Entities = null;
                Modified = false;
                break;
            } //switch
        }     //method
Example #2
0
        public override void Notify(BoundListEventType eventType)
        {
            var session = OwnerRecord.Session;

            switch (eventType)
            {
            case BoundListEventType.SavingChanges:
                if (!IsLoaded || !Modified)
                {
                    return;
                }
                UpdateLinkRecords();
                break;

            case BoundListEventType.SavedChanges:
                // We effectively force reload of each m2m list if a single link entity was modified/added/deleted
                // - even if all changes went thru this list, and it is up to date.
                // TODO: maybe add a flag to EntitySession to on/off this force reload of all lists
                var linkEnt = OwnerMember.ChildListInfo.LinkEntity;
                if (session.RecordsChanged.Any(r => r.EntityInfo == linkEnt))
                {
                    Entities = null; //to force reload
                }
                Modified = false;
                break;

            case BoundListEventType.CanceledChanges:
                LinkRecordsLookup.Clear();
                Modified = false;
                Entities = null; //to force reload
                break;
            }//switch
        }//method
 public abstract void Notify(BoundListEventType eventType);