Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MicroWin/functions/iso/IsoManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private string BuildIsoObjectPath(string isoPath)
return String.Format("MSFT_DiskImage.ImagePath={0},StorageType=1", $"\"{isoPath.Replace("\\", "\\\\")}\"");
}

public void ExtractIso(string? driveLetter, string destination, Action<int> progressCallback, Action<string> fileProgressCallback)
public void ExtractIso(string? driveLetter, string destination, Action<int>? progressCallback = null, Action<string>? fileProgressCallback = null)
{
string source = $"{driveLetter}:\\";
DynaLog.logMessage($"Starting extraction from {source} to {destination}");
Expand Down Expand Up @@ -124,13 +124,13 @@ public void ExtractIso(string? driveLetter, string destination, Action<int> prog
string? destDir = Path.GetDirectoryName(destFile);
if (!Directory.Exists(destDir)) Directory.CreateDirectory(destDir ?? "");

fileProgressCallback.Invoke(file);
if (fileProgressCallback is not null) fileProgressCallback.Invoke(file);

File.Copy(file, destFile, true);
copiedFiles++;

int percentage = (int)((double)copiedFiles / files.Length * 100);
progressCallback?.Invoke(percentage);
if (progressCallback is not null) progressCallback.Invoke(percentage);
}
catch (Exception ex)
{
Expand Down
Loading