Beispiel #1
0
 private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listBox1.SelectedItem != null)
     {
         MyGameComponent.LoadGameComponent(TransparentGameComponent.Generate((Type)listBox1.SelectedItem));
     }
 }
Beispiel #2
0
        public SelectionMenu()
        {
            InitializeComponent();

            var type  = typeof(TransparentGameComponent);
            var types = AppDomain.CurrentDomain.GetAssemblies()
                        .SelectMany(s => s.GetTypes())
                        .Where(p => type.IsAssignableFrom(p) && !p.IsAbstract);

            foreach (var type1 in types)
            {
                listBox1.Items.Add(type1);
            }

            MyGameComponent = new TransparentGameEngine.Game(TransparentGameComponent.Generate((Type)listBox1.Items[0]), new Win32Window(Handle));

            MyGameComponent.Run();
        }