Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public TypeInfo SecondTry(string commandName)
- {
- TypeInfo type = null;
- Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
- foreach (var item in assemblies)
- {
- var result = item.GetType().GetTypeInfo().Assembly;
- var searchetResult = result.DefinedTypes.
- Where(curT => curT.ImplementedInterfaces.
- Any(i => i == typeof(ICommand))).Where(n => n.Name.ToLower() == commandName.ToLower() + "command").SingleOrDefault();
- if (searchetResult!=null)
- {
- type = searchetResult;
- break;
- }
- }
- return type;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement