Example #1
0
        private void btLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filters.Add(new FileDialogFilter(layout.keyboardType + " layout", saveExtension));
            dialog.Title     = "Load Layout";
            dialog.Directory = new Uri(Environment.CurrentDirectory + MdConstants.pseparator + "layouts");
            dialog.ShowDialog(this);
            if (dialog.FileName != "" && System.IO.File.Exists(dialog.FileName))
            {
                LoadLayout(MdCore.Deserialize <ClLayoutContainer>(dialog.FileName));
            }
        }
Example #2
0
        public static void iniList()
        {
            lists = new List <ClKeyGroup>();
            dKeys = new List <ClKey>();
            List <string> files = System.IO.Directory.GetFiles(MdConstants.keygroups, MdConstants.eKeygroups).ToList <string>();

            foreach (string file in files)
            {
                var kg = MdCore.Deserialize <ClKeyGroup>(file);
                lists.Add(kg);
                dKeys.AddRange(kg.key);
            }
            dKeys = dKeys.Distinct().ToList();
            lists = lists.OrderBy(kg => kg.priority).ToList();
        }
Example #3
0
        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);
            }
        }