Пример #1
0
 private Report(ReportTitle title, string description, ReportShortcut shortcut, Color color)
 {
     Title       = title;
     Description = description;
     Shortcut    = shortcut;
     Color       = color;
     CreateTime  = DateTime.Now;
     Id          = Guid.NewGuid();
 }
Пример #2
0
 public static Report Make(
     Guid id,
     ReportTitle title,
     string description,
     ReportShortcut shortcut,
     Color color,
     TimeSpan averageDuration,
     DateTime createTime,
     int downloads)
 => new Report(
     id,
     title,
     description,
     shortcut,
     color,
     averageDuration,
     createTime,
     downloads,
     new UserId[0],
     new CompanyId[0]);
Пример #3
0
 private Report(
     Guid id,
     ReportTitle title,
     string description,
     ReportShortcut shortcut,
     Color color,
     TimeSpan averageDuration,
     DateTime createTime,
     int downloads,
     UserId[] allowedUsers,
     CompanyId[] allowedCompanies
     )
 {
     Id                    = id;
     Title                 = title;
     Description           = description;
     Shortcut              = shortcut;
     Color                 = color;
     AverageGenerationTime = averageDuration;
     CreateTime            = createTime;
     DownloadTimes         = downloads;
     _allowedUsers         = new List <UserId>(allowedUsers);
     _allowedCompanies     = new List <CompanyId>(allowedCompanies);
 }
Пример #4
0
 public static Report CreateNew(ReportTitle title, string description, ReportShortcut shortcut, Color color, IReportUniqueTitleChecker checker)
 {
     CheckRule(new ReportTitleMustBeUniqueRule(checker, title));
     return(new Report(title, description, shortcut, color));
 }