示例#1
0
        public static async Task DestructGlobals()
        {
            await LocalUtils.SaveSettings();

            downloads.PauseAll();
            client.Dispose();
            noRedirectClient.Dispose();
        }
示例#2
0
        public static async Task InitGlobals()
        {
            everything = await LocalUtils.ReadSettings();

            client.DefaultRequestHeaders.TryAppendWithoutValidation("User-Agent", Constants.GUANJIA_AGENT);
            noRedirectClient.DefaultRequestHeaders.TryAppendWithoutValidation("User-Agent", Constants.GUANJIA_AGENT);
            downloads.InitTasks().ContinueWith((task) => {
                downloads.ResumeAll();
            });
        }