private void DisplayKeyboard(ClKeyboard input) { MdGlobals.boardType = input; MdGlobals.board = new UCBoard(input); PMain.Content = MdGlobals.board; LDevice.Text = input.keyboardName; }
public void LoadHardwareList() { List <string> files = System.IO.Directory.GetFiles(MdConstants.keyboards, MdConstants.eKeyboards).ToList <string>(); var fileDisplayName = files.Select(str => str.Substring(str.LastIndexOf(MdConstants.pseparator) + 1)).ToList(); FmSelectTextDialog dialog = new FmSelectTextDialog("Select Device", "Select Your Keyboard:", fileDisplayName, files); dialog.ShowModal(); if (dialog.hasResult) { ClKeyboard output = MdCore.Deserialize <ClKeyboard>(dialog.output); DisplayKeyboard(output); } }
public UCBoard(ClKeyboard keyboard) { InitializeComponent(); slices = new List <UCSlice>(); layout = new ClLayoutContainer(); for (int i = 0; i < 3; i++) { layout.keys.Add(new List <ClKeyData>()); } layout.keyboardType = keyboard.keyboardType; saveExtension = "." + keyboard.fileFormat; foreach (ClBoardSlice slice in keyboard.slices) { var ns = new UCSlice(slice, this.layout); this.slices.Add(ns); SLMain.Items.Add(ns); } maxLayer = keyboard.layers; LName.Text = "Keyboard Type: " + keyboard.keyboardName; BtnSave.Click += (sender, e) => btSave_Click(sender, e); BtnLoad.Click += (sender, e) => btLoad_Click(sender, e); BtnAddLayer.Click += (sender, e) => btAddLayer_Click(sender, e); }