コード例 #1
0
        void OnEntityPropertyChanged(OEEntityEntry entityEntry, string propertyName)
        {
            var entityChangedHandler = EntityPropertyChanged;

            if (entityChangedHandler != null)
            {
                entityChangedHandler(this, new EntityEntryPropertyChangedEventArgs(entityEntry, propertyName));
            }
        }
コード例 #2
0
        void OnEntityChanged(OEEntityEntry entityEntry)
        {
            var entityChangedHandler = EntityChanged;

            if (entityChangedHandler != null)
            {
                entityChangedHandler(this, new EntityEntryEventArgs(entityEntry));
            }
        }
コード例 #3
0
        internal OEEntityEntry AttachEntry <TEntity>(TEntity entity, OEEntitySet entitySet) where TEntity : class
        {
            var entityEntry = _trackingEntityCollection.FirstOrDefault(p => p.Entity == entity);

            if (entityEntry == null)
            {
                entityEntry = new OEEntityEntry(entity, entitySet)
                {
                    State = OEEntityState.Unchanged
                };
                _trackingEntityCollection.Add(entityEntry);
                if (typeof(INotifyPropertyChanged).IsAssignableFrom(entity.GetType()))
                {
                    ((INotifyPropertyChanged)entity).PropertyChanged += Entity_PropertyChanged;
                }
            }

            return(entityEntry);
        }
コード例 #4
0
 internal EntityEntryEventArgs(OEEntityEntry entityEntry)
 {
     EntityEntry = entityEntry;
 }
コード例 #5
0
 internal EntityEntryPropertyChangedEventArgs(OEEntityEntry entityEntry, string propertyName)
 {
     EntityEntry  = entityEntry;
     PropertyName = propertyName;
 }