/// <summary>
        /// This method is used to report all changes on this ComplexObject to its parent entity or ComplexObject
        /// </summary>
        /// <param name="entityMemberName">
        /// Should be null in this method override.
        /// This is only relevant in Entity's implementation of this method, so it is unused here
        /// Instead of passing the most-derived property name up the hierarchy, we will always pass the current _parentPropertyName
        /// Once this gets up to the Entity, it will actually use the value that was passed in.
        /// </param>
        /// <param name="complexObject">
        /// The instance of the object on which the property is changing.
        /// </param>
        /// <param name="complexMemberName">
        /// The name of the changing property on complexObject.
        /// </param>
        internal override sealed void ReportComplexPropertyChanged(
            string entityMemberName, ComplexObject complexObject, string complexMemberName)
        {
            // entityMemberName is unused here because we just keep passing the current parent name up the hierarchy
            // This value is only used in the EntityObject override of this method

            Debug.Assert(complexObject != null, "invalid complexObject");
            Debug.Assert(!String.IsNullOrEmpty(complexMemberName), "invalid complexMemberName");

            if (null != _parent)
            {
                _parent.ReportComplexPropertyChanged(_parentPropertyName, complexObject, complexMemberName);
            }
        }
Example #2
0
        /// <summary>
        /// This method is called by a ComplexObject contained in this Entity 
        /// whenever a change has been made to a property of the  
        /// ComplexObject so that the change can be forwarded to the change tracker.
        /// </summary>
        /// <param name="entityMemberName">
        /// The name of the top-level entity property that contains the ComplexObject that is calling this method.
        /// </param>
        /// <param name="complexObject">
        /// The instance of the ComplexObject on which the property is changing.
        /// </param>
        /// <param name="complexMemberName">
        /// The name of the changing property on complexObject.
        /// </param>        
        internal sealed override void ReportComplexPropertyChanged(
            string entityMemberName, ComplexObject complexObject, string complexMemberName)
        {
            Debug.Assert(complexObject != null, "invalid complexObject");
            Debug.Assert(!String.IsNullOrEmpty(complexMemberName), "invalid complexMemberName");

            EntityChangeTracker.EntityComplexMemberChanged(entityMemberName, complexObject, complexMemberName);
        }