//-/////////////////////////////////////////////////////////////////////// //-/////////////////////////////////////////////////////////////////////// private void HandleScriptValueDirty(object sender, System.EventArgs e) { double value; if (double.TryParse(_textBox.Text, out value)) { Attr.SilentSetValue(_isFloat ? (float)value : value); Misc.SetCleanColour(_textBox); } else { Misc.SetBadColour(_textBox); } }
//-/////////////////////////////////////////////////////////////////////// //-/////////////////////////////////////////////////////////////////////// private void HandleScriptValueDirty(object sender, System.EventArgs e) { double x, y; bool goodX = double.TryParse(_xTextBox.Text, out x); bool goodY = double.TryParse(_yTextBox.Text, out y); if (goodX && goodY) { Attr.SilentSetValue(new V2(x, y)); Misc.SetCleanColour(_xTextBox, _yTextBox); } else { Misc.SetBadColour(goodX ? null : _xTextBox, goodY ? null : _yTextBox); } }