2 * Copyright 2008 ZXing authors
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 using Result = com.google.zxing.Result;
\r
18 namespace com.google.zxing.client.result
\r
21 /// <summary> Partially implements the iCalendar format's "VEVENT" format for specifying a
\r
22 /// calendar event. See RFC 2445. This supports SUMMARY, DTSTART and DTEND fields.
\r
25 /// <author> Sean Owen
\r
27 /// <author>www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source
\r
29 sealed class VEventResultParser:ResultParser
\r
32 private VEventResultParser()
\r
36 public static CalendarParsedResult parse(Result result)
\r
38 System.String rawText = result.Text;
\r
39 if (rawText == null)
\r
43 int vEventStart = rawText.IndexOf("BEGIN:VEVENT");
\r
44 if (vEventStart < 0)
\r
48 int vEventEnd = rawText.IndexOf("END:VEVENT");
\r
54 System.String summary = VCardResultParser.matchSingleVCardPrefixedField("SUMMARY", rawText, true);
\r
55 System.String start = VCardResultParser.matchSingleVCardPrefixedField("DTSTART", rawText, true);
\r
56 System.String end = VCardResultParser.matchSingleVCardPrefixedField("DTEND", rawText, true);
\r
59 return new CalendarParsedResult(summary, start, end, null, null, null);
\r
61 catch (System.ArgumentException iae)
\r