private async static void downloadImage(string url, string name) { var client = new WebClient(); var stream = await client.OpenReadTaskAsync(new Uri(url, UriKind.Absolute)); var bytes = ReadFully(stream); DataSaver<byte[]>.Remove(name); DataSaver<byte[]>.Save(name, bytes); Update(); }
internal static void RemoveFactory(Factory factory) { DataSaver<byte[]>.Remove("factory" + factory.Id); SavedData.Factories.RemoveAll(x => x.Id == factory.Id); Update(); }