Axiom.Demos.Browser.Xna.Game.Run C# (CSharp) Метод

Run() публичный Метод

public Run ( ) : void
Результат void
        public void Run()
        {
            try
            {
                if ( _configure() )
                {
                    Assembly demos = Assembly.LoadFrom("Axiom.Demos.dll");

                    _setDefaultNextGame();

                    Type type;

                    type = Assembly.GetExecutingAssembly().GetType("Axiom.Demos.Browser.Xna." + nextGame);

                    if (type == null)
                    {
                        type = demos.GetType("Axiom.Demos." + nextGame);
                    }

                    if (type != null)
                    {
                        using ( TechDemo demo = (TechDemo)Activator.CreateInstance( type ) )
                        {
                            demo.SetupInput = new TechDemo.ConfigureInput( _setupInput );
                            demo.Start();//show and start rendering
                        }//dispose of it when done
                    }
                }
            }
            catch ( Exception caughtException )
            {
                LogManager.Instance.Write( BuildExceptionString( caughtException ) );
            }
        }

Usage Example

Пример #1
0
 private static void Main( string[] args )
 {
     try
     {
         using ( Game main = new Game() )
         {
             main.Run();//show and start rendering
         }//dispose of it when done
     }
     catch ( Exception ex )
     {
         Console.WriteLine( BuildExceptionString( ex ) );
         Console.WriteLine( "An exception has occurred.  Press enter to continue..." );
         Console.ReadLine();
     }
 }