Пример #1
0
        private static async Task GetRingBuilds(GetBuildsOptions opts)
        {
            var CTACs = GetRingCTACs(opts.MachineType, opts.ReportingSku);

            foreach (var CTAC in CTACs)
            {
                var ctac = CTAC.Key;

                string token = string.Empty;
                if (!string.IsNullOrEmpty(opts.Mail) && !string.IsNullOrEmpty(opts.Password))
                {
                    token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(opts.Mail, opts.Password);
                }

                IEnumerable <UpdateData> data = await FE3Handler.GetUpdates(null, ctac, token, FileExchangeV3UpdateFilter.ProductRelease);

                data = data.Select(x => UpdateUtils.TrimDeltasFromUpdateData(x));

                for (int i = 0; i < data.Count(); i++)
                {
                    string buildStr = await data.ToList()[i].GetBuildStringAsync();

                    if (string.IsNullOrEmpty(buildStr))
                    {
                        buildStr = data.ToList()[i].Xml.LocalizedProperties.Title;
                    }
                    Console.WriteLine($"\"{CTAC.Value}\"[{i}]=\"{buildStr}\"");
                }
            }
        }
Пример #2
0
        internal static int ParseOptions(GetBuildsOptions opts)
        {
            try
            {
                GetRingBuilds(opts).Wait();

                return(0);
            }
            catch { }

            return(1);
        }