Example #1
0
        private void AutoButton_Click(object sender, RoutedEventArgs e)
        {
            var ud = _UserDevice;

            if (ud == null)
            {
                return;
            }
            var description = Attributes.GetDescription(_MappedTo);
            var form        = new MessageBoxWindow();
            var buttons     = MessageBoxButton.YesNo;
            var text        = string.Format("Do you want to fill {0} settings automatically?", description);

            if (ud.Device == null && !TestDeviceHelper.ProductGuid.Equals(ud.ProductGuid))
            {
                text    = string.Format("Device is off-line. Please connect device to fill {0} settings automatically.", description);
                buttons = MessageBoxButton.OK;
            }
            var result = form.ShowDialog(text, "Fill Controller Settings", buttons, MessageBoxImage.Question);

            if (result != MessageBoxResult.Yes)
            {
                return;
            }
            var ps = AutoMapHelper.GetAutoPreset(ud);

            _PadSetting.Load(ps);
        }