]> O.S.I.I.S - jp/crow.git/commitdiff
clean somme unneeded allocations
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 17 Jan 2021 15:09:01 +0000 (16:09 +0100)
committerj-p <jp_bruyere@hotmail.com>
Sat, 6 Feb 2021 19:28:02 +0000 (20:28 +0100)
13 files changed:
.gitignore
Crow/src/2d/Size.cs
Crow/src/Font.cs
Crow/src/Widgets/Label.cs
Crow/src/Widgets/OldTextBox.cs [new file with mode: 0644]
Crow/src/Widgets/TextBox.cs
Crow/src/Widgets/Widget.cs
Crow/src/styling/StyleReader.cs
Samples/HelloWorld/main.cs
Samples/HelloWorld/ui/helloworld.crow
Samples/PerfTests/Properties/launchSettings.json
Samples/ShowCase/ui/showcase.crow
Samples/common/SampleBase.cs

index 31d6ffa8ecbf505ace7a07ab1df94fa385ea19ee..7f31f93a912e38cd307bfb716c2c0233c74b3aa4 100644 (file)
@@ -18,4 +18,5 @@ src/GraphicObjects/HorizontalWrappingWidget.cs
 TestResult.xml
 *.swp
 *.perf
-.vscode
+*.vscode
+*.diagsession
index 77347f06ad64aa1da340722beadf1656c368619a..2d1d171702f8cc62b69f66eae5113a2f60b9c861 100644 (file)
@@ -63,7 +63,7 @@ namespace Crow
                public override string ToString () => $"{Width},{Height}";
                public static Size Parse(string s)
                {
-                       string[] d = s.Split(new char[] { ',' });
+                       string[] d = s.Split(',');
                        return d.Length == 1 ? new Size(int.Parse(d[0])) : new Size(
                                int.Parse(d[0]),
                                int.Parse(d[1]));
index 4bf5fab3f7f273edbdd56831b487312e38fb6974..89ce7edb33a8b7c6bef0804e5941440297cdcc85 100644 (file)
@@ -93,12 +93,12 @@ namespace Crow
                        Font f = new Font ();
 
                        if (!string.IsNullOrEmpty (s)) {
-                               string[] c = s.TrimStart().TrimEnd().Split (new char[] { ',' });
+                               string[] c = s.TrimStart().TrimEnd().Split (',');
 
                                if (c.Length == 2)
                                        f.Size = int.Parse (c [1].TrimStart());
 
-                               string[] n = c [0].TrimEnd().Split (new char[] { ' ' });
+                               string[] n = c [0].TrimEnd().Split (' ');
 
                                f.Name = n [0];
 
index 3232c4e47cc6f3f4133c7f1f706fa9233ec19b5a..486f58dce6ecda2cdf5fd26c9b227ed44f219f1d 100644 (file)
@@ -11,6 +11,7 @@ using System.ComponentModel;
 using System.Text;
 using System.Diagnostics;
 using Glfw;
+using System.Collections;
 
 namespace Crow {
        internal struct TextSpan
@@ -52,20 +53,103 @@ namespace Crow {
                                HashCode.Combine (Line, Column);
                }
     }
-       internal struct LineSpan
+    internal class LineCollection : ICollection<LineSpan>
     {
-               public readonly int Start;
-               public readonly int End;
-               public readonly int EndIncludingLineBreak;
+               LineSpan[] lines;
+
+        public int Count => throw new NotImplementedException ();
+
+        public bool IsReadOnly => throw new NotImplementedException ();
+
+        public void Add (LineSpan item) {
+            throw new NotImplementedException ();
+        }
+
+        public void Clear () {
+            throw new NotImplementedException ();
+        }
+
+        public bool Contains (LineSpan item) {
+            throw new NotImplementedException ();
+        }
+
+        public void CopyTo (LineSpan[] array, int arrayIndex) {
+            throw new NotImplementedException ();
+        }
+
+        public IEnumerator<LineSpan> GetEnumerator () {
+            throw new NotImplementedException ();
+        }
+
+        public bool Remove (LineSpan item) {
+            throw new NotImplementedException ();
+        }
+
+        IEnumerator IEnumerable.GetEnumerator () {
+            throw new NotImplementedException ();
+        }
+
+        /*public LineSpan this[int index] {
+                       get => lines[index];
+                       set => lines[index] = value;
+               }
+        public int Count => lines.Length;
+        public bool IsReadOnly => false;
+
+        public void Add (LineSpan item) {
+            
+        }
+
+        public void Clear () {
+            throw new NotImplementedException ();
+        }
+
+        public bool Contains (LineSpan item) {
+            throw new NotImplementedException ();
+        }
+
+        public void CopyTo (LineSpan[] array, int arrayIndex) {
+            throw new NotImplementedException ();
+        }
+
+        public IEnumerator<LineSpan> GetEnumerator () {
+            throw new NotImplementedException ();
+        }
+
+        public int IndexOf (LineSpan item) {
+            throw new NotImplementedException ();
+        }
+
+        public void Insert (int index, LineSpan item) {
+            throw new NotImplementedException ();
+        }
+
+        public bool Remove (LineSpan item) {
+            throw new NotImplementedException ();
+        }
+
+        public void RemoveAt (int index) {
+            throw new NotImplementedException ();
+        }
+
+        IEnumerator IEnumerable.GetEnumerator () {
+            throw new NotImplementedException ();
+        }*/
+    }
+    internal struct LineSpan
+    {
+               public int Start;
+               public int Length;
+               public int LengthIncludingLineBreak;
                public int LengthInPixel;
-               public int Length => End - Start;
-               public int LengthIncludingLineBreak => EndIncludingLineBreak - Start;
-               public int LineBreakLength => EndIncludingLineBreak - End;
+               public int End => Start + Length;
+               public int EndIncludingLineBreak => Start + LengthIncludingLineBreak;
+               public int LineBreakLength => LengthIncludingLineBreak - Length;
                public bool HasLineBreak => LineBreakLength > 0;
                public LineSpan (int start, int end, int endIncludingLineBreak) {
                        Start = start;
-                       End = end;
-                       EndIncludingLineBreak = endIncludingLineBreak;
+                       Length = end - start;
+                       LengthIncludingLineBreak = endIncludingLineBreak - start;
                        LengthInPixel = -1;
         }
                public LineSpan WithStartOffset (int start) => new LineSpan (Start + start, End, EndIncludingLineBreak);
@@ -845,13 +929,6 @@ namespace Crow {
                #endregion
 
                #region Keyboard handling
-               void checkShift () {
-                       if (IFace.Shift) {
-                               if (!selectionStart.HasValue)
-                                       selectionStart = currentLoc;
-                       } else
-                               selectionStart = null;
-               }
                public override void onKeyDown (object sender, KeyEventArgs e) {
                        
                        switch (e.Key) {
@@ -912,12 +989,19 @@ namespace Crow {
                        e.Handled = true;                       
                        
                }
-        #endregion
-        /// <summary>
-        /// Update Current Column, line and TextCursorPos
-        /// from mouseLocalPos
-        /// </summary>
-        void updateLocation (Context gr, int clientWidth, ref CharLocation? location)
+               void checkShift () {
+                       if (IFace.Shift) {
+                               if (!selectionStart.HasValue)
+                                       selectionStart = currentLoc;
+                       } else
+                               selectionStart = null;
+               }
+
+               #endregion
+               /// <summary>
+               /// location column from 
+               /// </summary>
+               void updateLocation (Context gr, int clientWidth, ref CharLocation? location)
                {
                        if (location == null)
                                return;
diff --git a/Crow/src/Widgets/OldTextBox.cs b/Crow/src/Widgets/OldTextBox.cs
new file mode 100644 (file)
index 0000000..8c0fce1
--- /dev/null
@@ -0,0 +1,184 @@
+// Copyright (c) 2013-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using Crow.Cairo;
+using Glfw;
+
+namespace Crow
+{
+       public class OldTextBox : OldLabel
+    {
+               #region CTOR
+               protected OldTextBox() {}
+               public OldTextBox(Interface iface, string style = null) : base (iface, style) { }
+               #endregion
+
+               #region GraphicObject overrides
+               [XmlIgnore]public override bool HasFocus   //trigger update when lost focus to errase text beam
+        {
+            get => base.HasFocus;
+            set {
+                               if (base.HasFocus == value)
+                                       return;
+                base.HasFocus = value;
+                RegisterForRedraw();
+            }
+        }
+
+               protected override void onDraw (Context gr)
+               {
+                       base.onDraw (gr);
+               }
+               #endregion
+                       
+        #region Keyboard handling
+               public override void onKeyDown (object sender, KeyEventArgs e)
+               {
+                       Key key = e.Key;
+
+                       switch (key)
+                       {
+                       case Key.Backspace:
+                               if (CurrentPosition == 0)
+                                       return;
+                               DeleteChar();
+                               break;
+                       case Key.Delete:
+                               if (selectionIsEmpty) {
+                                       if (!MoveRight ())
+                                               return;
+                               }else if (IFace.Shift)
+                                       IFace.Clipboard = SelectedText;
+                               DeleteChar ();
+                               break;
+                       case Key.KeypadEnter:
+                       case Key.Enter:
+                               if (!selectionIsEmpty)
+                                       DeleteChar ();
+                               if (Multiline)
+                                       InsertLineBreak ();
+                               else
+                                       OnTextChanged(this,new TextChangeEventArgs(Text));
+                               break;
+                       case Key.Escape:
+                               Text = "";
+                               CurrentColumn = 0;
+                               SelRelease = -1;
+                               break;
+                       case Key.Home:
+                               if (IFace.Shift) {
+                                       if (selectionIsEmpty)
+                                               SelBegin = new Point (CurrentColumn, CurrentLine);
+                                       if (IFace.Ctrl)
+                                               CurrentLine = 0;
+                                       CurrentColumn = 0;
+                                       SelRelease = new Point (CurrentColumn, CurrentLine);
+                                       break;
+                               }
+                               SelRelease = -1;
+                               if (IFace.Ctrl)
+                                       CurrentLine = 0;
+                               CurrentColumn = 0;
+                               break;
+                       case Key.End:
+                               if (IFace.Shift) {
+                                       if (selectionIsEmpty)
+                                               SelBegin = CurrentPosition;
+                                       if (IFace.Ctrl)
+                                               CurrentLine = int.MaxValue;
+                                       CurrentColumn = int.MaxValue;
+                                       SelRelease = CurrentPosition;
+                                       break;
+                               }
+                               SelRelease = -1;
+                               if (IFace.Ctrl)
+                                       CurrentLine = int.MaxValue;
+                               CurrentColumn = int.MaxValue;
+                               break;
+                       case Key.Insert:
+                               if (IFace.Shift)
+                                       this.Insert (IFace.Clipboard);
+                               else if (IFace.Ctrl && !selectionIsEmpty)
+                                       IFace.Clipboard = this.SelectedText;
+                               break;
+                       case Key.Left:
+                               if (IFace.Shift) {
+                                       if (selectionIsEmpty)
+                                               SelBegin = new Point(CurrentColumn, CurrentLine);
+                                       if (IFace.Ctrl)
+                                               GotoWordStart ();
+                                       else if (!MoveLeft ())
+                                               return;
+                                       SelRelease = CurrentPosition;
+                                       break;
+                               }
+                               SelRelease = -1;
+                               if (IFace.Ctrl)
+                                       GotoWordStart ();
+                               else
+                                       MoveLeft();
+                               break;
+                       case Key.Right:
+                               if (IFace.Shift) {
+                                       if (selectionIsEmpty)
+                                               SelBegin = CurrentPosition;
+                                       if (IFace.Ctrl)
+                                               GotoWordEnd ();
+                                       else if (!MoveRight ())
+                                               return;
+                                       SelRelease = CurrentPosition;
+                                       break;
+                               }
+                               SelRelease = -1;
+                               if (IFace.Ctrl)
+                                       GotoWordEnd ();
+                               else
+                                       MoveRight ();
+                               break;
+                       case Key.Up:
+                               if (IFace.Shift) {
+                                       if (selectionIsEmpty)
+                                               SelBegin = CurrentPosition;
+                                       CurrentLine--;
+                                       SelRelease = CurrentPosition;
+                                       break;
+                               }
+                               SelRelease = -1;
+                               CurrentLine--;
+                               break;
+                       case Key.Down:
+                               if (IFace.Shift) {
+                                       if (selectionIsEmpty)
+                                               SelBegin = CurrentPosition;
+                                       CurrentLine++;
+                                       SelRelease = CurrentPosition;
+                                       break;
+                               }
+                               SelRelease = -1;
+                               CurrentLine++;                          
+                               break;
+                       case Key.Tab:
+                               this.Insert ("\t");
+                               break;
+                       default:
+                               break;
+                       }
+                       e.Handled = true;
+                       base.onKeyDown (sender, e);
+                       RegisterForGraphicUpdate ();
+               }
+               public override void onKeyPress (object sender, KeyPressEventArgs e)
+               {
+                       base.onKeyPress (sender, e);
+
+                       this.Insert (e.KeyChar.ToString());
+
+                       SelRelease = -1;
+                       SelBegin = new Point(CurrentColumn, SelBegin.Y);
+
+                       RegisterForGraphicUpdate();
+               }
+        #endregion
+       } 
+}
index aa916999295c4a5b9c679e35fea07ee97c046250..f33f89d02c98b820b66a40ee6b2393a21c82a5fe 100644 (file)
@@ -7,30 +7,13 @@ using Glfw;
 
 namespace Crow
 {
-       public class TextBox : OldLabel
+       public class TextBox : Label
     {
                #region CTOR
                protected TextBox() {}
                public TextBox(Interface iface, string style = null) : base (iface, style) { }
                #endregion
 
-               #region GraphicObject overrides
-               [XmlIgnore]public override bool HasFocus   //trigger update when lost focus to errase text beam
-        {
-            get => base.HasFocus;
-            set {
-                               if (base.HasFocus == value)
-                                       return;
-                base.HasFocus = value;
-                RegisterForRedraw();
-            }
-        }
-
-               protected override void onDraw (Context gr)
-               {
-                       base.onDraw (gr);
-               }
-               #endregion
                        
         #region Keyboard handling
                public override void onKeyDown (object sender, KeyEventArgs e)
@@ -39,7 +22,7 @@ namespace Crow
 
                        switch (key)
                        {
-                       case Key.Backspace:
+                       /*case Key.Backspace:
                                if (CurrentPosition == 0)
                                        return;
                                DeleteChar();
@@ -160,24 +143,23 @@ namespace Crow
                                break;
                        case Key.Tab:
                                this.Insert ("\t");
-                               break;
+                               break;*/
                        default:
+                               base.onKeyDown (sender, e);
                                break;
                        }
                        e.Handled = true;
-                       base.onKeyDown (sender, e);
-                       RegisterForGraphicUpdate ();
                }
                public override void onKeyPress (object sender, KeyPressEventArgs e)
                {
                        base.onKeyPress (sender, e);
 
-                       this.Insert (e.KeyChar.ToString());
+                       /*Insert (e.KeyChar.ToString());
 
                        SelRelease = -1;
                        SelBegin = new Point(CurrentColumn, SelBegin.Y);
 
-                       RegisterForGraphicUpdate();
+                       RegisterForGraphicUpdate();*/
                }
         #endregion
        } 
index afaeebeb4bcb6bea83a50ea193fde7175691f684..e76c807fcc1c72c16b1cc15b5dfeaebddc0f6b15 100644 (file)
@@ -203,11 +203,13 @@ namespace Crow
                public virtual void NotifyValueChanged(string MemberName, object _value)
                {
                        //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
-                       ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+                       if (ValueChanged != null)
+                               ValueChanged.Invoke(this, new ValueChangeEventArgs(MemberName, _value));
                }
                public void NotifyValueChangedAuto (object _value, [CallerMemberName] string caller = null)
                {
-                       NotifyValueChanged (caller, _value);
+                       if (ValueChanged != null)
+                               NotifyValueChanged (caller, _value);
                }
                #endregion
 
@@ -1573,10 +1575,12 @@ namespace Crow
                                RegisterForLayouting (LayoutingType.Y);
                                break;
                        }
-                       LayoutChanged.Raise (this, new LayoutingEventArgs (layoutType));
+                       if (LayoutChanged != null)
+                               LayoutChanged.Invoke (this, new LayoutingEventArgs (layoutType));
                }
                internal protected void raiseLayoutChanged(LayoutingEventArgs e){
-                       LayoutChanged.Raise (this, e);
+                       if (LayoutChanged != null)
+                               LayoutChanged.Raise (this, e);
                }
                /// <summary> Update layout component only one at a time, this is where the computation of alignement
                /// and size take place.
index 84839890a5826234d16eb83addcd2106ef037ead..2602b7a8a3d911085935de434131d67e72500b6d 100644 (file)
@@ -7,6 +7,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Reflection;
 using System.Text.RegularExpressions;
+using System.Globalization;
 using Crow.Coding;
 
 namespace Crow
@@ -15,8 +16,7 @@ namespace Crow
        /// Parser for style files.
        /// </summary>
        //TODO: style key shared by different class may use only first encouneter class setter, which can cause bug.
-       public class StyleReader : StreamReader
-       {
+       public class StyleReader : StreamReader {
                enum States { classNames, members, value, endOfStatement }
 
                States curState = States.classNames;
@@ -24,17 +24,24 @@ namespace Crow
                int line = 1;
 
                #region Character ValidityCheck
-               static Regex rxValidChar = new Regex(@"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf}");
-               static Regex rxNameStartChar = new Regex(@"_|\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}");                                                                                                                      
-               static Regex rxNameChar = new Regex(@"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf}");
-               static Regex rxDecimal = new Regex(@"[0-9]+");
-               static Regex rxHexadecimal = new Regex(@"[0-9a-fA-F]+");
+               /*static Regex rxValidChar = new Regex (@"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf}");
+               static Regex rxNameStartChar = new Regex (@"_|\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}");
+               static Regex rxNameChar = new Regex (@"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf}");
+               static Regex rxDecimal = new Regex (@"[0-9]+");
+               static Regex rxHexadecimal = new Regex (@"[0-9a-fA-F]+");*/
 
-               bool nextCharIsValidCharStartName {
-                       get => rxNameStartChar.IsMatch(new string(new char[]{PeekChar()}));
-               }
+               bool nextCharIsValidCharStartName => Char.IsLetter (PeekChar ()) || PeekChar () == '_';
                bool nextCharIsValidCharName {
-                       get => rxNameChar.IsMatch(new string(new char[]{PeekChar()})); 
+                       get {
+                               if (Char.IsLetterOrDigit (PeekChar ()))
+                                       return true;
+                               UnicodeCategory uc = Char.GetUnicodeCategory (PeekChar ());
+                               return
+                                       uc == UnicodeCategory.NonSpacingMark ||
+                                       uc == UnicodeCategory.SpacingCombiningMark ||
+                                       uc == UnicodeCategory.ConnectorPunctuation ||
+                                       uc == UnicodeCategory.Format;
+                       }
                }
                #endregion
 
index 44ec3fb882dc7468852a8e94b546c17e66d9cbba..73288f1b00e625e853237d07a31f3ee504f79433 100644 (file)
@@ -3,10 +3,10 @@ using Crow;
 
 namespace HelloWorld
 {
-       class Program {
+       class Program : SampleBase {
                static void Main (string[] args) {
-                       using (Interface app = new Interface ()) {
-                               app.Initialized += (sender, e) => (sender as Interface).Load ("#HelloWorld.helloworld.crow");
+                       using (Interface app = new Program ()) {
+                               app.Initialized += (sender, e) => (sender as Interface).Load ("#HelloWorld.helloworld.crow").DataSource = sender;
                                app.Run ();
                        }
                }
index fe05d1e284d65a39ae634b2f9a054beac5440028..b178bbf2461106f7ab3c7d3f5b296a5369aad70b 100644 (file)
@@ -1,2 +1,26 @@
 <?xml version="1.0"?>
-<Label Text="Hello World"/>
\ No newline at end of file
+<HorizontalStack >
+       <VerticalStack Background="Jet" Height="Stretched" Width="50%" Margin="10" >
+               <TextBox Margin="0"  Text="Hello World this is a test string" Focusable="true" Font="serif,14"/>
+               <TextBox Margin="15" Text="Hello World this is a test string" Focusable="true" Font="serif,14"
+                          Background="Grey" Focused="{Background=White}" Unfocused="{Background=Grey}"/>
+               <TextBox Width="300" Height="50"  Text="Hello World this is a test string" Focusable="true" Font="serif,14"
+                          Background="Grey" Focused="{Background=White}" Unfocused="{Background=Grey}"/>
+               <TextBox TextAlignment="Right" Width="300" Height="50"  Text="Hello World this is a test string" Focusable="true" Font="serif,14"
+                          Background="Grey" Focused="{Background=White}" Unfocused="{Background=Grey}"/>
+               <TextBox Name="lab" TextAlignment="Center" Width="Fit" Height="50"  Text="Hello World this is a test string" Focusable="true" Font="serif,14"
+                          Background="Grey" Focused="{Background=White}" Unfocused="{Background=Grey}"/>
+       </VerticalStack>
+       <VerticalStack Background="Jet" Height="Stretched" Margin="10">
+               <TextBox Multiline="true" TextAlignment="{TextAlignment}" Width="320" Height="Fit"
+                                Text="{MultilineText}" Focusable="true" Font="consolas,12" 
+                                Background="Grey" Focused="{Background=White}" Unfocused="{Background=Grey}"/>
+               <EnumSelector RadioButtonStyle="CheckBox2" Caption="Text Alignment" EnumValue="{²TextAlignment}" >
+                       <Template>
+                               <GroupBox Caption="{./Caption}" CornerRadius="{./CornerRadius}" Foreground="{./Foreground}" Background="{./Background}">
+                                       <VerticalStack Name="Content"/>
+                               </GroupBox>
+                       </Template>
+               </EnumSelector>
+       </VerticalStack>
+</HorizontalStack>
\ No newline at end of file
index 278f5ab30cbeb54032863d253b77a2c644e1aa2f..49325a0c24826660b2c2c47a2a3b9e5dcc1c745f 100644 (file)
@@ -2,7 +2,7 @@
   "profiles": {
     "PerfTests": {
       "commandName": "Project",
-      "commandLineArgs": "-c 20 -u 99 -s -i Interfaces/PerfLabels"
+      "commandLineArgs": "-c 20 -i Interfaces/PerfLabels"
     }
   }
 }
\ No newline at end of file
index 7610e9b6b5481a332e88d0c365f5f80c2f579624..95aa09997928a2a6956f003f590f273bb7d9a578 100644 (file)
@@ -22,7 +22,7 @@
                                <Scroller Name="scroller1" Background="White"
                                                Margin="2" ScrollY="{../scrollbar1.Value}">
                                        <TextBox VerticalAlignment="Top"
-                                               Text="{²Source}" Multiline="true" TextAlignment="TopLeft"
+                                               Text="{²Source}" Multiline="true"
                                                Font="mono 10"/>
                                </Scroller>
                                <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
index cb24dad62c83deb5f3091a94b80feb25f5e9e13a..8e7befc523190b961357262abe81957315bbcd59 100644 (file)
@@ -41,7 +41,7 @@ namespace Crow
                DirectoryInfo curDir = new DirectoryInfo (Path.GetDirectoryName (Assembly.GetEntryAssembly ().Location));
                public FileSystemInfo[] CurDirectory => curDir.GetFileSystemInfos ();
                public string MultilineText =
-                       $"Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit. Sed non risus.\n\nSuspendisse lectus tortor,";
+                       $"Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit. Sed non risus.\n\nSuspendisse lectus tortor,\nLorem ipsum dolor sit amet,\nconsectetur adipiscing elit. Sed non risus.\n\nSuspendisse lectus tortor,";
                //public string MultilineText = $"a\n";
                TextAlignment textAlignment = TextAlignment.Left;
                public TextAlignment TextAlignment {