コード例 #1
0
        public RoutineController(PhoenixLauncher MainForm)
        {
            this.logger                 = new Logger(MainForm.Console);
            this.phoenixClient          = new HTTPRequest();
            this.JSON                   = new JavaScriptSerializer();
            this.progress               = new ProgressController(MainForm.progressBar);
            this.FS                     = new FileService(this.logger);
            this.MainForm               = MainForm;
            this.MainForm.Headline.Text = MainForm.Headline.Text + ' ' + Config.Launcher.VERSION;

            this.routine();
        }
コード例 #2
0
        public async Task downloadAsync(ProgressController p)
        {
            this.logger.notify("Start download");
            int    counter   = requireFiles.Count;
            int    iteration = counter;
            string path      = ConfigurationService.get(Config.Launcher.APP_CONFIG_EXECUTEABLE_PATH);

            foreach (var file in this.requireFiles)
            {
                try
                {
                    await this.phoenixClient.download(Config.API.URI + Config.API.VERSION + Config.API.FILESLAVE_DOWNLOAD + "?filename=/" + file, path + "/Modules/" + file);

                    this.logger.success("HTTP 1.1 / GET " + iteration + " of " + counter + " -> " + file);
                    p.step();
                    iteration--;
                }
                catch (Exception e)
                {
                    this.logger.error(e.Message);
                }
            }
        }