Exemplo n.º 1
0
        public static string GetTree(ICommand com)
        {
            var strb = new TextModBuilder();

            GetTree(com, strb, 0);
            return(strb.ToString());
        }
Exemplo n.º 2
0
            public JsonArray <AudioResource> PropagiateSearch(UserSession session, CallerInfo callerInfo, string keyword)
            {
                var result = factory.Search(keyword);
                var list   = result.UnwrapThrow();

                session.Set(SessionConst.SearchResult, list);

                return(new JsonArray <AudioResource>(list, searchResults =>
                {
                    if (searchResults.Count == 0)
                    {
                        return strings.cmd_search_no_result;
                    }

                    var tmb = new TextModBuilder(callerInfo.IsColor);
                    tmb.AppendFormat(
                        strings.cmd_search_header.Mod().Bold(),
                        ("!search play " + strings.info_number).Mod().Italic(),
                        ("!search add " + strings.info_number).Mod().Italic()).Append("\n");
                    for (int i = 0; i < searchResults.Count; i++)
                    {
                        tmb.AppendFormat("{0}: {1}\n", i.ToString().Mod().Bold(), searchResults[i].ResourceTitle);
                    }

                    return tmb.ToString();
                }));
            }