Beispiel #1
0
        /// <summary>
        /// Raises the <see cref="ColumnChanged" /> event.
        /// </summary>
        /// <param name="column">The <see cref="TransValueColumn"/> which has raised the event.</param>
        /// <param name="value">The changed value.</param>
        public virtual void OnColumnChanged(TransValueColumn column, object value)
        {
            if (!SuppressEntityEvents)
            {
                TransValueEventHandler handler = ColumnChanged;
                if (handler != null)
                {
                    handler(this, new TransValueEventArgs(column, value));
                }

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

            if (!SuppressEntityEvents)
            {
                TransValueEventHandler handler = ColumnChanging;
                if (handler != null)
                {
                    handler(this, new TransValueEventArgs(column, value));
                }
            }
        }
Beispiel #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(TransValueColumn column)
        {
            switch (column)
            {
            case TransValueColumn.TransNum:
                return(entityData.TransNum != _originalData.TransNum);

            case TransValueColumn.Amount:
                return(entityData.Amount != _originalData.Amount);

            case TransValueColumn.Frcustomer:
                return(entityData.Frcustomer != _originalData.Frcustomer);

            case TransValueColumn.Forex:
                return(entityData.Forex != _originalData.Forex);

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