1818using System ;
1919using System . Collections . Generic ;
2020using System . Diagnostics ;
21+ using System . Diagnostics . CodeAnalysis ;
2122using System . Reflection ;
2223using System . Text ;
2324using System . Text . RegularExpressions ;
@@ -56,6 +57,7 @@ public class ConsoleRun
5657 private IWordRankGenerater wordRankGenerater = new DefaultWordRankGenerater ( ) ;
5758 private IList < ISingleFilter > filters = new List < ISingleFilter > ( ) ;
5859
60+ [ RequiresUnreferencedCode ( "Calls LoadImeList()" ) ]
5961 public ConsoleRun ( string [ ] args , ShowHelp showHelp )
6062 {
6163 Args = args ;
@@ -367,6 +369,7 @@ private CommandType RunCommand(string command)
367369 return CommandType . Other ;
368370 }
369371
372+ [ RequiresUnreferencedCode ( "Calls System.Reflection.Assembly.GetTypes()" ) ]
370373 private void LoadImeList ( )
371374 {
372375 Assembly assembly = GetType ( ) . Assembly ;
@@ -391,7 +394,7 @@ private void LoadImeList()
391394 cbxImportItems . Add ( cbxa ) ;
392395 imports . Add (
393396 cbxa . ShortCode ,
394- assembly . CreateInstance ( type . FullName ) as IWordLibraryImport
397+ Type . GetType ( type . FullName ) as IWordLibraryImport
395398 ) ;
396399 }
397400 if ( type . GetInterface ( "IWordLibraryExport" ) != null )
@@ -400,7 +403,7 @@ private void LoadImeList()
400403 cbxExportItems . Add ( cbxa ) ;
401404 exports . Add (
402405 cbxa . ShortCode ,
403- assembly . CreateInstance ( type . FullName ) as IWordLibraryExport
406+ Type . GetType ( type . FullName ) as IWordLibraryExport
404407 ) ;
405408 }
406409 }
0 commit comments