/// <summary> /// Initializes a new instance of the <see cref="PersistEntity"/> class /// copied from the specified <paramref name="entity"/>. /// </summary> /// <param name="entity">The entity.</param> /// <exception cref="ArgumentNullException"><paramref name="entity"/> is null.</exception> protected PersistEntity(PersistEntity entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } _persistChange = entity._persistChange; }
/// <summary> /// Initializes a new instance of the <see cref="EntityItem<TEntity>"/> class /// copied from the specified <paramref name="item"/>. /// </summary> /// <param name="item">The item.</param> /// <exception cref="ArgumentNullException"><paramref name="item"/> is null.</exception> public EntityItem(EntityItem <TEntity> item) { if (item == null) { throw new ArgumentNullException("item"); } this._entity = item._entity; this._persistChange = item._persistChange; this._persistEntity = item._persistEntity; }
/// <summary> /// Initializes a new instance of the <see cref="EntityItem<TEntity>"/> class /// with the specified <see cref="PersistChange"/>. /// </summary> /// <param name="entity">The entity.</param> /// <param name="persistChange">The persist change.</param> /// <exception cref="ArgumentNullException"><paramref name="entity"/> is null.</exception> public EntityItem(TEntity entity, PersistChange persistChange) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } _entity = entity; _persistEntity = entity as PersistEntity; if (_persistEntity != null) { _persistEntity.PropertyChanged += new PropertyChangedEventHandler(Entity_PropertyChanged); } _persistChange = persistChange; }