mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
using IProgress
This commit is contained in:
parent
d4e21f824c
commit
44145e0b9c
@ -1,17 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace AssetStudio
|
|
||||||
{
|
|
||||||
public interface IProgress
|
|
||||||
{
|
|
||||||
void Report(int value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class DummyProgress : IProgress
|
|
||||||
{
|
|
||||||
public void Report(int value) { }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +1,10 @@
|
|||||||
namespace AssetStudio
|
using System;
|
||||||
|
|
||||||
|
namespace AssetStudio
|
||||||
{
|
{
|
||||||
public static class Progress
|
public static class Progress
|
||||||
{
|
{
|
||||||
public static IProgress Default = new DummyProgress();
|
public static IProgress<int> Default = new Progress<int>();
|
||||||
private static int preValue;
|
private static int preValue;
|
||||||
|
|
||||||
public static void Reset()
|
public static void Reset()
|
||||||
|
@ -107,7 +107,7 @@ namespace AssetStudioGUI
|
|||||||
|
|
||||||
logger = new GUILogger(StatusStripUpdate);
|
logger = new GUILogger(StatusStripUpdate);
|
||||||
Logger.Default = logger;
|
Logger.Default = logger;
|
||||||
Progress.Default = new GUIProgress(SetProgressBarValue);
|
Progress.Default = new Progress<int>(SetProgressBarValue);
|
||||||
Studio.StatusStripUpdate = StatusStripUpdate;
|
Studio.StatusStripUpdate = StatusStripUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using AssetStudio;
|
|
||||||
|
|
||||||
namespace AssetStudioGUI
|
|
||||||
{
|
|
||||||
class GUIProgress : IProgress
|
|
||||||
{
|
|
||||||
private Action<int> action;
|
|
||||||
|
|
||||||
public GUIProgress(Action<int> action)
|
|
||||||
{
|
|
||||||
this.action = action;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Report(int value)
|
|
||||||
{
|
|
||||||
action(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user