public void FromModel(Configuration.SwitchConfiguration model) { checkBoxEnableSwitchDesigner.Checked = model.EnableSwitchBetweenDesignerAndCodeBehind; checkBoxEnableSwitchInterface.Checked = model.EnableSwitchBetweenInterfaceAndImplementation; listViewExtensionSwitches.Items.Clear(); model.ExtensionSwitches.ForEach(es => listViewExtensionSwitches.Items.Add(new ListViewItem(new[] { es.From, es.To }))); }
public void ToModel(Configuration.SwitchConfiguration model) { model.EnableSwitchBetweenDesignerAndCodeBehind = checkBoxEnableSwitchDesigner.Checked; model.EnableSwitchBetweenInterfaceAndImplementation = checkBoxEnableSwitchInterface.Checked; model.ExtensionSwitches.Clear(); listViewExtensionSwitches.Items.OfType <ListViewItem>().ToList().ForEach( lvi => model.ExtensionSwitches.Add(new ExtensionSwitch(lvi.SubItems[0].Text, lvi.SubItems[1].Text))); }