private void save(StepRepl s) { s.file = ftbReplFile.FileName; s.pattern = tbReplPattern.Text; s.prefix = tbReplPrefix.Text; s.postfix = tbReplPostfix.Text; s.rtype = s.TypeList[cbReplType.SelectedIndex].Key; s.source = s.SourceList[cbReplSource.SelectedIndex].Key; }
private void render(StepRepl s) { ftbReplFile.FileName = s.file; tbReplPattern.Text = s.pattern; tbReplPrefix.Text = s.prefix; tbReplPostfix.Text = s.postfix; cbReplType.Items.Clear(); cbReplType.Items.AddRange(s.TypeList.Select(i => i.Value).ToArray()); cbReplType.SelectedIndex = s.TypeList.FindIndex(i => i.Key == s.rtype); cbReplSource.Items.Clear(); cbReplSource.Items.AddRange(s.SourceList.Select(i => i.Value).ToArray()); cbReplSource.SelectedIndex = s.SourceList.FindIndex(i => i.Key == s.source); }