1- using System ;
1+ using System ;
22using System . Collections . Concurrent ;
33using System . Collections . Generic ;
44using System . Collections . Specialized ;
@@ -53,7 +53,7 @@ public class PublicAPIInstance : IPublicAPI, IRemovable
5353 private Updater _updater ;
5454 private Updater Updater => _updater ??= Ioc . Default . GetRequiredService < Updater > ( ) ;
5555
56- private readonly object _saveSettingsLock = new ( ) ;
56+ private readonly Lock _saveSettingsLock = new ( ) ;
5757
5858 #region Constructor
5959
@@ -119,17 +119,20 @@ public void SaveAppAllSettings()
119119 public Task ReloadAllPluginData ( ) => PluginManager . ReloadDataAsync ( ) ;
120120
121121 public void ShowMsgError ( string title , string subTitle = "" ) =>
122- ShowMsg ( title , subTitle , Constant . ErrorIcon , true ) ;
122+ ShowMsg ( title , subTitle , Constant . ErrorIcon , forceShown : true ) ;
123123
124124 public void ShowMsgErrorWithButton ( string title , string buttonText , Action buttonAction , string subTitle = "" ) =>
125- ShowMsgWithButton ( title , buttonText , buttonAction , subTitle , Constant . ErrorIcon , true ) ;
125+ ShowMsgWithButton ( title , buttonText , buttonAction , subTitle , Constant . ErrorIcon ) ;
126126
127127 public void ShowMsg ( string title , string subTitle = "" , string iconPath = "" ) =>
128- ShowMsg ( title , subTitle , iconPath , true ) ;
128+ ShowMsg ( title , subTitle , iconPath ) ;
129129
130- public void ShowMsg ( string title , string subTitle , string iconPath , bool useMainWindowAsOwner = true )
130+ public void ShowMsg ( string title , string subTitle , string iconPath , bool useMainWindowAsOwner = true ) =>
131+ ShowMsg ( title , subTitle , iconPath , useMainWindowAsOwner : useMainWindowAsOwner ) ;
132+
133+ public void ShowMsg ( string title , string subTitle , string iconPath , bool useMainWindowAsOwner = true , bool forceShown = false )
131134 {
132- if ( ! _settings . EnableSuccessNotification &&
135+ if ( ! forceShown && ! _settings . EnableSuccessNotification &&
133136 ! string . Equals ( iconPath , Constant . ErrorIcon , StringComparison . OrdinalIgnoreCase ) )
134137 {
135138 return ;
@@ -139,16 +142,10 @@ public void ShowMsg(string title, string subTitle, string iconPath, bool useMain
139142 }
140143
141144 public void ShowMsgWithButton ( string title , string buttonText , Action buttonAction , string subTitle = "" , string iconPath = "" ) =>
142- ShowMsgWithButton ( title , buttonText , buttonAction , subTitle , iconPath , true ) ;
145+ ShowMsgWithButton ( title , buttonText , buttonAction , subTitle , iconPath ) ;
143146
144147 public void ShowMsgWithButton ( string title , string buttonText , Action buttonAction , string subTitle , string iconPath , bool useMainWindowAsOwner = true )
145- {
146- if ( ! _settings . EnableSuccessNotification &&
147- ! string . Equals ( iconPath , Constant . ErrorIcon , StringComparison . OrdinalIgnoreCase ) )
148- {
149- return ;
150- }
151-
148+ {
152149 Notification . ShowWithButton ( title , buttonText , buttonAction , subTitle , iconPath ) ;
153150 }
154151
0 commit comments