Esempio n. 1
0
        /// <summary>
        /// Opens a new report.
        /// </summary>
        public int Open(IUser user, OverloadNode overload, ReportBody info, ReportTag tag)
        {
            Reports.Add(new Report(CaseCount, overload, user, info, tag));
            int id = CaseCount;

            CaseCount++;
            return(id);
        }
Esempio n. 2
0
 internal Report(int id, OverloadNode overload, IUser user, ReportBody reportInfo, ReportTag tag)
 {
     Id        = id;
     CommandId = overload.Id;
     Author    = new Author(user);
     CreatedAt = DateTime.UtcNow;
     Title     = reportInfo.Title;
     Content   = reportInfo.Content;
     ImageUrl  = reportInfo.ImageUrl;
     Tag       = tag;
     State     = ReportState.Open;
     Votes     = new List <VoteInfo>();
 }
Esempio n. 3
0
        private static void SetExample(OverloadNode command, string prefix)
        {
            var result = new StringBuilder();

            result.Append(prefix);
            result.Append(command.Name);

            if (command.Parameters.Count > 0)
            {
                result.Append(' ');
                result.AppendJoin(" ", command.Parameters.Select(GetExampleArg));
            }

            command.Example = result.ToString();
        }
Esempio n. 4
0
 public virtual string OnReadOverload(OverloadNode overload)
 => overload.ToString();