コード例 #1
0
ファイル: OptionsPage.cs プロジェクト: jims/switch
        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 })));
        }
コード例 #2
0
ファイル: OptionsPage.cs プロジェクト: jims/switch
        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)));
        }