示例#1
0
        /// <summary>
        /// Evento tisparado quando alguma proriedade está sendo alterada
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void col_PropertyChanging(object sender, PropertyChangingEventArgs e)
        {
            if (LockNotify || (PropertyChanging == null || PropertyChangingNotify.All(c => c != e.PropertyName)))
            {
                return;
            }

            try
            {
                LockNotify = true;
                PropertyChanging(sender, e);
            }
            finally
            {
                LockNotify = false;
            }
        }
示例#2
0
        /// <summary>
        /// Atribui as alterações ocorridas aos eventos
        /// </summary>
        void SetPropertyChangedEvents()
        {
            foreach (var col in Collumns)
            {
                col.PropertyChanged  -= col_PropertyChanged;
                col.PropertyChanging -= col_PropertyChanging;

                if (PropertyChangedNotify.Any(c => c == col.Name))
                {
                    col.PropertyChanged += col_PropertyChanged;
                }

                if (PropertyChangingNotify.Any(c => c == col.Name))
                {
                    col.PropertyChanging += col_PropertyChanging;
                }
            }
        }