wrapping, added last update field

This commit is contained in:
Llywelwyn 2022-07-25 11:45:22 +01:00
parent dd2aef92a6
commit 8c58930bc8
3 changed files with 17 additions and 5 deletions

View file

@ -11,13 +11,13 @@
<Grid>
<controls:MetroAnimatedTabControl Margin="10">
<TabItem Header="Employment">
<TextBox x:Name="EmploymentBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/>
<TextBox x:Name="EmploymentBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas" TextWrapping="Wrap"/>
</TabItem>
<TabItem Header="Medical">
<TextBox x:Name="MedicalBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/>
<TextBox x:Name="MedicalBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas" TextWrapping="Wrap"/>
</TabItem>
<TabItem Header="Security">
<TextBox x:Name="SecurityBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/>
<TextBox x:Name="SecurityBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas" TextWrapping="Wrap"/>
</TabItem>
</controls:MetroAnimatedTabControl>
</Grid>

View file

@ -104,10 +104,12 @@ namespace CharacterRecordsGenerator
!_employmentSkills.Any())
{
recordText.AppendLine("/// NO EMPLOYMENT RECORD FOUND ///");
recordText.AppendLine();
}
else
{
recordText.AppendLine("/// EMPLOYMENT RECORD ///");
recordText.AppendLine("This information has been verified by employment agents within the External Affairs department, and any comments, questions, or concerns about the legitimacy of such must be sent in a secure document to the same department.");
recordText.AppendLine();
WriteSectionIfAny(ref recordText,
@ -121,8 +123,10 @@ namespace CharacterRecordsGenerator
WriteSectionIfAny(ref recordText,
"Other skills:",
_employmentSkills);
}
recordText.AppendLine($"LAST UPDATED: {Utility.HumanisedDate(Info.IcDate)}");
return recordText.ToString();
}
@ -145,6 +149,7 @@ namespace CharacterRecordsGenerator
!_targetRecord.NoRevive)
{
recordText.AppendLine("/// NO MEDICAL RECORD FOUND ///");
recordText.AppendLine();
}
else
{
@ -189,8 +194,10 @@ namespace CharacterRecordsGenerator
WriteSectionIfAny(ref recordText,
"Prescriptions:",
_medicalPrescriptions);
}
}
recordText.AppendLine($"LAST UPDATED: {Utility.HumanisedDate(Info.IcDate)}");
return recordText.ToString();
}
@ -208,6 +215,7 @@ namespace CharacterRecordsGenerator
!_securityAttitudeCrew.Any())
{
recordText.AppendLine("/// NO SECURITY RECORD FOUND ///");
recordText.AppendLine();
}
else
{
@ -231,6 +239,7 @@ namespace CharacterRecordsGenerator
_securityRecords);
}
recordText.AppendLine($"LAST UPDATED: {Utility.HumanisedDate(Info.IcDate)}");
return recordText.ToString();
}
}

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Humanizer;
namespace CharacterRecordsGenerator
{
@ -33,6 +34,8 @@ namespace CharacterRecordsGenerator
/// <returns></returns>
public static string SpaceIfValue(this string val) => string.IsNullOrWhiteSpace(val) ? string.Empty : $"{val} ";
public static string HumanisedDate(DateTime date) => $"{date.ToString("MMMM")} {date.Day.Ordinalize()}, {date.Year}";
public static string IfEmpty(this string target, string fallback) =>
target.IsEmpty() ? fallback : target;