AcTools.Kn5File.Kn5.ExportTexturesAsync C# (CSharp) Method

ExportTexturesAsync() public method

public ExportTexturesAsync ( string textureDir, IProgress progress = null, CancellationToken cancellation = default(CancellationToken) ) : Task
textureDir string
progress IProgress
cancellation CancellationToken
return Task
        public async Task ExportTexturesAsync(string textureDir, IProgress<string> progress = null, CancellationToken cancellation = default(CancellationToken)) {
            foreach (var texture in Textures.Values) {
                if (cancellation.IsCancellationRequested) return;
                progress?.Report(texture.Name);
                await FileUtils.WriteAllBytesAsync(Path.Combine(textureDir, texture.Name), TexturesData[texture.Name], cancellation);
            }
        }
    }