@@ -51,20 +51,48 @@ public static bool SL_OnMinimize
5151 set { _config . SetBool ( LockAssistSoftlockOnMinimize , value ) ; }
5252 }
5353
54+ private static List < string > m_SL_DefaultExcludeForms = new List < string > ( ) { "AboutForm" , "AutoTypeCtxForm" , "CharPickerForm" , "ColumnsForm" ,
55+ "HelpSourceForm" , "KeyPromptForm" , "LanguageForm" , "PluginsForm" , "PwGeneratorForm" , "UpdateCheckForm" , "OtpKeyProv.Forms.OtpKeyPromptForm" } ;
56+ private const string mc_ExcludeFormsText = "Enter form names to exclude from Softlock" ;
5457 public static List < string > SL_ExcludeForms
5558 {
5659 get
5760 {
58- string sForms = _config . GetString ( LockAssistSoftlockExcludeForms , "AboutForm,AutoTypeCtxForm,CharPickerForm,ColumnsForm," +
59- "HelpSourceForm,KeyPromptForm,LanguageForm,PluginsForm,PwGeneratorForm,UpdateCheckForm" ) ;
60- var aForms = sForms . Split ( new char [ ] { ',' } , StringSplitOptions . RemoveEmptyEntries ) ;
61+ //Set defaults
6162 List < string > lForms = new List < string > ( ) ;
63+ lForms . AddRange ( m_SL_DefaultExcludeForms ) ;
64+
65+ string sForms = _config . GetString ( LockAssistSoftlockExcludeForms , string . Empty ) ;
66+ if ( string . IsNullOrEmpty ( sForms ) )
67+ {
68+ sForms = string . Empty ;
69+ SL_ExcludeForms = new List < string > ( ) { mc_ExcludeFormsText } ;
70+ }
71+ var aForms = sForms . Split ( new char [ ] { ',' } , StringSplitOptions . RemoveEmptyEntries ) ;
6272 foreach ( var sForm in aForms )
6373 {
74+ if ( sForm == mc_ExcludeFormsText ) continue ;
75+ if ( sForm . Trim ( ) . StartsWith ( "-" ) ) continue ;
6476 if ( ! lForms . Contains ( sForm . Trim ( ) ) ) lForms . Add ( sForm . Trim ( ) ) ;
6577 }
78+ foreach ( var sForm in aForms )
79+ {
80+ if ( sForm == mc_ExcludeFormsText ) continue ;
81+ if ( ! sForm . Trim ( ) . StartsWith ( "-" ) ) continue ;
82+ lForms . Remove ( sForm . Trim ( ) . Substring ( 1 ) ) ;
83+ }
6684 return lForms ;
6785 }
86+ set
87+ {
88+ string sForms = string . Empty ;
89+ foreach ( var s in value )
90+ {
91+ if ( ! string . IsNullOrEmpty ( sForms ) ) sForms += "," ;
92+ sForms += s ;
93+ }
94+ _config . SetString ( LockAssistSoftlockExcludeForms , sForms ) ;
95+ }
6896 }
6997 }
7098}
0 commit comments