public CommandInfo(ICommand command, CommandCategoryInfo categoryInfo, string id) { Command = command; CategoryInfo = categoryInfo; Id = id; Title = string.IsNullOrEmpty(command.Text) ? Regex.Replace(id, @"(\S)(\p{Lu}|\d)", "$1 $2") : command.Text; }
public static IEnumerable <CommandInfo> RegisteredCommandInfo(CommandCategoryInfo categoryInfo) { foreach (var commandInfo in categoryInfo.Commands.Values) { yield return(commandInfo); } }
public static bool TryGetCommandInfo(CommandCategoryInfo categoryInfo, string commandId, out CommandInfo commandInfo) { return(categoryInfo.Commands.TryGetValue(commandId, out commandInfo)); }