Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override bool SpinUp()
        {
            DateTimeElementEditor currentElementEditor = GetCurrentElementEditor();

            if (currentElementEditor == null)
            {
                return(false);
            }
            return(currentElementEditor.SpinUp());
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override bool Backspace()
        {
            DateTimeElementEditor currentElementEditor = GetCurrentElementEditor();

            if (currentElementEditor == null)
            {
                return(false);
            }
            return(currentElementEditor.Delete());
        }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 protected DateTimeElementEditor GetCurrentElementEditor()
 {
     if (SelectedElement != null)
     {
         bool flag = base.RaiseModifyWithoutEditValueChange();
         if (!IsElementEdited && flag)
         {
             _fCurrentElementEditor = SelectedElement.CreateElementEditor(NonEmptyCurrentValue);
         }
     }
     return(_fCurrentElementEditor);
 }
Exemple #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="insertion"></param>
        /// <returns></returns>
        public override bool Insert(string insertion)
        {
            if ((!IsElementEdited && (insertion.Length > 3)) && !Regex.IsMatch(insertion, @"^(\d+|\p{L}+)$"))
            {
                bool flag = true;
                try
                {
                    DateTime inserted     = DateTime.ParseExact(insertion, _fInitialMask, _fInitialDateTimeFormatInfo);
                    DateTime newEditValue = CorrectInsertValue(inserted);
                    if (!RaiseEditTextChanging(newEditValue))
                    {
                        return(false);
                    }
                    _fUndoValue    = CurrentValue;
                    _fCurrentValue = new DateTime?(newEditValue);
                    base.RaiseEditTextChanged();
                    flag = true;
                }
                catch
                {
                }
                return(flag);
            }
            DateTimeElementEditor currentElementEditor = GetCurrentElementEditor();

            if (currentElementEditor == null)
            {
                return(false);
            }
            if (currentElementEditor.Insert(insertion))
            {
                if (_IsOperatorMask && currentElementEditor.FinalOperatorInsert)
                {
                    base.CursorRight(false);
                }
                return(true);
            }
            if (insertion == " ")
            {
                return(base.CursorRight(false));
            }
            return((((insertion.Length > 0) && ((SelectedFormatInfoIndex + 1) < FormatInfo.Count)) && (!FormatInfo[SelectedFormatInfoIndex + 1].Editable && FormatInfo[SelectedFormatInfoIndex + 1].Format(NonEmptyCurrentValue).StartsWith(insertion))) && base.CursorRight(false));
        }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 protected void KillCurrentElementEditor()
 {
     _fCurrentElementEditor = null;
 }