Axiom.Demos.Browser.WinForm.Program.Run C# (CSharp) Метод

Run() приватный Метод

private Run ( Options options ) : void
options Options
Результат void
		private void Run( Options options )
		{
			try
			{
				if ( _configure( options ) )
				{
					Type demoType = null;
					if ( !String.IsNullOrEmpty( options.Sample ) )
					{
						Assembly demos = Assembly.LoadFrom( DemoAssembly );
						Type[] demoTypes = demos.GetTypes();
						demoType = demos.GetType( "Axiom.Demos." + options.Sample );
					}
					else
					{
						demoType = dlg.Demo;
					}

					if ( demoType != null )
					{
						using ( TechDemo demo = (TechDemo)Activator.CreateInstance( demoType ) )
						{
							demo.SetupResources();
							demo.Start(); //show and start rendering
						}
					}
				}
			}
			catch ( Exception caughtException )
			{
				LogManager.Instance.Write( BuildExceptionString( caughtException ) );
			}
		}

Usage Example

Пример #1
0
		private static void ExecuteCoreTask( Options options )
		{
			try
			{
				using ( Program main = new Program() )
				{
					main.Run( options ); //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();
			}
		}