/// <summary> /// Raises the ValueChanging event. /// </summary> protected virtual void OnValueChanging(CancelIntValueEventArgs e) { if (ValueChanging != null) ValueChanging(this, e); }
private void SetValue(int value, eEventSource source) { if (value == m_Value) return; CancelIntValueEventArgs e = new CancelIntValueEventArgs(); e.NewValue = value; e.EventSource = source; OnValueChanging(e); if (e.Cancel) return; if (value < m_Minimum) m_Value = m_Minimum; else if (value > m_Maximum) m_Value = m_Maximum; else m_Value = value; OnValueChanged(); if (ShouldSyncProperties) BarFunctions.SyncProperty(this, "Value"); this.Refresh(); OnAppearanceChanged(); ExecuteCommand(); }