public CustomLogSummaryVm(LogEntry sourceEntry, CustomLogTemplate template, IEnumerable <string> matchValues) : base(sourceEntry) { _sourceModule = SourceEntry.GetModule(); _matchValues = matchValues?.ToArray() ?? Array.Empty <string>(); Template = template; var matchCollec = Regex.Match(Template.Details, @".*(\[(.*)\])"); var details = template.Details; details = Preformat(details); if (matchCollec.Success) { var collecString = matchCollec.Groups[1].Value; _details = TryFormat(details.Replace(collecString, "?"), _matchValues); } else { _details = TryFormat(details, _matchValues); } _typeName = Template.TypeName?.Replace("{m}", _sourceModule); }
public CustomLogTemplateVm(CustomLogTemplate template) { Template = template; }
public static CustomLogSummaryVm BuildFromTemplate(LogEntry entry, CustomLogTemplate template, Match match) { return(new CustomLogSummaryVm(entry, template, match?.Groups.Cast <Group>().Skip(1).Select(x => x.Value))); }