/// <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); }
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>(); }
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(); }
public virtual string OnReadOverload(OverloadNode overload) => overload.ToString();