diff --git a/MBS.Framework/ICustomPlugin.cs b/MBS.Framework/ICustomPlugin.cs new file mode 100755 index 0000000..35be4a0 --- /dev/null +++ b/MBS.Framework/ICustomPlugin.cs @@ -0,0 +1,27 @@ +// +// CardinalDirection.cs +// +// Author: +// Michael Becker +// +// Copyright (c) 2021 Mike Becker's Software +// +// 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 . +using System; +namespace MBS.Framework +{ + public interface ICustomPlugin + { + } +} diff --git a/MBS.Framework/MBS.Framework.csproj b/MBS.Framework/MBS.Framework.csproj old mode 100755 new mode 100644 index 8eac4d0..3695de2 --- a/MBS.Framework/MBS.Framework.csproj +++ b/MBS.Framework/MBS.Framework.csproj @@ -138,6 +138,9 @@ + + + diff --git a/MBS.Framework/ProgressEvent.cs b/MBS.Framework/ProgressEvent.cs new file mode 100644 index 0000000..981ce2b --- /dev/null +++ b/MBS.Framework/ProgressEvent.cs @@ -0,0 +1,75 @@ +// +// ProgressEvent.cs - provide a way to signal progress to UI from non-UI code +// +// Author: +// Michael Becker +// +// Copyright (c) 2011-2020 Mike Becker's Software +// +// 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 . + +using System; +using System.ComponentModel; + +namespace UniversalEditor +{ + /// + /// A delegate for the event that is raised when progress is made during an asynchronous operation. + /// + /// The control firing this event. + /// A that contains additional information about this event. + public delegate void ProgressEventHandler(object sender, ProgressEventArgs e); + /// + /// Event arguments for the event that is raised when progress is made during an asynchronous operation. + /// + public class ProgressEventArgs : CancelEventArgs + { + private long mvarTotal = 0; + /// + /// The total possible amount of progress represented by this progress event. + /// + public long Total { get { return mvarTotal; } } + + private long mvarCurrent = 0; + /// + /// The current amount of progress completed. + /// + public long Current { get { return mvarCurrent; } } + + /// + /// The amount of progress remaining. + /// + public long Remaining { get { return mvarTotal - mvarCurrent; } } + + private string mvarMessage = String.Empty; + /// + /// The progress message + /// + public string Message { get { return mvarMessage; } } + + /// + /// Creates a new instance of the event arguments for the event that is + /// raised when progress is made during an asynchronous operation. + /// + /// The current amount of progress completed. + /// The total possible amount of progress represented by this progress event. + /// The progress message + public ProgressEventArgs(long current, long total, string message = "") + { + mvarCurrent = current; + mvarTotal = total; + mvarMessage = message; + } + } +} diff --git a/MBS.Framework/StringBuilderExtensions.cs b/MBS.Framework/StringBuilderExtensions.cs new file mode 100644 index 0000000..31d85ae --- /dev/null +++ b/MBS.Framework/StringBuilderExtensions.cs @@ -0,0 +1,18 @@ +using System; +using System.Text; + +namespace MBS.Framework +{ + public static class StringBuilderExtensions + { + public static void AppendLineIndented(this StringBuilder sb, object value, int indentLevel, char indentChar = '\t', int indentCharCountPerLevel = 1) + { + for (int i = 0; i < indentLevel * indentCharCountPerLevel; i++) + { + sb.Append(indentChar); + } + sb.Append(value); + sb.AppendLine(); + } + } +}