private void listView1_DoubleClick(Object sender, EventArgs e) { var item = this.listView1.SelectedItems[0]; if (item == null) { return; } if (item.Text == "mPath" || item.Text == "mInjectionSet" || item.Text == "mnVersion") { return; } var type = (Type)item.Tag; if (type == typeof(Boolean)) { var currentBoolean = (Boolean)this._worldData[item.Text]; item.SubItems[1].Text = (!currentBoolean).ToString(); this._worldData[item.Text] = !currentBoolean; } if (type == typeof(Int64)) { var currentInt = (Int64)this._worldData[item.Text]; using (var nd = new NumericDialog(currentInt, 0)) { if (nd.ShowDialog() == DialogResult.OK) { item.SubItems[1].Text = Convert.ToInt64(nd.Result).ToString("N0"); this._worldData[item.Text] = Convert.ToInt64(nd.Result); } } } if (type == typeof(Int32)) { var currentInt = (Int32)this._worldData[item.Text]; using (var nd = new NumericDialog(currentInt, 0)) { if (nd.ShowDialog() == DialogResult.OK) { item.SubItems[1].Text = Convert.ToInt32(nd.Result).ToString("N0"); this._worldData[item.Text] = Convert.ToInt32(nd.Result); } } } if (type == typeof(Single)) { var currentFloat = (Single)this._worldData[item.Text]; using (var nd = new NumericDialog(currentFloat, 7)) { if (nd.ShowDialog() == DialogResult.OK) { item.SubItems[1].Text = Convert.ToSingle(nd.Result).ToString("N7").TrimEnd('0').TrimEnd('.'); this._worldData[item.Text] = Convert.ToSingle(nd.Result); } } } if (type.BaseType == typeof(Enum)) { var currentEnum = (Enum)this._worldData[item.Text]; using (var ed = new EnumDialog(currentEnum)) { if (ed.ShowDialog() == DialogResult.OK) { item.SubItems[1].Text = ed.Result.ToString(); this._worldData[item.Text] = ed.Result; } } } if (type == typeof(string)) { var currentStr = (string)this._worldData[item.Text]; using (var sd = new StringDialog(currentStr)) { if (sd.ShowDialog() == DialogResult.OK) { item.SubItems[1].Text = sd.Result; this._worldData[item.Text] = sd.Result; } } } }