Esempio n. 1
0
        static StringRange FromStream(System.IO.MemoryStream stream, System.Text.Encoding enc)
        {
            string      str   = enc.GetString(stream.ToArray());
            StringRange range = new StringRange(str);

            return(range);
        }
Esempio n. 2
0
        //static public implicit operator StringRange(Stream range) { return StringRange.FromString(range); }
        //static public implicit operator TextRange(string inputstring) { return

        static StringRange FromString(string value, bool copy)
        {
            StringRange range = new StringRange(value);

            range.text     = copy ? string.Copy(value) : value;
            range.position = 0;
            range.length   = range.text.Length;
            return(range);
        }