public ChangelogEntry(ChangelogEntryType type, string username, string computerName, DateTimeOffset time) { Type = type; ComputerName = computerName; Username = username; Time = time; }
private static IconUsage getIconForChangelogEntry(ChangelogEntryType entryType) { // compare: https://github.com/ppy/osu-web/blob/master/resources/assets/coffee/react/_components/changelog-entry.coffee#L8-L11 switch (entryType) { case ChangelogEntryType.Add: return(FontAwesome.Solid.Plus); case ChangelogEntryType.Fix: return(FontAwesome.Solid.Check); case ChangelogEntryType.Misc: return(FontAwesome.Regular.Circle); default: throw new ArgumentOutOfRangeException(nameof(entryType), $"Unrecognised entry type {entryType}"); } }
public void GetChangelog(ref StringBuilder sb) { ChangelogEntryType lastType = (ChangelogEntryType)255; ChangelogEntryScope lastScope = (ChangelogEntryScope)255; sb.Append("\n\n---------- \n"); sb.Append("# "); sb.Append(GetVersionHeader()); sb.Append("\n"); sb.Append(descriptionText); sb.Append("\n"); for (int j = 0; j < notes.Count; ++j) { if (lastType != notes[j].type) { if (lastType != (ChangelogEntryType)255) { sb.Append("\n"); } lastType = notes[j].type; lastScope = (ChangelogEntryScope)255; sb.Append("### "); sb.Append(notes[j].type); sb.Append(": \n"); } if (lastScope != notes[j].scope) { lastScope = notes[j].scope; sb.Append("#### "); sb.Append(notes[j].scope); sb.Append(": \n"); } notes[j].GetChangelog(ref sb); } }
/// <summary> /// Construct a <see cref="ChangelogEntry"/> /// </summary> /// <param name="text">The value of <see cref="Text"/></param> /// <param name="type">The value of <see cref="Type"/></param> public ChangelogEntry(string text, ChangelogEntryType type) { this.text = text ?? throw new ArgumentNullException(nameof(text)); this.type = type; }