예제 #1
0
 public MegapackDownloader(string path, MSFSLiveryImporterForm form1, AppManifest manifest)
 {
     InitializeComponent();
     this.contentPath = path;
     this.form1       = form1;
     this.manifest    = manifest;
 }
예제 #2
0
        private void LoadAppManifest()
        {
            try
            {
                WebClient    client  = new WebClient();
                Stream       stream  = client.OpenRead("https://raw.githubusercontent.com/Ash-Bash/MSFS-Livery-Importer-Configs/master/appmanifest.json");
                StreamReader reader  = new StreamReader(stream);
                string       content = reader.ReadToEnd();
                Debug.WriteLine(content);
                manifest = JsonConvert.DeserializeObject <AppManifest>(content);
            }
            catch (WebException ex)
            {
                // occurs when any error occur while reading from network stream
                manifest          = new AppManifest();
                manifest.megapack = "http://download2329.mediafire.com/x2bzsn43dfcg/xst0szzl9z3o7za/liveriesmegapack.zip";
            }

            Debug.WriteLine("Megapack: " + manifest.megapack);
        }