Exemplo n.º 1
0
        /// <summary>
        /// Updates MerCraft.
        /// </summary>
        /// <param name="U">Username</param>
        /// <param name="P">Password</param>
        public async void UpdateVersion(string U, string P)
        {
            UpdateInfoControl UICModPack = new UpdateInfoControl("ModPack Update Download (MC " + Program.M.PreferredVersion + ")");

            LF = new LaunchForm();
            Us = U;
            Pa = P;
            LF.panel1.Controls.Add(UICModPack);
            LF.Show();

            string linkToModPack = "http://mercraft.merbo.org/MerCraft/Versions/" + Program.M.PreferredVersion + "/ModPack.zip";

            await MakeBackup();
            await PrepareForUpdate();

            await UICModPack.DownloadAndExtractZip(linkToModPack, appdata + "\\.mercraft\\ModPack.zip", appdata + "\\.mercraft", true);

            await RestoreBackup();

            if (!runningDownload)
            {
                if (CorrectJar())
                {
                    Launcher.LaunchAfterUpdate(LF, Us, Pa);
                }
            }
        }
Exemplo n.º 2
0
        public void ShowLogin(bool show)
        {
            ((App)App.Current).EnsureAdVisible(null);
            LayoutRoot.Background = show ? (Brush) new ImageBrush()
            {
                ImageSource = new BitmapImage(new Uri("/SplashScreenImage.jpg", UriKind.RelativeOrAbsolute)), Stretch = Stretch.None
            } : new SolidColorBrush(Colors.Black);
            panorama.Visibility  = !show ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
            loginCtrl.Visibility = show ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
            //loginCtrl.companyBox.Visibility = !show ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
            //loginCtrl.loginBox.Visibility = show ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
            loginCtrl.ShowLoginControls(show);
            loginCtrl.ShowApplicationBar();

            if (!show)
            {
                BuildApplicationBar();
                UpdateInfoControl.ShowUpdateInfo();
            }
        }