private IEnumerable <IInlineCommand> LoadAllInlineCommandsFromAssembly(Assembly assembly) { IDictionary <string, IList <IInlineCommand> > icommands = new Dictionary <string, IList <IInlineCommand> >(); foreach (Type t in GetAllTypesThatImplement(assembly, typeof(IInlineCommand))) { IInlineCommand icommand = (IInlineCommand)kernel.Get(t); string ns = icommand.GetNameSpace(); if (String.IsNullOrWhiteSpace(ns)) { throw new ApplicationException("Could not load inline command from type[" + t.FullName + "]. No namespace specified."); } if (ns.IndexOf('.') > 0) { throw new ApplicationException("Nested namespaces (namespaces with '.' in them) are not supported."); } if (!icommands.ContainsKey(ns)) { icommands.Add(ns, new List <IInlineCommand>()); } if (icommand.GetType().Assembly.FullName.IndexOf("js.net.test.module") < 0) { helpManager.AddHelpForInlineCommand(icommand); } icommands[ns].Add(icommand); } return(icommands.Values.SelectMany(c => c)); }
private string GetCommandName(ICommandBase command) { Trace.Assert(command != null); if (command is IConsoleCommand) { return('.' + command.GetName()); } IInlineCommand icommand = (IInlineCommand)command; return(icommand.GetNameSpace() + '.' + icommand.GetName()); }
public void AddHelpForInlineCommand(IInlineCommand command) { Trace.Assert(command != null); AddHelpImpl(inlineCommandHelps, command); }
public void AddHelpForInlineCommand(IInlineCommand command) { Trace.Assert(command != null); AddHelpImpl(inlineCommandHelps, command); }