コード例 #1
0
        /// <summary>
        /// Raises the <see cref="ColumnChanged" /> event.
        /// </summary>
        /// <param name="column">The <see cref="ScrapReasonColumn"/> which has raised the event.</param>
        /// <param name="value">The changed value.</param>
        public virtual void OnColumnChanged(ScrapReasonColumn column, object value)
        {
            if (!SuppressEntityEvents)
            {
                ScrapReasonEventHandler handler = ColumnChanged;
                if (handler != null)
                {
                    handler(this, new ScrapReasonEventArgs(column, value));
                }

                // warn the parent list that i have changed
                OnEntityChanged();
            }
        }
コード例 #2
0
        /// <summary>
        /// Raises the <see cref="ColumnChanging" /> event.
        /// </summary>
        /// <param name="column">The <see cref="ScrapReasonColumn"/> which has raised the event.</param>
        /// <param name="value">The changed value.</param>
        public virtual void OnColumnChanging(ScrapReasonColumn column, object value)
        {
            if (IsEntityTracked && EntityState != EntityState.Added && !EntityManager.TrackChangedEntities)
            {
                EntityManager.StopTracking(entityTrackingKey);
            }

            if (!SuppressEntityEvents)
            {
                ScrapReasonEventHandler handler = ColumnChanging;
                if (handler != null)
                {
                    handler(this, new ScrapReasonEventArgs(column, value));
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Determines whether the property value has changed from the original data.
        /// </summary>
        /// <param name="column">The column.</param>
        /// <returns>
        ///     <c>true</c> if the property value has changed; otherwise, <c>false</c>.
        /// </returns>
        public bool IsPropertyChanged(ScrapReasonColumn column)
        {
            switch (column)
            {
            case ScrapReasonColumn.ScrapReasonId:
                return(entityData.ScrapReasonId != _originalData.ScrapReasonId);

            case ScrapReasonColumn.Name:
                return(entityData.Name != _originalData.Name);

            case ScrapReasonColumn.ModifiedDate:
                return(entityData.ModifiedDate != _originalData.ModifiedDate);

            default:
                return(false);
            }
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ScrapReasonComparer"/> class.
 /// </summary>
 /// <param name="column">The column to sort on.</param>
 public ScrapReasonComparer(ScrapReasonColumn column)
 {
     this.whichComparison = column;
 }
コード例 #5
0
 ///<summary>
 /// Initalizes a new Instance of the ScrapReasonEventArgs class.
 ///</summary>
 public ScrapReasonEventArgs(ScrapReasonColumn column, object value)
 {
     this.column = column;
     this.value  = value;
 }
コード例 #6
0
 ///<summary>
 /// Initalizes a new Instance of the ScrapReasonEventArgs class.
 ///</summary>
 public ScrapReasonEventArgs(ScrapReasonColumn column)
 {
     this.column = column;
 }
コード例 #7
0
 /// <summary>
 /// Raises the <see cref="ColumnChanged" /> event.
 /// </summary>
 /// <param name="column">The <see cref="ScrapReasonColumn"/> which has raised the event.</param>
 public virtual void OnColumnChanged(ScrapReasonColumn column)
 {
     OnColumnChanged(column, null);
     return;
 }