public MidiCtrlDialog(string[] _cmds)
        {
            InitializeComponent();
            cmds = _cmds;

            ctrlChoice.ItemsSource       = ControllerLists.GetCtrlNames();
            ctrlChoice.SelectedIndex     = 0;
            ctrlChoice.SelectionChanged += CtrlBox_SelectionChanged;

            addCmd.ItemsSource       = ControllerLists.GetCmdList();
            addCmd.SelectionChanged += AddCmd_SelectionChanged;

            cmdBox.TextChanged += CmdBox_TextChanged;
        }
Пример #2
0
        public int ControllerListAdd(RolePrivilageModel modelTosave)
        {
            ControllerLists datamodel = new ControllerLists
            {
                ControllerName    = modelTosave.ControllerName,
                ControllerLabel   = modelTosave.ControllerLabel,
                ControllerGroupId = modelTosave.GroupId,
                SeqNumber         = modelTosave.SeqNumber,
                ProductId         = modelTosave.ProductId,
                SubProductId      = modelTosave.SubProductId
            };

            ent.AddToControllerLists(datamodel);
            ent.SaveChanges();
            return(datamodel.ControllerId);
        }
Пример #3
0
        public static DataTable GetMidiMapTable()
        {
            using (DataTable midiTable = new DataTable("MidiMap"))
            {
                midiTable.Columns.Add("Name");
                midiTable.Columns.Add("Commands");

                int x = 0;
                foreach (string name in ControllerLists.GetCtrlNames())
                {
                    midiTable.Rows.Add();
                    midiTable.Rows[x][0] = name;
                    midiTable.Rows[x][1] = string.Join(Environment.NewLine, ctrlVals.cmds[x]);
                    x++;
                }
                return(midiTable);
            }
        }