public CellValidationErrorRoutedEventArgs( RoutedEvent routedEvent, object source, CellValidationError cellValidationError )
      : base( routedEvent, source )
    {
      if( cellValidationError == null )
        throw new ArgumentNullException( "cellValidationError" );

      m_cellValidationError = cellValidationError;
    }
    public CellValidationErrorRoutedEventArgs( CellValidationError cellValidationError )
      : base()
    {
      if( cellValidationError == null )
        throw new ArgumentNullException( "cellValidationError" );

      m_cellValidationError = cellValidationError;
    }
Beispiel #3
0
        public CellValidationErrorRoutedEventArgs(RoutedEvent routedEvent, object source, CellValidationError cellValidationError)
            : base(routedEvent, source)
        {
            if (cellValidationError == null)
            {
                throw new ArgumentNullException("cellValidationError");
            }

            m_cellValidationError = cellValidationError;
        }
Beispiel #4
0
        public CellValidationErrorRoutedEventArgs(CellValidationError cellValidationError)
            : base()
        {
            if (cellValidationError == null)
            {
                throw new ArgumentNullException("cellValidationError");
            }

            m_cellValidationError = cellValidationError;
        }
Beispiel #5
0
 internal void SetCellValidationError(CellValidationError value)
 {
     m_cellValidationError = value;
 }
Beispiel #6
0
 internal void SetCellValidationError( CellValidationError value )
 {
   m_cellValidationError = value;
 }
Beispiel #7
0
    internal void SetValidationError( CellValidationError value )
    {
      if( value != this.ValidationError )
      {
        if( value != null )
        {
          this.SetValue( Cell.ValidationErrorPropertyKey, value );
        }
        else
        {
          this.SetValue( Cell.ValidationErrorPropertyKey, DependencyProperty.UnsetValue );
        }

        CellState cellState = this.GetEditCachedState();

        if( cellState != null )
          cellState.SetCellValidationError( value );
      }
    }
Beispiel #8
0
    private void UpdateHasErrorFlags( CellValidationError cellValidationError )
    {
      bool hasValidationError = ( cellValidationError != null );

      try
      {
        if( hasValidationError )
        {
          this.HasCellEditorError = Cell.GetIsCellEditorError( cellValidationError );
          this.HasUIValidationError = Cell.GetIsUIValidationError( cellValidationError );
          this.HasContentBindingValidationError = Cell.GetIsContentBindingValidationError( cellValidationError );

          this.SetIsValidationErrorRestrictive( Cell.GetIsValidationErrorRestrictive( cellValidationError ) );

          this.SetHasValidationError( true );
        }
        else
        {
          this.HasCellEditorError = false;
          this.HasUIValidationError = false;
          this.HasContentBindingValidationError = false;

          this.SetIsValidationErrorRestrictive( false );

          this.SetHasValidationError( false );
        }

        // This flag is raised in the PropertyChanged callbacks of the Has_X_Error properties in order to
        // minimize the calls to the cell's parent row's UpdateHasErrorFlags method.
        if( this.HasPendingSyncParentErrorFlags )
        {
          ColumnBase column = this.ParentColumn;

          if( column != null )
            column.SetHasValidationError( hasValidationError );

          Row row = this.ParentRow;

          if( row != null )
            row.UpdateHasErrorFlags( this );
        }
      }
      finally
      {
        this.HasPendingSyncParentErrorFlags = false;
      }
    }
Beispiel #9
0
    private void SetAllError( ValidationResult result, Exception validationException, CellValidationRule ruleInError )
    {
      bool invalid = ( !result.IsValid );

      if( invalid )
      {
        CellValidationError validationError =
          new CellValidationError( ruleInError, this, result.ErrorContent, validationException );

        this.SetValidationError( validationError );
      }
      else
      {
        this.SetValidationError( null );
      }
    }
Beispiel #10
0
    internal static bool GetIsValidationErrorRestrictive( CellValidationError cellValidationError )
    {
      if( cellValidationError == null )
        return false;

      return Cell.GetIsRuleInErrorRestrictive( cellValidationError.RuleInError );
    }
Beispiel #11
0
    internal static bool GetIsContentBindingValidationError( CellValidationError validationError )
    {
      if( validationError == null )
        return false;

      return validationError.RuleInError is CellContentBindingValidationRule;
    }
Beispiel #12
0
    internal static bool GetIsCellEditorError( CellValidationError validationError )
    {
      if( validationError == null )
        return false;

      return validationError.RuleInError is CellEditorValidationRule;
    }
Beispiel #13
0
    internal static bool GetIsUIValidationError( CellValidationError validationError )
    {
      if( validationError == null )
        return false;

      return ( !Cell.GetIsContentBindingValidationError( validationError ) ) && ( !Cell.GetIsCellEditorError( validationError ) );
    }