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;
    }
Ejemplo n.º 3
0
        public CellValidationErrorRoutedEventArgs(RoutedEvent routedEvent, object source, CellValidationError cellValidationError)
            : base(routedEvent, source)
        {
            if (cellValidationError == null)
            {
                throw new ArgumentNullException("cellValidationError");
            }

            m_cellValidationError = cellValidationError;
        }
Ejemplo n.º 4
0
        public CellValidationErrorRoutedEventArgs(CellValidationError cellValidationError)
            : base()
        {
            if (cellValidationError == null)
            {
                throw new ArgumentNullException("cellValidationError");
            }

            m_cellValidationError = cellValidationError;
        }
Ejemplo n.º 5
0
 internal void SetCellValidationError(CellValidationError value)
 {
     m_cellValidationError = value;
 }
Ejemplo n.º 6
0
 internal void SetCellValidationError( CellValidationError value )
 {
   m_cellValidationError = value;
 }
Ejemplo n.º 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 );
      }
    }
Ejemplo n.º 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;
      }
    }
Ejemplo n.º 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 );
      }
    }
Ejemplo n.º 10
0
    internal static bool GetIsValidationErrorRestrictive( CellValidationError cellValidationError )
    {
      if( cellValidationError == null )
        return false;

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

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

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

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