Пример #1
0
 internal static void Draw()
 {
     Database.ActualScene = "Installation";
     if (!InstallationLoaded)
     {
         InstallationLoaded = true;
         Scene installlation = new Scene("Installation");
         Label l             = new Label();
         Label lll           = new Label();
         lll.Size      = new Size(300, 20);
         lll.Location  = new Point(100, 200);
         lll.Font      = new Font(FontFamily.GenericSansSerif, 12f, FontStyle.Bold);
         lll.TextAlign = ContentAlignment.MiddleCenter;
         lll.ForeColor = Color.White;
         Asset llla = new Asset(lll, "FileDownloading");
         installlation.AddAsset("FileDownloading");
         Label llllll = new Label();
         llllll.Size      = new Size(100, 20);
         llllll.Location  = new Point(410, 200);
         llllll.TextAlign = ContentAlignment.MiddleCenter;
         llllll.ForeColor = Color.Red;
         Asset lllllla = new Asset(llllll, "DownloadKB");
         installlation.AddAsset("DownloadKB");
         Label lllllll = new Label();
         lllllll.Size      = new Size(30, 20);
         lllllll.Location  = new Point(460, 130);
         lllllll.TextAlign = ContentAlignment.MiddleCenter;
         lllllll.ForeColor = Color.Blue;
         Asset llllllla = new Asset(lllllll, "DownloadPercent");
         installlation.AddAsset("DownloadPercent");
         Label llll = new Label();
         llll.Size        = new Size(400, 80);
         llll.Location    = new Point(50, 100);
         llll.BorderStyle = BorderStyle.Fixed3D;
         llll.BackColor   = Color.White;
         Asset lllla = new Asset(llll, "FullDownloadBar");
         installlation.AddAsset("FullDownloadBar");
         Label ll = new Label();
         ll.Size        = new Size(1, 79);
         ll.Location    = new Point(50, 100);
         ll.BorderStyle = BorderStyle.None;
         ll.BackColor   = Color.PowderBlue;
         Asset lla = new Asset(ll, "DownloadBar");
         lla.Front();
         installlation.AddAsset("DownloadBar");
         Scene.Register(installlation);
         t          = new Timer();
         t.Interval = 5;
         if (Database.Iris && Database.Nerve)
         {
             t.Tick += UpdateBoth;
         }
         else if (Database.Iris)
         {
             t.Tick += UpdateIris;
         }
         else
         {
             t.Tick += UpdateNerve;
         }
     }
     else
     {
         Scene.Show("Installation");
     }
     if (Client.CheckConnection())
     {
         st.Start();
         bool OutTime = true;
         Client.Send(Operations.CheckPing);
         while (st.ElapsedMilliseconds < 5000)
         {
             if (Database.NetworkResult == "1")
             {
                 OutTime = false;
                 break;
             }
         }
         if (OutTime)
         {
             Utilities.Info("You run out of time trying to connect with the server!");
             Clean();
             Client.Flush();
             Scene.Hide("Installation");
             st.Reset();
             Retry.Draw();
         }
         else
         {
             if (Database.OutputFolder != "")
             {
                 Utilities.NewFolder(Database.OutputFolder);
             }
             Utilities.NewFolder(Database.OutputFolder + "\\Resources");
             Client.Flush();
             t.Start();
             st.Restart();
         }
     }
     else
     {
         Utilities.Info("You are not connected to a network or your network is having troubles!");
     }
 }