Example #1
0
 public MapOpenFileDialog(PadTieForm form, Controller cc, OpenFileAction editing)
     : this(form, cc)
 {
     this.editing = editing;
     cmd.Text = editing.FileName;
     onRelease.Checked = editing.OpenOnRelease;
     onPress.Checked = !editing.OpenOnRelease;
     showError.Checked = editing.ErrorDialog;
     slotCapture.SetInput(editing.SlotDescription, true);
 }
Example #2
0
        public static OpenFileAction Parse(InputCore core, string parseable)
        {
            string[] props = parseable.Split(',');

            if (props.Length < 3)
                throw new FormatException("Invalid property data for action 'Open File'");

            var a = new OpenFileAction(core, props[0], bool.Parse(props[1]), bool.Parse(props[2]));
            return a;
        }
Example #3
0
        public static OpenFileAction Parse(InputCore core, string parseable)
        {
            string[] props = parseable.Split(',');

            if (props.Length < 3)
            {
                throw new FormatException("Invalid property data for action 'Open File'");
            }

            var a = new OpenFileAction(core, props[0], bool.Parse(props[1]), bool.Parse(props[2]));

            return(a);
        }
Example #4
0
        private void okBtn_Click(object sender, EventArgs e)
        {
            if (slotCapture.Value == null) {
                MessageBox.Show("Please click Capture and press a button or axis direction on the gamepad.");
                return;
            }

            var input = slotCapture.Value;
            OpenFileAction action;

            if (editing == null) {
                action = new OpenFileAction(Controller.Core, cmd.Text, onRelease.Checked, showError.Checked);
            } else {
                action = editing;
                action.FileName = cmd.Text;
                action.OpenOnRelease = onRelease.Checked;
                action.ErrorDialog = showError.Checked;

                if (action.SlotDescription != input)
                    MapUtil.Map(MainForm, Controller.Virtual, action.SlotDescription, null);

            }

            MapUtil.Map(MainForm, Controller.Virtual, input, action);
            DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }