Example #1
0
        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());
            }
        }
Example #2
0
 public static void RefreshLastIndex()
 {
     if (index < 0)
     {
         box.Items.Add(tempBind.GetName());
         Binds.Add(tempBind);
         return;
     }
     box.Items[index] = Binds[index].GetName();
 }
Example #3
0
 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());
 }