private void InsertParam_Click(object sender, RoutedEventArgs e) { if (SelectedParam == null) { return; } int index = ListDataParams.IndexOf(SelectedParam); AddParam(index); }
private void RemoveParam_Click(object sender, RoutedEventArgs e) { if (SelectedParam == null) { return; } int index = ListDataParams.IndexOf(SelectedParam); ListDataParams.Remove(SelectedParam); for (int i = index; i < ListDataParams.Count; i++) { ListDataParams[i].Address -= 2; } SelectedParam = null; }
private void InsertParam_Click(object sender, RoutedEventArgs e) { if (SelectedParam == null) { return; } int index = ListDataParams.IndexOf(SelectedParam); Service.DataParam addedParam = new Service.DataParam(); if (new SelectDataParamOutput(SparkWindow.setting.GetListInputParams(), addedParam).ShowDialog() == true) { Service.DataParamOutput addParam = new Service.DataParamOutput() { ID = addedParam.ID, Title = addedParam.Title, ParamUnitTitle = addedParam.ParamUnit.Title }; AddParam(index, addParam); } }