Beispiel #1
0
 public Snapshot(ScalarValidation source)
 {
     _source       = source;
     _showAll      = source._showAll;
     _progress     = source._progress;
     _valueChanged = source._progress;
 }
Beispiel #2
0
        internal override void FlushCore(T element, bool isFlushing, bool isProgressiveFlushing)
        {
            var valueChanged = DoFlush(element);
            var makeProgress = isProgressiveFlushing || IsValidationVisible;

            ScalarValidation.OnFlushed(this, makeProgress, valueChanged);
        }
Beispiel #3
0
        /// <inheritdoc/>
        public override bool SubmitInput(bool focusToErrorInput = true)
        {
            RequireLayoutManager();

            if (IsEditing)
            {
                CurrentRow.EndEdit();
            }

            if (IsEditing)
            {
                return(false);
            }

            RowValidation.Validate();
            ScalarValidation.Validate();
            if (!CanSubmitInput)
            {
                if (focusToErrorInput)
                {
                    LayoutManager.FocusToInputError();
                }
                return(false);
            }

            return(true);
        }
Beispiel #4
0
 /// <summary>
 /// Determines whether validation error exists.
 /// </summary>
 /// <param name="flowIndex">The flow index.</param>
 /// <returns><see langword="true"/> if validation error exists, otherwise <see langword="false"/>.</returns>
 public bool HasValidationError(int flowIndex = 0)
 {
     if (flowIndex < 0 || flowIndex >= InputManager.FlowRepeatCount)
     {
         throw new ArgumentOutOfRangeException(nameof(flowIndex));
     }
     return(ScalarValidation.HasError(this, flowIndex, true));
 }
Beispiel #5
0
 /// <summary>
 /// Gets the validation info.
 /// </summary>
 /// <param name="flowIndex">The flow index.</param>
 /// <returns>The validation info.</returns>
 public ValidationInfo GetValidationInfo(int flowIndex = 0)
 {
     if (flowIndex < 0 || flowIndex >= InputManager.FlowRepeatCount)
     {
         throw new ArgumentOutOfRangeException(nameof(flowIndex));
     }
     return(ScalarValidation.GetInfo(this, flowIndex));
 }
Beispiel #6
0
        /// <summary>
        /// Tries to submit data input with validation.
        /// </summary>
        /// <param name="focusToErrorInput">A value indicates whether the UI element with validation error should have keyboard focus.</param>
        /// <returns><see langword="true"/> if data input submitted sccessfully, otherwise <see langword="false"/>.</returns>
        public virtual bool SubmitInput(bool focusToErrorInput = true)
        {
            RequireLayoutManager();

            ScalarValidation.Validate();
            if (!CanSubmitInput)
            {
                if (focusToErrorInput)
                {
                    LayoutManager.FocusToInputError();
                }
                return(false);
            }

            return(true);
        }
Beispiel #7
0
 void ScalarContainer.IOwner.OnEndEdit()
 {
     ScalarValidation.ExitEdit();
 }
Beispiel #8
0
 void ScalarContainer.IOwner.OnCancelEdit()
 {
     ScalarValidation.CancelEdit();
 }
Beispiel #9
0
 void ScalarContainer.IOwner.OnBeginEdit()
 {
     ScalarValidation.EnterEdit();
 }