From 60947168aa7b284b976536f22cd84cb2afc98bbe Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 31 Dec 2020 19:28:41 +0000 Subject: [PATCH] Move delegates to common types. --- Aaru.CommonTypes.csproj | 3 +- Delegates.cs | 88 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 Delegates.cs diff --git a/Aaru.CommonTypes.csproj b/Aaru.CommonTypes.csproj index b9c9d85f1..44835dce6 100644 --- a/Aaru.CommonTypes.csproj +++ b/Aaru.CommonTypes.csproj @@ -60,6 +60,7 @@ Metadata/cicm.cs + @@ -127,7 +128,7 @@ - + diff --git a/Delegates.cs b/Delegates.cs new file mode 100644 index 000000000..376c6cd82 --- /dev/null +++ b/Delegates.cs @@ -0,0 +1,88 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Delegates.cs +// Author(s) : Natalia Portillo +// +// Component : Common types. +// +// --[ Description ] ---------------------------------------------------------- +// +// Delegates to communicate with user interface. +// +// --[ 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2020 Natalia Portillo +// ****************************************************************************/ + +namespace Aaru.CommonTypes +{ + /// Initializes a progress indicator (e.g. makes a progress bar visible) + public delegate void InitProgressHandler(); + + /// Updates a progress indicator with text + public delegate void UpdateProgressHandler(string text, long current, long maximum); + + /// Pulses a progress indicator with indeterminate boundaries + public delegate void PulseProgressHandler(string text); + + /// Uninitializes a progress indicator (e.g. adds a newline to the console) + public delegate void EndProgressHandler(); + + /// Initializes a secondary progress indicator (e.g. makes a progress bar visible) + public delegate void InitProgressHandler2(); + + /// Updates a secondary progress indicator with text + public delegate void UpdateProgressHandler2(string text, long current, long maximum); + + /// Pulses a secondary progress indicator with indeterminate boundaries + public delegate void PulseProgressHandler2(string text); + + /// Uninitializes a secondary progress indicator (e.g. adds a newline to the console) + public delegate void EndProgressHandler2(); + + /// Initializes two progress indicators (e.g. makes a progress bar visible) + public delegate void InitTwoProgressHandler(); + + /// Updates two progress indicators with text + public delegate void UpdateTwoProgressHandler(string text, long current, long maximum, string text2, long current2, + long maximum2); + + /// Pulses a progress indicator with indeterminate boundaries + public delegate void PulseTwoProgressHandler(string text, string text2); + + /// Uninitializes a progress indicator (e.g. adds a newline to the console) + public delegate void EndTwoProgressHandler(); + + /// Updates a status indicator + public delegate void UpdateStatusHandler(string text); + + /// Shows an error message + public delegate void ErrorMessageHandler(string text); + + public delegate void InitBlockMapHandler(ulong blocks, ulong blockSize, ulong blocksToRead, ushort currentProfile); + + /// Updates lists of time taken on scanning from the specified sector + /// Time in milliseconds + public delegate void ScanTimeHandler(ulong sector, double duration); + + /// Specified a number of blocks could not be read on scan + public delegate void ScanUnreadableHandler(ulong sector); + + public delegate void ScanSpeedHandler(ulong sector, double currentSpeed); +} \ No newline at end of file