Пример #1
0
        private static string ReadValue(CalendarReader reader)
        {
            var preview = reader.PeekChar();

            if (preview == '"')
            {
                return(reader.ReadQuotedString());
            }
            var sb = new StringBuilder();

            while (!reader.IsEof)
            {
                var ch = reader.PeekChar();
                if ((ch == '\t' || ch >= 0x20) && ch != 0x7f)
                {
                    sb.Append(reader.ReadChar());
                }
                else
                {
                    return(sb.ToString());
                }
            }
            return(sb.ToString());
        }
Пример #2
0
        private static string ParseParamValue(CalendarReader reader)
        {
            StringBuilder sb = null;

            while (!reader.IsEof)
            {
                var ch = reader.PeekChar();
                if (ch == ':' || ch == ';' || ch == ',' || ch == '"' || ch == 0x7f || (ch < 0x20 && ch != 0x09))
                {
                    return(sb?.ToString());
                }
                ch = reader.ReadChar();
                if (sb == null)
                {
                    sb = new StringBuilder();
                }
                sb.Append(ch);
            }
            return(sb?.ToString());
        }