public void SetValue(int i, int val) { if ((int)vals [i] != val) { vals [i] = val; OnValueChanged (i); } }