Esempio n. 1
0
        /// <summary>
        /// Called to remove change notification handlers from the object.
        /// </summary>
        /// <param name="_object">
        /// The object containing presumably 1 or more CProperty fields
        /// </param>
        /// <param name="_changeHandler">
        /// The handler to be removed from each CProperty field in the object
        /// </param>
        public static void RemoveChangeHandler(object _object, DPropertyChange _changeHandler)
        {
            if (_object == null)
            {
                throw new ArgumentNullException("Must specify an object");
            }

            foreach (var prop in GetCPropertiesOnObject(_object))
            {
                prop.OnPropertyChange -= _changeHandler;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Called to register change notification handlers with the object. This method will
        /// register the change handler with ALL CProperty fields in the object.
        /// </summary>
        /// <param name="_object">
        /// The object containing presumably 1 or more CProperty fields
        /// </param>
        /// <param name="_changeHandler">
        /// The handler to be registered with each CProperty field in the object
        /// </param>
        public static void RegisterChangeHandler(object _object, DPropertyChange _changeHandler)
        {
            if (_object == null)
            {
                throw new ArgumentNullException("Must specify an object");
            }

            foreach (var prop in GetCPropertiesOnObject(_object))
            {
                prop.OnPropertyChange += _changeHandler;
                var x = prop.OnPropertyChange.GetInvocationList();
            }
        }