get the actual text stored in Lines

This commit is contained in:
Michael Becker 2021-03-23 14:53:16 -04:00
parent 9baa9d9361
commit c9d880b602
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -58,7 +58,18 @@ namespace UniversalEditor.ObjectModels.Text.Plain
public System.Collections.Specialized.StringCollection Lines { get { return mvarLines; } }
private string mvarText = String.Empty;
public string Text { get { return String.Join(LineTerminator, Lines); } set { mvarText = value; RebuildLines(); } }
public string Text { get { return GetLines(); } set { mvarText = value; RebuildLines(); } }
private string GetLines()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
foreach (string l in Lines)
{
sb.Append(l);
sb.Append(LineTerminator);
}
return sb.ToString();
}
private string mvarLineTerminator = System.Environment.NewLine;
public string LineTerminator { get { return mvarLineTerminator; } set { mvarLineTerminator = value; RebuildLines(); } }