| | |
| | | Data.ReadOnly = CxReadOnly.IsChecked == true; |
| | | Data.PressDownValue = TbPressDownValue.Text; |
| | | Data.PressUpValue = TbPressUpValue.Text; |
| | | Data.ControlType = (ControlType)int.Parse(CbControlType.SelectedValue.ToString()); |
| | | Data.ControlType = (ControlType)CbControlType.SelectedItem; |
| | | } |
| | | return flag; |
| | | } |
| | |
| | | CxReadOnly.IsChecked = Data.ReadOnly; |
| | | TbPressDownValue.Text = Data.PressDownValue; |
| | | TbPressUpValue.Text = Data.PressUpValue; |
| | | CbControlType.SelectedValue = (int)Data.ControlType; |
| | | CbControlType.SelectedItem = Data.ControlType; |
| | | return this.ShowDialog(); |
| | | } |
| | | |
| | | private void SaveOrUpdateData() |
| | | { |
| | | int index = Datasource.IndexOf(Data); |
| | | int index = -1; |
| | | if (Datasource != null) |
| | | { |
| | | index = Datasource.IndexOf(Data); |
| | | } |
| | | if (index < 0) |
| | | { |
| | | InsertData(Data); |