18
18
using System ;
19
19
using System . Collections . Generic ;
20
20
using System . Diagnostics ;
21
+ using System . Diagnostics . CodeAnalysis ;
21
22
using System . Reflection ;
22
23
using System . Text ;
23
24
using System . Text . RegularExpressions ;
@@ -56,6 +57,7 @@ public class ConsoleRun
56
57
private IWordRankGenerater wordRankGenerater = new DefaultWordRankGenerater ( ) ;
57
58
private IList < ISingleFilter > filters = new List < ISingleFilter > ( ) ;
58
59
60
+ [ RequiresUnreferencedCode ( "Calls LoadImeList()" ) ]
59
61
public ConsoleRun ( string [ ] args , ShowHelp showHelp )
60
62
{
61
63
Args = args ;
@@ -367,6 +369,7 @@ private CommandType RunCommand(string command)
367
369
return CommandType . Other ;
368
370
}
369
371
372
+ [ RequiresUnreferencedCode ( "Calls System.Reflection.Assembly.GetTypes()" ) ]
370
373
private void LoadImeList ( )
371
374
{
372
375
Assembly assembly = GetType ( ) . Assembly ;
@@ -391,7 +394,7 @@ private void LoadImeList()
391
394
cbxImportItems . Add ( cbxa ) ;
392
395
imports . Add (
393
396
cbxa . ShortCode ,
394
- assembly . CreateInstance ( type . FullName ) as IWordLibraryImport
397
+ Type . GetType ( type . FullName ) as IWordLibraryImport
395
398
) ;
396
399
}
397
400
if ( type . GetInterface ( "IWordLibraryExport" ) != null )
@@ -400,7 +403,7 @@ private void LoadImeList()
400
403
cbxExportItems . Add ( cbxa ) ;
401
404
exports . Add (
402
405
cbxa . ShortCode ,
403
- assembly . CreateInstance ( type . FullName ) as IWordLibraryExport
406
+ Type . GetType ( type . FullName ) as IWordLibraryExport
404
407
) ;
405
408
}
406
409
}
0 commit comments