Exemplo n.º 1
0
        /**
         * Propagates a valid state change notification from one of the contact blocks
         * to the entire pane.
         */

        private void block_ValidStateChanged(object sender, ValidStateEventArgs e)
        {
            if (e.IsValid)
            {
                _blockValidationErrors.Remove(sender);
                if (_blockValidationErrors.Count > 0)
                {
                    IEnumerator errEnumerator = _blockValidationErrors.GetEnumerator();
                    errEnumerator.MoveNext();
                    HashMap.Entry entry = (HashMap.Entry)errEnumerator.Current;
                    OnValidStateChanged((ValidStateEventArgs)entry.Value);
                }
                else
                {
                    OnValidStateChanged(new ValidStateEventArgs(true));
                }
            }
            else
            {
                _blockValidationErrors[sender] = e;
                OnValidStateChanged(e);
            }
        }