public void addToLayoutChooser(Keymap keymap) { if (this.isInLayoutChooser(keymap)) { return; } JToken level1 = this.jsonObj.GetValue("LayoutChooser"); if (level1 == null) { this.jsonObj.Add("LayoutChooser", new JArray()); } level1 = this.jsonObj.GetValue("LayoutChooser"); JArray array = (JArray)level1; JObject newObj = new JObject(); newObj.Add("Title", keymap.getName()); newObj.Add("Keymap", keymap.Filename); array.Add(newObj); this.jsonObj.Remove("LayoutChooser"); this.jsonObj.Add("LayoutChooser", array); save(); }
private void selectKeymap(Keymap keymap) { this.currentKeymap = keymap; this.tbKeymapTitle.Text = keymap.getName(); string searchstring = KeymapDatabase.Current.getKeymapSettings().getSearchStringFor(this.currentKeymap); if (searchstring != null && searchstring != "") { this.tbApplicationSearch.Text = searchstring; this.tbApplicationSearch.Foreground = new SolidColorBrush(Colors.Black); } else { this.tbApplicationSearch.Text = this.tbApplicationSearch.Tag.ToString(); this.tbApplicationSearch.Foreground = new SolidColorBrush(Colors.Gray); } this.cbApplicationSearch.IsChecked = KeymapDatabase.Current.getKeymapSettings().isInApplicationSearch(this.currentKeymap); this.cbLayoutChooser.IsChecked = KeymapDatabase.Current.getKeymapSettings().isInLayoutChooser(this.currentKeymap); this.tbDelete.Visibility = this.currentKeymap.Filename == KeymapDatabase.Current.getKeymapSettings().getDefaultKeymap() ? Visibility.Hidden : Visibility.Visible; this.fillConnectionLists(keymap, 0); this.fillKeymapList(KeymapDatabase.Current.getAllKeymaps()); }
public KeymapRow(Keymap keymap, bool active, bool defaultk) { InitializeComponent(); this.keymap = keymap; this.tbName.Text = keymap.getName(); if (active) { this.border.Background = highlightBrush; } else { this.border.MouseUp += border_MouseUp; this.border.Cursor = Cursors.Hand; } if (defaultk) { this.tbDefault.Visibility = Visibility.Visible; } }
public Action <Keymap> OnClick; //filename public KeymapRow(Keymap keymap, bool active, bool defaultk) { InitializeComponent(); this.keymap = keymap; this.tbName.Text = keymap.getName(); if (active) { this.border.Background = highlightBrush; } else { this.border.MouseUp += border_MouseUp; this.border.Cursor = Cursors.Hand; } if (defaultk) { this.tbDefault.Visibility = Visibility.Visible; } }
public void addToLayoutChooser(Keymap keymap) { if (this.isInLayoutChooser(keymap)) { return; } JToken level1 = this.jsonObj.GetValue("LayoutChooser"); if (level1 == null) { this.jsonObj.Add("LayoutChooser",new JArray()); } level1 = this.jsonObj.GetValue("LayoutChooser"); JArray array = (JArray)level1; JObject newObj = new JObject(); newObj.Add("Title", keymap.getName()); newObj.Add("Keymap", keymap.Filename); array.Add(newObj); this.jsonObj.Remove("LayoutChooser"); this.jsonObj.Add("LayoutChooser",array); save(); }