Files
Aaru/DiscImageChef.Core/Sidecar/Events.cs

80 lines
2.8 KiB
C#
Raw Normal View History

2017-08-08 12:15:55 +01:00
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Events.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
2017-08-08 12:15:55 +01:00
//
// Component : Core algorithms.
2017-08-08 12:15:55 +01:00
//
// --[ Description ] ----------------------------------------------------------
//
// Events to glue user interface with sidecar creation.
2017-08-08 12:15:55 +01:00
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2018-12-29 17:34:38 +00:00
// Copyright © 2011-2019 Natalia Portillo
2017-08-08 12:15:55 +01:00
// ****************************************************************************/
2017-08-08 12:15:55 +01:00
namespace DiscImageChef.Core
{
2019-04-20 18:11:02 +01:00
public partial class Sidecar
2017-08-08 12:15:55 +01:00
{
2019-04-20 18:11:02 +01:00
public event InitProgressHandler InitProgressEvent;
public event UpdateProgressHandler UpdateProgressEvent;
public event EndProgressHandler EndProgressEvent;
public event InitProgressHandler2 InitProgressEvent2;
public event UpdateProgressHandler2 UpdateProgressEvent2;
public event EndProgressHandler2 EndProgressEvent2;
public event UpdateStatusHandler UpdateStatusEvent;
2017-08-08 12:15:55 +01:00
2019-04-20 18:11:02 +01:00
public void InitProgress()
2017-08-08 12:15:55 +01:00
{
InitProgressEvent?.Invoke();
2017-08-08 12:15:55 +01:00
}
2019-04-20 18:11:02 +01:00
public void UpdateProgress(string text, long current, long maximum)
2017-08-08 12:15:55 +01:00
{
UpdateProgressEvent?.Invoke(string.Format(text, current, maximum), current, maximum);
2017-08-08 12:15:55 +01:00
}
2019-04-20 18:11:02 +01:00
public void EndProgress()
2017-08-08 12:15:55 +01:00
{
EndProgressEvent?.Invoke();
2017-08-08 12:15:55 +01:00
}
2019-04-20 18:11:02 +01:00
public void InitProgress2()
2017-08-08 12:15:55 +01:00
{
InitProgressEvent2?.Invoke();
2017-08-08 12:15:55 +01:00
}
2019-04-20 18:11:02 +01:00
public void UpdateProgress2(string text, long current, long maximum)
2017-08-08 12:15:55 +01:00
{
UpdateProgressEvent2?.Invoke(string.Format(text, current, maximum), current, maximum);
2017-08-08 12:15:55 +01:00
}
2019-04-20 18:11:02 +01:00
public void EndProgress2()
2017-08-08 12:15:55 +01:00
{
EndProgressEvent2?.Invoke();
2017-08-08 12:15:55 +01:00
}
2019-04-20 18:11:02 +01:00
public void UpdateStatus(string text, params object[] args)
2017-08-08 12:15:55 +01:00
{
UpdateStatusEvent?.Invoke(string.Format(text, args));
2017-08-08 12:15:55 +01:00
}
}
2017-12-19 20:33:03 +00:00
}