Exemplo n.º 1
0
        public static void MenuItem_Get(string[] args, MPackEngine.Engine engine)
        {
            string appName = "";
            string appVersion = "";
            if (checkArg(1, args, ref appName) && checkArg(2, args, ref appVersion))
            {
                try
                {
                    var application = engine.GetCurrentPackageRepositoryList().GetPackage(appName, appVersion);

                    Console.WriteLine("Selected app to download: {0} - {1}", application.ApplicationName, application.ApplicationVersion);

                    var result = engine.GetCurrentPackageRepositoryList().GetFullDownloadListForApplication(appName, appVersion);

                    Console.WriteLine("Full download list:");
                    result.ForEach(x => Console.WriteLine("Application: {0}, version: {1}", x.ApplicationName, x.ApplicationVersion));

                    Console.WriteLine("Downloading...");
                    engine.GetApplication(result);

                    Console.WriteLine("All content was downloaded!");
                }
                catch(Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            else
            {
                Console.WriteLine("Check input, give app name as first argument and version as the second", appName, appVersion);
            }
        }