public static void Init(ListBox thebox, IniParser parser) { box = thebox; Items = new List <String>(); ItemKeys = new Dictionary <String, String>(); Assoc = new Dictionary <String, String>(); Binds = new List <KeyBind>(); for (int i = 0; i < ItemAssoc.Length; i += 2) { AddKey(ItemAssoc[i], ItemAssoc[i + 1]); } Items.Sort(); List <KeyValuePair <String, String> > keys = parser.EnumSection("Bindings"); foreach (KeyValuePair <String, String> pair in keys) { KeyBind bind = new KeyBind(); bind.Load(pair.Key, pair.Value); Binds.Add(bind); } foreach (KeyBind bind in Binds) { box.Items.Add(bind.GetName()); } }
public static void RefreshLastIndex() { if (index < 0) { box.Items.Add(tempBind.GetName()); Binds.Add(tempBind); return; } box.Items[index] = Binds[index].GetName(); }
public static void Init(ListBox thebox, IniParser parser) { box = thebox; Items = new List<String>(); ItemKeys = new Dictionary<String,String>(); Assoc = new Dictionary<String, String>(); Binds = new List<KeyBind>(); for (int i = 0; i < ItemAssoc.Length; i += 2) AddKey(ItemAssoc[i], ItemAssoc[i+1]); Items.Sort(); List<KeyValuePair<String,String>> keys=parser.EnumSection("Bindings"); foreach (KeyValuePair<String, String> pair in keys) { KeyBind bind=new KeyBind(); bind.Load(pair.Key, pair.Value); Binds.Add(bind); } foreach (KeyBind bind in Binds) box.Items.Add(bind.GetName()); }