public static void DisplayLoadedPlugins() { UserInteraction.ShowMessage(String.Format("Loaded {0} command plugins\n\r", Commands.Count)); foreach (ICommandPlugin plugin in Commands) { IDescribable description = (IDescribable)plugin; UserInteraction.ShowMessage(String.Format($"{description.GetName()}\n\r{description.GetDescription()}\n\r-----------\n\r")); } }
public string[] Handle(string[] args) { List <string> returns = new List <string>(); bool found = false; foreach (ICommandPlugin plugin in PluginRepository.Commands) { if ((args.Length > 0 && plugin.CanHandle(args[0])) || args.Length == 0) { found = true; IDescribable description = (IDescribable)plugin; returns.Add(description.GetName() + "\n\r" + description.GetDescription()); } } if (!found) { returns.Add("The command " + args[0] + " is unrecongnised and therefore has no help text available"); } return(returns.ToArray()); }