protected virtual void OnSelectedDateTimeChanging(SelectedDateTimeChangingEventArgs e) { e.Cancel = false; if (SelectedDateTimeChanging != null) SelectedDateTimeChanging(this, e); }
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(); }
private void faDatePicker_SelectedDateTimeChanging(object sender, SelectedDateTimeChangingEventArgs e) { AddItem(sender, "SelectedDateTimeChanging"); }