Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        private void Devices_CmdAddJUIS_Executed(object sender, ExecutedRoutedEventArgs evt)
        {
            JuisDevice newDevice = new JuisDevice()
            {
                Annex             = programSettings.DefaultAnnex,
                FirmwareBuildType = programSettings.DefaultFirmwareBuildType,
                Country           = programSettings.DefaultCountry,
                Language          = programSettings.DefaultLanguage,
                OEM = programSettings.DefaultOEM
            };

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

            Devices_SetDataGridFocus();
        }