Ejemplo n.º 1
0
        private void TmrCheckVal_Tick(object sender, EventArgs e)
        {
            PrgInstall.Value = int.Parse(Math.Truncate(IServiceInstall.percentage).ToString());
            if (IServiceInstall.Downloading == true)
            {
                TbPage.Enabled        = false;
                LblInstalling.Visible = true;
                ILogging.Output(false, false, false, true, "Downloading package: " + AppToInstall + " (" + IServiceInstall.percentage.ToString() + "%)", false);
                LblInstalling.Text = "Downloading package: " + AppToInstall + " (" + IServiceInstall.percentage.ToString() + "%)";
                //ILogging.Output(false, false, false, true, "Download package: " + AppToInstall + "::" + IServiceInstall.percentage.ToString() + "%");
            }
            else if (IServiceInstall.Installing == false && IServiceInstall.Installed == true)
            {
                TbPage.Enabled = true;
                IServiceInstall.Downloading = false;
                ILogging.Output(false, false, false, true, "Package installed", true);
                FmSelectSystem.NotifTitle = "GetMyBru - Package Installer";
                FmSelectSystem.NotifText  = "Package Installed";
                FmSelectSystem.NotifTime  = 40000;
                FmSelectSystem.ShowToast  = true;
                IServiceInstall.Installed = false;
                LblInstalling.Visible     = false;
            }
            if (IServiceInstall.Failed == true)
            {
                TbPage.Enabled              = true;
                IServiceInstall.Installed   = true;
                IServiceInstall.Failed      = false;
                IServiceInstall.Downloading = false;
                ILogging.Output(true, false, false, false, "Package failed to install", true);
                FmSelectSystem.NotifTitle = "GetMyBru - Package Installer";
                FmSelectSystem.NotifText  = "Package Failed to install";
                FmSelectSystem.NotifTime  = 40000;
                FmSelectSystem.ShowToast  = true;
                IServiceInstall.Installed = false;
                LblInstalling.Visible     = false;
            }

            if (IServiceInstall.Downloading == false && IServiceInstall.Installing == true)
            {
                LblInstalling.Text = "Installing package: " + AppToInstall;
            }
            if (AppInView == true)
            {
                ShowAppInfo();
                TbSel.Enabled = false;
                return;
            }
            else if (AppInView == false)
            {
                HideAppInfo();
                TbSel.Enabled = true;
                return;
            }

            //if (IServiceInstall.PackageProgress > 0)
            //{
            //    PrgInstall.Value = IServiceInstall.PackageProgress;
            //}
            //else if (IServiceInstall.PackageDownloadComplete == true)
            //{
            //    PrgInstall.Value = 100;
            //    MessageBox.Show("Packaged installed.");
            //    return;
            //    return;
            //}
        }