Пример #1
0
        public void InitializeComponent2()
        {
            this.webBrowser1.Url = new System.Uri(GuiController.UPDATENOTES, System.UriKind.Absolute);

            this.backgroundWorkerScan = new BackgroundWorker();
               		this.backgroundWorkerScan.WorkerReportsProgress = true;
            this.backgroundWorkerScan.WorkerSupportsCancellation = true;
            this.backgroundWorkerScan.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorkerScan_DoWork);
            //this.backgroundWorkerScan.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorkerScan_ProgressChanged);
            //FIXME
            this.backgroundWorkerScan.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker2_ProgressChanged);
            this.backgroundWorkerScan.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorkerScan_RunWorkerCompleted);

            this.backgroundWorkerScanManual = new BackgroundWorker();
               		this.backgroundWorkerScanManual.WorkerReportsProgress = true;
            this.backgroundWorkerScanManual.WorkerSupportsCancellation = true;
            this.backgroundWorkerScanManual.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorkerScanManual_DoWork);
            //this.backgroundWorkerScanManual.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorkerScanManual_ProgressChanged);
            //FIXME
            this.backgroundWorkerScanManual.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker2_ProgressChanged);
            this.backgroundWorkerScanManual.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorkerScanManual_RunWorkerCompleted);

               		this.backgroundWorkerUpdate = new BackgroundWorker();
               		this.backgroundWorkerUpdate.WorkerReportsProgress = true;
            this.backgroundWorkerUpdate.WorkerSupportsCancellation = true;
            this.backgroundWorkerUpdate.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorkerUpdate_DoWork);
            //this.backgroundWorkerUpdate.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorkerUpdate_ProgressChanged);
            //FIXME
            this.backgroundWorkerUpdate.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker2_ProgressChanged);
            this.backgroundWorkerUpdate.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorkerUpdate_RunWorkerCompleted);

            // modify existing components from designer

            this.Region = System.Drawing.Region.FromHrgn(GuiController.CreateRoundRectRgn( 0, 0, Width, Height, 24, 24));
            this.Icon= Controller.GetAppIcon();
            this.BackgroundImage = Controller.GetResourceImage("Background_Launcher");

            MinimizeButton = Controller.SpawnMinimizeButton(new Point(535, 20));
            CloseButton = Controller.SpawnCloseButton(new Point(562, 8));

            MinimizeButton.Click += MinimizeClick;
            CloseButton.Click += CloseClick;

            this.Controls.Add(MinimizeButton);
            this.Controls.Add(CloseButton);

            //add new components

            launcherProgressBar1 = Controller.SpawnProgressBar(new System.Drawing.Point(23, 452), new System.Drawing.Size(441, 17));
            this.Controls.Add(launcherProgressBar1);

            AcctButton = Controller.SpawnStandardButton("My Account", new Point(10, 365	));
            OptButton = Controller.SpawnStandardButton("Game options", new Point(126, 365 ));
            ScanButton = Controller.SpawnStandardButton("Scan", new Point(242, 365 ));
            LOptButton = Controller.SpawnStandardButton("Launcher options", new Point(358, 365));
            DonateButton = Controller.SpawnStandardButton("Donate", new Point(474, 365));

            PlayButton = Controller.SpawnPlayButton("Play", new Point(484,434));

            AcctButton.Click += acct_Click_1;
            OptButton.Click += options_Click_1;
            ScanButton.Click += Scan_Click;
            LOptButton.Click += button2_Click;
            DonateButton.Click += Donate_Click;
            PlayButton.Click += PLAY_Click_1;

            this.Controls.Add(AcctButton);
            this.Controls.Add(OptButton);
            this.Controls.Add(ScanButton);
            this.Controls.Add(LOptButton);
            this.Controls.Add(DonateButton);
            this.Controls.Add(PlayButton);

            label1 = Controller.SpawnLabel("", new Point(23, 415), new Size(260, 15));
            this.Controls.Add(label1);

            labelError = Controller.SpawnLabel("", new Point(23, 430), new Size(260, 15));
            this.Controls.Add(labelError);
        }
Пример #2
0
        public LauncherProgressBar SpawnProgressBar(System.Drawing.Point Location , System.Drawing.Size Size)
        {
            LauncherProgressBar lpb = new LauncherProgressBar();

            lpb.Location = Location;
            lpb.Size = Size;

            lpb.ForeColor = System.Drawing.Color.Red;
            lpb.TextColor = System.Drawing.ColorTranslator.FromHtml("#fffba7");

               		if (HasFont) {
                lpb.Font = new Font(pfc.Families[0], 8);
            }

            return lpb;
        }