2 * Copyright 2007 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> <p>Abstract class representing the result of decoding a barcode, as more than
\r
22 /// a String -- as some type of structured data. This might be a subclass which represents
\r
23 /// a URL, or an e-mail address. {@link ResultParser#parseResult(Result)} will turn a raw
\r
24 /// decoded string into the most appropriate type of structured representation.</p>
\r
26 /// <p>Thanks to Jeff Griffin for proposing rewrite of these classes that relies less
\r
27 /// on exception-based mechanisms during parsing.</p>
\r
30 /// <author> Sean Owen
\r
32 /// <author>www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source
\r
34 public abstract class ParsedResult
\r
36 virtual public ParsedResultType Type
\r
44 public abstract System.String DisplayResult{get;}
\r
46 //UPGRADE_NOTE: Final was removed from the declaration of 'type '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
\r
47 private ParsedResultType type;
\r
49 protected internal ParsedResult(ParsedResultType type)
\r
54 public override System.String ToString()
\r
56 return DisplayResult;
\r
59 public static void maybeAppend(System.String value_Renamed, System.Text.StringBuilder result)
\r
61 if (value_Renamed != null && value_Renamed.Length > 0)
\r
63 // Don't add a newline before the first value
\r
64 if (result.Length > 0)
\r
66 result.Append('\n');
\r
68 result.Append(value_Renamed);
\r
72 public static void maybeAppend(System.String[] value_Renamed, System.Text.StringBuilder result)
\r
74 if (value_Renamed != null)
\r
76 for (int i = 0; i < value_Renamed.Length; i++)
\r
78 if (value_Renamed[i] != null && value_Renamed[i].Length > 0)
\r
80 if (result.Length > 0)
\r
82 result.Append('\n');
\r
84 result.Append(value_Renamed[i]);
\r