示例#1
0
        protected virtual void OnSelectedDateTimeChanging(SelectedDateTimeChangingEventArgs e)
        {
            e.Cancel = false;

            if (SelectedDateTimeChanging != null)
                SelectedDateTimeChanging(this, e);
        }
示例#2
0
        private void SetSelectedDateTime(DateTime? dt)
        {
            var oldValue = selectedDateTime;
            var newValue = dt;

            var changeArgs = new SelectedDateTimeChangingEventArgs(newValue, oldValue);
            OnSelectedDateTimeChanging(changeArgs);

            if (changeArgs.Cancel)
            {
                if(string.IsNullOrEmpty(changeArgs.Message))
                {
                    Error.SetError(this, FALocalizeManager.Instance.GetLocalizer().GetLocalizedString(StringID.Validation_Cancel));
                }
                else
                {
                    Error.SetError(this, changeArgs.Message);
                }

                return;
            }

            if(!string.IsNullOrEmpty(changeArgs.Message))
            {
                Error.SetError(this, changeArgs.Message);
            }
            else
            {
                Error.SetError(this, string.Empty);
            }

            selectedDateTime = changeArgs.NewValue;
            OnSelectedDateTimeChanged(EventArgs.Empty);

            UpdateTextValue();
        }
示例#3
0
 private void faDatePicker_SelectedDateTimeChanging(object sender, SelectedDateTimeChangingEventArgs e)
 {
     AddItem(sender, "SelectedDateTimeChanging");
 }