Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Launchpad_Launcher.GameHandler"/> class.
        /// </summary>
        public GameHandler()
        {
            ProgressArgs = new FileDownloadProgressChangedEventArgs ();
            DownloadFinishedArgs = new GameDownloadFinishedEventArgs ();
            UpdateFinishedArgs = new GameUpdateFinishedEventArgs ();
            RepairFinishedArgs = new GameRepairFinishedEventArgs ();

            DownloadFailedArgs = new GameDownloadFailedEventArgs ();
            UpdateFailedArgs = new GameUpdateFailedEventArgs ();
            RepairFailedArgs = new GameRepairFailedEventArgs ();
            LaunchFailedArgs = new GameLaunchFailedEventArgs ();

            GameExitArgs = new GameExitEventArgs ();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Provides alternatives when the game fails to download, either through an update or through an installation.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">Contains the type of failure that occurred.</param>
 private void OnGameDownloadFailed(object sender, GameDownloadFailedEventArgs e)
 {
     this.Invoke((MethodInvoker)delegate
     {
         ELauncherMode parsedMode;
         if (Enum.TryParse(e.Metadata, out parsedMode))
         {
             switch (parsedMode)
             {
                 case ELauncherMode.Install:
                     {
                         SetLauncherMode(parsedMode, false);
                         break;
                     }
                 case ELauncherMode.Update:
                     {
                         SetLauncherMode(parsedMode, false);
                         break;
                     }
                 case ELauncherMode.Repair:
                     {
                         SetLauncherMode(parsedMode, false);
                         break;
                     }
                 default:
                     {
                         SetLauncherMode(ELauncherMode.Repair, false);
                         break;
                     }
             }
         }
         else
         {
             SetLauncherMode(ELauncherMode.Repair, false);
         }
     });
 }
Exemplo n.º 3
0
		/// <summary>
		/// Passes the update failed event to a generic handler.
		/// </summary>
		/// <param name="sender">The sender.</param>
		/// <param name="e">Contains the type of failure that occurred.</param>
		protected void OnGameUpdateFailed(object sender, GameUpdateFailedEventArgs e)
		{
			GameDownloadFailedEventArgs args = new GameDownloadFailedEventArgs ();
			args.Metadata = e.Metadata;
			args.Result = e.Result;
			args.ResultType = "Update";

			OnGameDownloadFailed (sender, args);
		}
Exemplo n.º 4
0
        /// <summary>
        /// Provides alternatives when the game fails to download, either through an update or through an installation.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">Contains the type of failure that occurred.</param>
        private void OnGameDownloadFailed(object sender, GameDownloadFailedEventArgs e)
        {
            ELauncherMode parsedMode;
            if (Enum.TryParse(e.ResultType, out parsedMode))
            {
                switch(parsedMode)
                {
                    case ELauncherMode.Install:
                    {
                        Console.WriteLine (e.Metadata);
                        MessageLabel.Text = e.Metadata;
                        break;
                    }
                    case ELauncherMode.Update:
                    {
                        Console.WriteLine (e.Metadata);
                        MessageLabel.Text = e.Metadata;
                        break;
                    }
                    case ELauncherMode.Repair:
                    {
                        Console.WriteLine (e.Metadata);
                        MessageLabel.Text = e.Metadata;
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }

                SetLauncherMode (parsedMode, false);
            }
            else
            {
                //if we can't parse the result for some reason, offer to repair the installation.
                SetLauncherMode(ELauncherMode.Repair, false);
            }
        }
Exemplo n.º 5
0
		/// <summary>
		/// Passes the repair failed event to a generic handler
		/// </summary>
		/// <param name="sender">The sender.</param>
		/// <param name="e">Contains the type of failure that occured</param>
		private void OnGameRepairFailed(object sender, GameRepairFailedEventArgs e)
		{
			GameDownloadFailedEventArgs args = new GameDownloadFailedEventArgs ();
			args.Metadata = e.Metadata;
			args.Result = e.Result;
			args.ResultType = "Repair";

			OnGameDownloadFailed (sender, args);	
		}