private void OpenDialogOnValueChanging(object sender, ValueChangingEventArgs e) { if (e.OldValue != null || e.NewValue != null) { e.Cancel = !File.Exists(e.NewValue.ToString()); if (!e.Cancel) { picturePanel1.BackgroundImage = FormHelper.FetchImage(e.NewValue.ToString(), 298, 182); bookModel.image_path = e.NewValue.ToString(); } } }
private void Blende_korrigieren(object sender, ValueChangingEventArgs<double> e) { if (Array.IndexOf(Blendenwert.Blendenwerte, e.NewValue) != -1) { return; } var index = Array.IndexOf(Blendenwert.Blendenwerte, e.OldValue); if (e.NewValue > e.OldValue) { index = index < Blendenwert.Blendenwerte.Length - 1 ? index + 1 : index; } else { index = index > 0 ? index - 1 : index; } blendeUpDown.Value = Blendenwert.Blendenwerte[index]; }
public void gvScholarshipDiscounts_ValueChanging(object sender, ValueChangingEventArgs e) { if (gvScholarshipDetails.CurrentRow.Index >= 0) { sDiscountSelected = new ScholarshipDiscount() { ScholarshipDiscountId = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].ScholarshipDiscountId, //ScholarshipCode = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].ScholarshipCode, //FeeID = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].FeeID, Discount = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].Discount, Deactivated = false, // FeeName = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].FeeName }; oldScholarshipDiscountList.Add(sDiscountSelected); //if (e.NewValue != e.OldValue) //{ // if (gvScholarshipDetails.CurrentColumn.Index == 2) // { // if (scholarshipDiscountList.FindAll(x => x.FeeName == e.NewValue.ToString()).Count <= 0) // { // if (oldScholarshipDiscountList.Exists(x => x.FeeName == e.NewValue.ToString()) == true) // { // ScholarshipDiscount returnedSub = new ScholarshipDiscount(); // returnedSub = oldScholarshipDiscountList.Find(x => x.FeeName == e.NewValue.ToString()); // scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].ScholarshipDiscountId = returnedSub.ScholarshipDiscountId; // scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].ScholarshipCode = returnedSub.ScholarshipCode; // oldScholarshipDiscountList.RemoveAll(x => x.ScholarshipCode == returnedSub.ScholarshipCode); // } // else // { // scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].ScholarshipDiscountId = 0; // } // scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].ScholarshipCode = this.txtScholarshipCode.Text; // scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].FeeID = this.feeid; // } // else // MessageBox.Show("Scholarship Discount for this Scholarship already exists"); // e.Cancel = true; // } // } } }
private void _inputRGB_ValueChanging(object sender, ValueChangingEventArgs <string> e) { var s = e.NewValue; if (s == null) { return; } for (var i = 0; i < s.Length; ++i) { if (InputChars.IndexOf(s[i]) == -1) { e.Cancel = true; break; } } }
private void gvSY_ValueChanging(object sender, ValueChangingEventArgs e) { if (gvSY.CurrentRow != null) { if (e.NewValue != e.OldValue) { UpdateCurrentSY(gvSY.Rows[gvSY.CurrentRow.Index].Cells[0].Value.ToString(), true); if (SYcurrent != null) { UpdateCurrentSY(SYcurrent.SY, false); SYcurrent.CurrentSY = false; Log("U", "SchoolYear", SYcurrent); } gvSY.DataSource = null; LoadSY(); } } }
private void volumeShapePointer_ValueChanging(object sender, ValueChangingEventArgs e) { string glyph; if (e.NewValue <= 0) { glyph = "\uE74F"; e.Cancel = true; } else { glyph = "\uE767"; } if (this.volumeFontIcon.Glyph != glyph) { this.volumeFontIcon.Glyph = glyph; } }
private void musicShapePointer_ValueChanging(object sender, ValueChangingEventArgs e) { string glyph; if (e.NewValue <= 0) { glyph = "\uED30"; e.Cancel = true; } else { glyph = "\uED33"; } if (this.musicFontIcon.Glyph != glyph) { this.musicFontIcon.Glyph = glyph; } }
private void alarmShapePointer_ValueChanging(object sender, ValueChangingEventArgs e) { string glyph; if (e.NewValue <= 0) { glyph = "\uE7ED"; e.Cancel = true; } else { glyph = "\uEA8F"; } if (this.alarmFontIcon.Glyph != glyph) { this.alarmFontIcon.Glyph = glyph; } }
private void stepCountShapePointer_ValueChanging(object sender, ValueChangingEventArgs e) { if (e.NewValue < 360) { e.Cancel = true; } if (e.NewValue > 8000) { this.stepCountRange.Background = new SolidColorBrush(Color.FromArgb(0xff, 0x4c, 0xaf, 0x4f)); } else if (e.NewValue > 4000) { this.stepCountRange.Background = new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0xeb, 0x3b)); } else { this.stepCountRange.Background = new SolidColorBrush(Color.FromArgb(0xff, 0xf4, 0x43, 0x36)); } }
private void radDateTimePickerElementEnd_ValueChanged(object sender, ValueChangingEventArgs e) { // enddate = IrDate.GetDateIntToStr_GivenDate(IrDate.GetLatin_FromIraniDate(IrDate.ConvDateStrToInt_GivenDate(radDateTimePickerElementEnd.Value.Value.ToShortDateString())).ToString()); ////if (IsFirstLoad == false) ////{ //// try //// { //// DateTime x = (DateTime)e.NewValue; //// enddate = x.Year + "/" + x.Month + "/" + x.Day; //// DateTime StDate = (DateTime)radDateTimePickerElementStart.Value; //// startdate = StDate.Year + "/" + StDate.Month + "/" + StDate.Day;// (DateTime.se (Select x => (DateTime) radDateTimePickerElementStart.Value());// IrDate.GetDateIntToStr_GivenDate(IrDate.GetLatin_FromIraniDate(IrDate.ConvDateStrToInt_GivenDate(radDateTimePickerElementStart.Value.Value.ToShortDateString())).ToString()); //// // FillData(startdate, enddate, SelectedProductionLines); //// // System.Threading.Thread.CurrentThread.CurrentCulture = persianCulture; //// // System.Threading.Thread.CurrentThread.CurrentUICulture = persianCulture; //// } //// catch //// { //// DateTime x = (DateTime)e.OldValue; //// startdate = x.Year + "/" + x.Month + "/" + x.Day; //// if (startdate == null) //// { //// startdate = IrDate.GetDateIntToStr_GivenDate(IrDate.GetLatin_FromIraniDate(IrDate.ConvDateStrToInt_GivenDate(radDateTimePickerElementStart.Value.Value.ToShortDateString())).ToString()); //// } //// FillData(startdate, enddate, SelectedProductionLines); //// System.Threading.Thread.CurrentThread.CurrentCulture = persianCulture; //// System.Threading.Thread.CurrentThread.CurrentUICulture = persianCulture; //// } ////} }
/// <summary> /// Changes the UI value. /// </summary> /// <param name="newValue">New value.</param> /// <param name="doChaningValue">Do changing the UI value.</param> /// <param name="onValueChanging">Trigger value changing event.</param> /// <param name="onValueChanged">Trigger value changed event.</param> public void ChangeValue( T newValue, Action doChaningValue, ValueChangingEventHandler onValueChanging, ValueChangedEventHandler onValueChanged) { Precondition.ArgumentNotNull(doChaningValue, nameof(doChaningValue)); var oldValue = _editor.Value; if (onValueChanging != null) { var args = new ValueChangingEventArgs(oldValue, newValue); onValueChanging.Invoke(_editor, args); if (args.Cancel) { return; } } doChaningValue(); onValueChanged?.Invoke(_editor, new ValueChangedEventArgs(oldValue, newValue)); }
//命令选中 /// <summary> /// 命令选中 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridViewCommand_ValueChanging(object sender, ValueChangingEventArgs e) { CurrentOperationStatus = OperationStatus.Edit; }
private void spinElement_ValueChanging(object sender, ValueChangingEventArgs e) { this.InvokeBaseMethod("spinElement_ValueChanging", sender, e); }
/// <summary> /// Called when start pointer value changing. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The value changing event arguments.</param> private void StartPointer_ValueChanging(object sender, ValueChangingEventArgs e) { this.range.StartValue = e.NewValue; this.CalculateSleepTime(); }
private void gvSubjects_ValueChanging(object sender, ValueChangingEventArgs e) { if (gvSubjects.CurrentRow.Index >= 0) { if (e.NewValue != e.OldValue) { if (gvSubjects.CurrentColumn.Index == 2) { if (subjects.FindAll(x => x.GradeLevel == e.NewValue.ToString()).Count <= 0) { subjects[gvSubjects.CurrentRow.Index].SubjectID = 0; subjects[gvSubjects.CurrentRow.Index].LearningAreaCode = this.txtLearningAreaCode.Text; subjects[gvSubjects.CurrentRow.Index].SubjectCode = this.txtLearningAreaCode.Text + e.NewValue.ToString(); gvSubjects.Rows[gvSubjects.CurrentRow.Index].Cells[0].Value = this.txtLearningAreaCode.Text + e.NewValue.ToString(); subjects[gvSubjects.CurrentRow.Index].GradeLevel = e.NewValue.ToString(); } else { MessageBox.Show("Subject for this Grade Level already exist"); e.Cancel = true; } } } } }
public void gvScholarshipDiscounts_ValueChanging(object sender, ValueChangingEventArgs e) { if (gvScholarshipDetails.CurrentRow.Index >= 0) { sDiscountSelected = new ScholarshipDiscount() { ScholarshipDiscountId = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].ScholarshipDiscountId, Discount = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].Discount, Deactivated = false, }; oldScholarshipDiscountList.Add(sDiscountSelected); } }
private void HandleItemPositionChange (object sender, ValueChangingEventArgs<PointF> args) { PointF pos = new PointF(args.Value.X, args.Value.Y); pos.X = Math.Max ((float) Math.Round(pos.X / 10.0f) * 10.0f, 50.0f); pos.Y = Math.Max ((float) Math.Round(pos.Y / 10.0f) * 10.0f, 50.0f); args.Cancel = (pos.X == args.Value.X) && (pos.Y == args.Value.Y); args.Value = pos; }
private void ZoomSliderValueChanging(object sender, ValueChangingEventArgs <int> e) { this.ZoomValue = e.Value; }
void target_UniqueIdChanging(object sender, ValueChangingEventArgs <Guid> e) { }
private void MethodNameChanging(object sender, ValueChangingEventArgs <string> e) { this.OnChanging(sender, e); }
private void HotkeyChanged(object sender, ValueChangingEventArgs <KeyOrMouseButton> e) { this.OrbwalkerMode.Key = e.Value.Key; }
private void ProtocolChanging(object sender, ValueChangingEventArgs <string> e) { this.OnChanging(sender, e); }
private void MethodTypeChanging(object sender, ValueChangingEventArgs <MethodType> e) { this.OnChanging(sender, e); }
private void ClassChanging(object sender, ValueChangingEventArgs <Class> e) { this.OnChanging(sender, e); }
private void SpinButton_ValueChanging(object sender, ValueChangingEventArgs <float?> e) { // Check that the new points sum doesnt exceed player level var player = TJ.Player; var totalLevels = 0; var spinButton = (SpinButton)sender; SpinButton spinButtonPrimary = null; foreach (var widget in _gridClasses.Widgets) { var asSpinButton = widget as SpinButton; if (asSpinButton == null) { continue; } if (asSpinButton != spinButton) { totalLevels += (int)asSpinButton.Value; } else { totalLevels += (int)e.NewValue; } if (player.Class.Id == ((Class)asSpinButton.Tag).Id) { spinButtonPrimary = asSpinButton; } } var pointsLeft = player.Level - totalLevels; if (pointsLeft < 0) { var error = Dialog.CreateMessageBox(Strings.Error, NoPointsLeft); error.ShowModal(Desktop); e.Cancel = true; return; } // Now check that non-primary class level isnt higher than primary var isPrimary = player.Class.Id == ((Class)spinButton.Tag).Id; if (!isPrimary) { if ((int)e.NewValue > (int)spinButtonPrimary.Value) { var error = Dialog.CreateMessageBox(Strings.Error, NonPrimaryLevelHigher); error.ShowModal(Desktop); e.Cancel = true; return; } } else { foreach (var widget in _gridClasses.Widgets) { var asSpinButton = widget as SpinButton; if (asSpinButton == null || asSpinButton == spinButtonPrimary) { continue; } if ((int)e.NewValue < (int)asSpinButton.Value) { var error = Dialog.CreateMessageBox(Strings.Error, PrimaryLevelLower); error.ShowModal(Desktop); e.Cancel = true; return; } } } }
void ComboBoxElement_ValueChanging(object sender, ValueChangingEventArgs e) { this.oldValue = e.OldValue; this.newValue = e.NewValue; }
/// <summary> /// 値変更前イベントを発生させる。 /// </summary> /// <param name="e">ValueChangingEventArgs</param> protected virtual void InvokeValueChanging(ValueChangingEventArgs e) { ValueChanging?.Invoke(this, e); }
private void HandleItemSizeChange (object sender, ValueChangingEventArgs<SizeF> args) { SizeF size = new SizeF(args.Value); size.Width = (float) Math.Round(size.Width / 10.0f) * 10.0f; size.Height = (float) Math.Round(size.Height / 10.0f) * 10.0f; args.Cancel = (size.Width == args.Value.Width) && (size.Height == args.Value.Height); args.Value = size; }
void VScrollBar_ValueChanging(object sender, ValueChangingEventArgs e) { SizeColumnZero(); }
private void gvSubjects_ValueChanging(object sender, ValueChangingEventArgs e) { if (gvSubjects.CurrentRow.Index >= 0) { oldsub = new Subject() { Description = subjects[gvSubjects.CurrentRow.Index].Description, GradeLevel = subjects[gvSubjects.CurrentRow.Index].GradeLevel, LArea = subjects[gvSubjects.CurrentRow.Index].LArea, LearningAreaCode = subjects[gvSubjects.CurrentRow.Index].LearningAreaCode, SubjectCode = subjects[gvSubjects.CurrentRow.Index].SubjectCode, SubjectID = subjects[gvSubjects.CurrentRow.Index].SubjectID, MPW=subjects[gvSubjects.CurrentRow.Index].MPW }; oldSubjects.Add(oldsub); if (e.NewValue != e.OldValue) { if (gvSubjects.CurrentColumn.Index == 3) { if (subjects.FindAll(x => x.GradeLevel == e.NewValue.ToString()).Count <= 0) { if (oldSubjects.Exists(x => x.GradeLevel == e.NewValue.ToString()) == true) { Subject returnedSub = new Subject(); returnedSub = oldSubjects.Find(x => x.GradeLevel == e.NewValue.ToString()); subjects[gvSubjects.CurrentRow.Index].SubjectID = returnedSub.SubjectID; subjects[gvSubjects.CurrentRow.Index].SubjectCode = returnedSub.SubjectCode; subjects[gvSubjects.CurrentRow.Index].MPW = returnedSub.MPW; oldSubjects.RemoveAll(x => x.SubjectCode == returnedSub.SubjectCode); } else { subjects[gvSubjects.CurrentRow.Index].SubjectID = 0; subjects[gvSubjects.CurrentRow.Index].SubjectCode = this.txtLearningAreaCode.Text + e.NewValue.ToString(); } subjects[gvSubjects.CurrentRow.Index].LearningAreaCode = this.txtLearningAreaCode.Text; gvSubjects.Rows[gvSubjects.CurrentRow.Index].Cells[0].Value = this.txtLearningAreaCode.Text + e.NewValue.ToString(); subjects[gvSubjects.CurrentRow.Index].GradeLevel = e.NewValue.ToString(); } else { MessageBox.Show("Subject for this Grade Level already exist"); e.Cancel = true; } } } } }
private void MessageChanging(object sender, ValueChangingEventArgs<Definitions.Description.Message> e) { if (!this.Dirty) return; if (e.Cancel) return; var dlgResult = MessageBox.Show( String.Format("Do you want to save changes to #{0}?", this.txtMethodSelector.Text), "Message", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (dlgResult == DialogResult.Yes) e.Cancel = !this.Save(); else if (dlgResult == DialogResult.No) this.ProtocolChanged(this, e); else e.Cancel = true; }
private void ProtocolChanging(object sender, ValueChangingEventArgs<Protocol> e) { if (e.Cancel) return; e.Cancel = !this.CheckSave(); }
void _global_Changing(object sender, ValueChangingEventArgs <Global> e) { throw new NotImplementedException(); }
private void ProtocolChanging(object sender, ValueChangingEventArgs<Protocol> e) { if (!this.Dirty) return; if (e.Cancel) return; var dlgResult = MessageBox.Show( String.Format("Do you want to save changes to {0}?", this.txtProtocolName.Text), "Protocol", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (dlgResult == DialogResult.Yes) e.Cancel = !this.Save(); else if (dlgResult == DialogResult.No) this.AllProtocolsChanged(this, e); else e.Cancel = true; }
private void DomainDataGridControl_ValueChanging(object sender, ValueChangingEventArgs e) { e.Cancel = true; }
private void _textField_ValueChanging(object sender, ValueChangingEventArgs <string> e) { var s = e.NewValue; if (string.IsNullOrEmpty(s)) { } else if (s == "-") { // Allow prefix 'minus' only if Minimum lower than zero if (Minimum != null && Minimum.Value >= 0) { e.Cancel = true; } } else { float?newValue = null; if (Integer) { int i; if (!int.TryParse(s, out i)) { e.Cancel = true; } else { if ((Minimum != null && i < (int)Minimum) || (Maximum != null && i > (int)Maximum)) { e.Cancel = true; } else { newValue = i; } } } else { float f; if (!float.TryParse(s, out f)) { e.Cancel = true; } else { if ((Minimum != null && f < Minimum) || (Maximum != null && f > Maximum)) { e.Cancel = true; } else { newValue = f; } } } if (newValue != null) { } // Now SpinButton's if (ValueChanging != null) { var args = new ValueChangingEventArgs <float?>(Value, newValue); ValueChanging(this, args); if (args.Cancel) { e.Cancel = true; } else { e.NewValue = args.NewValue.HasValue ? NumberToString(args.NewValue) : null; } } } }
private void OurSelection_ValueChanging(object sender, ValueChangingEventArgs <AbilityId> e) { Log.Info($"User selected {e.Value} in our selection"); }
void _global_Changing(object sender, ValueChangingEventArgs<Global> e) { throw new NotImplementedException(); }