Ejemplo n.º 1
0
 //Open the AdvancedGametype window and return information.
 private void AdvancedGametypeWindow(string[] maps, ListBoxItem boxItem)
 {
     var w = new MoreGametype(maps, boxItem.Content.ToString());
     if (w.ShowDialog() == false)
     {
         VotingTypes foo = w.typeStuff;
         for (int i = 0; i < this.types.Count; i++)
         {
             if (this.types[i].displayName == foo.displayName)
             {
                 this.types[i] = foo;
                 return;
             }
         }
         this.types.Add(foo);
     }
 }
Ejemplo n.º 2
0
        public MoreGametype(string[] maps, string typeName)
        {
            InitializeComponent();
            typeStuff = new VotingTypes(typeName);

            foreach (KeyValuePair <string, string> kv in Defaults.defaultMaps)
            {
                var newItem = new ListBoxItem();
                newItem.Content = kv.Key;
                mapsList.Items.Add(newItem);
            }

            foreach (string map in maps)
            {
                var newItem = new ListBoxItem();
                newItem.Content = map.Split('\\').Last();
                mapsList.Items.Add(newItem);
            }
        }