Esempio n. 1
0
        /// <summary>
        /// Executed when existing object is updated. Raises Changed event.
        /// </summary>
        ///
        public override void OnUpdated(GenericObject item, string reason = null)
        {
            if (ForwardChangedEventsToDatabase)
            {
                Database.OnUpdated(item, reason);
            }

            base.OnUpdated(item, reason);
        }
Esempio n. 2
0
        /// <summary>
        /// Executed when properites (or relationships) of an existing object in
        /// database are updated.
        /// </summary>
        ///
        public virtual void OnUpdated(GenericObject item, string reason)
        {
            IsDirty = true;

            if (this.changed != null)
            {
                this.changed(item, ChangeType.Updated, reason);
            }
        }
Esempio n. 3
0
        /////////////////////////////////////////////////////////////////////////////////

        #region [ Overriden Virtual Methods Equals() and GetHashCode() ]

        /// <summary>
        /// Determines whether this instance and a specified object are the same.
        /// Objects are the same if they have both type and neigher of them is null
        /// and they have same ID.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>true if obj type is the same type and they have same IDs;
        /// otherwise, false.</returns>
        ///
        public override bool Equals(object obj)
        {
            // Return false if obj is either null or if it is not of
            // the same type as our instance.
            //
            GenericObject otherObject = obj as GenericObject;

            if (obj == null)
            {
                return(false);
            }

            // Two GenericObject are same if have the same ID
            //
            return(this.ID == otherObject.ID);
        }