BalloonsPop.GraphicUserInterface.Gadgets.StringExtensions.WrapInTextBox C# (CSharp) Метод

WrapInTextBox() публичный статический Метод

Wraps a string in a TextBox element and returns the wrapper TextBox.
public static WrapInTextBox ( this text, System.Windows.Controls.TextBlock box ) : System.Windows.Controls.TextBlock
text this The text to be wrapped inside the TextBox.
box System.Windows.Controls.TextBlock The wrapper TextBox.
Результат System.Windows.Controls.TextBlock
        public static TextBlock WrapInTextBox(this string text, TextBlock box)
        {
            if (text == null)
            {
                throw new NullReferenceException("Provided string was null");
            }

            if (box == null)
            {
                throw new NullReferenceException("Wrapper element was null");
            }

            box.Text = text;

            return box;
        }
StringExtensions