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 ) );
}
}