Geowigo.Models.WFCoreAdapter.InitAndStartCartridge C# (CSharp) Method

InitAndStartCartridge() public method

Starts to play a Wherigo cartridge game.
public InitAndStartCartridge ( string filename ) : WF.Player.Core.Cartridge
filename string Filename of the cartridge in the isolated storage.
return WF.Player.Core.Cartridge
		public Cartridge InitAndStartCartridge(string filename)
		{
			// Boot Time: inits the cartridge and process position.
			Cartridge cart = new Cartridge(filename);

			try
			{
				using (IsolatedStorageFileStream fs = IsolatedStorageFile.GetUserStoreForApplication().OpenFile(cart.Filename, System.IO.FileMode.Open, System.IO.FileAccess.Read))
				{
					Init(fs, cart);
				}

				// Adds info about the cartridge to the crash reporter.
				Geowigo.Utils.DebugUtils.AddBugSenseCrashExtraData(cart);

				ApplySensorData();

				// Run Time: the game starts.

				Start();

				// TEMP DEBUG
				ApplySensorData();
			}
			catch (Exception)
			{
				lock (_SyncRoot)
				{
					_IsInCrash = true;
				}
				throw;
			}

			return cart;
		}