コード例 #1
0
        private void Devices_CmdCopy_Executed(object sender, ExecutedRoutedEventArgs evt)
        {
            Device device = Devices.First(d => IsSelectedDevice(d));

            if (device is DectDevice dectDevice)
            {
                DectDevice newDevice = new DectDevice(dectDevice)
                {
                    DeviceName = string.Empty
                };
                if (newDevice.Edit(this))
                {
                    Devices.Add(newDevice);
                    Devices_SelectDevice(newDevice);
                }
            }
            if (device is JuisDevice juisDevice)
            {
                JuisDevice newDevice = new JuisDevice(juisDevice)
                {
                    DeviceName = string.Empty
                };
                if (newDevice.Edit(this))
                {
                    Devices.Add(newDevice);
                    Devices_SelectDevice(newDevice);
                }
            }

            Devices_SetDataGridFocus();
        }
コード例 #2
0
        private void Devices_CmdAddDECT_Executed(object sender, ExecutedRoutedEventArgs evt)
        {
            DectDevice newDevice = new DectDevice()
            {
                Country  = programSettings.DefaultCountry,
                Language = programSettings.DefaultLanguage,
                OEM      = programSettings.DefaultOEM
            };

            if (newDevice.Edit(this))
            {
                Devices.Add(newDevice);
                Devices_SelectDevice(newDevice);
            }

            Devices_SetDataGridFocus();
        }