예제 #1
0
        public static MultiLineTextSource FromString(string[] lines, bool addNewLine = false)
        {
            MultiLineTextSource source = new MultiLineTextSource();

            for (int i = 0; i < lines.Length; i++)
            {
                if (addNewLine)
                {
                    source.AddLine(lines[i] + Environment.NewLine);
                }
                else
                {
                    source.AddLine(lines[i]);
                }
            }

            return(source);
        }
예제 #2
0
        public static MultiLineTextSource FromString(string text)
        {
            string[]            lines  = text.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
            MultiLineTextSource source = new MultiLineTextSource();

            for (int i = 0; i < lines.Length; i++)
            {
                source.AddLine(lines[i] + Environment.NewLine);
            }

            return(source);
        }