Skip to content

Commit ed5e0bb

Browse files
committed
Improve documents
1 parent 942ea3e commit ed5e0bb

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,16 @@ public interface IPublicAPI
322322
public MessageBoxResult ShowMsgBox(string messageBoxText, string caption = "", MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.OK);
323323

324324
/// <summary>
325-
/// Displays a standardised Flow message box.
326-
/// If there is issue when showing the message box, it will return null.
325+
/// Displays a standardised Flow progress box.
327326
/// </summary>
328-
/// <param name="caption">The caption of the message box.</param>
327+
/// <param name="caption">The caption of the progress box.</param>
329328
/// <param name="reportProgressAsync">
330329
/// Time-consuming task function, whose input is the action to report progress.
331330
/// The input of the action is the progress value which is a double value between 0 and 100.
332331
/// If there are any exceptions, this action will be null.
333332
/// </param>
334-
/// <param name="forceClosed">When user closes the progress box manually by button or esc key, this action will be called.</param>
335-
/// <returns>A progress box interface.</returns>
336-
public Task ShowProgressBoxAsync(string caption, Func<Action<double>, Task> reportProgressAsync, Action forceClosed = null);
333+
/// <param name="cancelProgress">When user cancel the progress, this action will be called.</param>
334+
/// <returns></returns>
335+
public Task ShowProgressBoxAsync(string caption, Func<Action<double>, Task> reportProgressAsync, Action cancelProgress = null);
337336
}
338337
}

Flow.Launcher/ProgressBoxEx.xaml.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ namespace Flow.Launcher
88
{
99
public partial class ProgressBoxEx : Window
1010
{
11-
private readonly Action _forceClosed;
11+
private readonly Action _cancelProgress;
1212

13-
private ProgressBoxEx(Action forceClosed)
13+
private ProgressBoxEx(Action cancelProgress)
1414
{
15-
_forceClosed = forceClosed;
15+
_cancelProgress = cancelProgress;
1616
InitializeComponent();
1717
}
1818

19-
public static async Task ShowAsync(string caption, Func<Action<double>, Task> reportProgressAsync, Action forceClosed = null)
19+
public static async Task ShowAsync(string caption, Func<Action<double>, Task> reportProgressAsync, Action cancelProgress = null)
2020
{
2121
ProgressBoxEx prgBox = null;
2222
try
@@ -25,7 +25,7 @@ public static async Task ShowAsync(string caption, Func<Action<double>, Task> re
2525
{
2626
await Application.Current.Dispatcher.InvokeAsync(() =>
2727
{
28-
prgBox = new ProgressBoxEx(forceClosed)
28+
prgBox = new ProgressBoxEx(cancelProgress)
2929
{
3030
Title = caption
3131
};
@@ -35,7 +35,7 @@ await Application.Current.Dispatcher.InvokeAsync(() =>
3535
}
3636
else
3737
{
38-
prgBox = new ProgressBoxEx(forceClosed)
38+
prgBox = new ProgressBoxEx(cancelProgress)
3939
{
4040
Title = caption
4141
};
@@ -113,7 +113,7 @@ private void Button_Background(object sender, RoutedEventArgs e)
113113
private void ForceClose()
114114
{
115115
Close();
116-
_forceClosed?.Invoke();
116+
_cancelProgress?.Invoke();
117117
}
118118
}
119119
}

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public bool IsGameModeOn()
324324
public MessageBoxResult ShowMsgBox(string messageBoxText, string caption = "", MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.OK) =>
325325
MessageBoxEx.Show(messageBoxText, caption, button, icon, defaultResult);
326326

327-
public Task ShowProgressBoxAsync(string caption, Func<Action<double>, Task> reportProgressAsync, Action forceClosed = null) => ProgressBoxEx.ShowAsync(caption, reportProgressAsync, forceClosed);
327+
public Task ShowProgressBoxAsync(string caption, Func<Action<double>, Task> reportProgressAsync, Action cancelProgress = null) => ProgressBoxEx.ShowAsync(caption, reportProgressAsync, cancelProgress);
328328

329329
#endregion
330330

0 commit comments

Comments
 (0)