|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 using System; |
|
18 using System.IO; |
|
19 using System.Xml; |
|
20 using System.Text; |
|
21 using System.Collections.Generic; |
|
22 using SymbianTree; |
|
23 using SymbianUtils; |
|
24 using SymbianXmlInputLib.Elements; |
|
25 using SymbianXmlInputLib.Elements.Types.Extension; |
|
26 |
|
27 namespace SymbianXmlInputLib.Parser.Nodes |
|
28 { |
|
29 public class SXILParserNodeExtension : SXILParserNode |
|
30 { |
|
31 #region Constructors |
|
32 public SXILParserNodeExtension() |
|
33 { |
|
34 } |
|
35 #endregion |
|
36 |
|
37 #region From SXILParserNode |
|
38 public override void XmlParse( XmlNode aNode ) |
|
39 { |
|
40 XmlAttributeCollection attribs = aNode.Attributes; |
|
41 if ( attribs.Count < 1 || attribs[ "name" ] == null ) |
|
42 { |
|
43 throw new ArgumentException( "Mandatory name node missing" ); |
|
44 } |
|
45 |
|
46 XmlAttribute nameAttrib = attribs[ "name" ]; |
|
47 string name = nameAttrib.Value.Trim(); |
|
48 |
|
49 SXILElementExtension.TType type = SXILElementExtension.TType.ETypeSuccess; |
|
50 if ( attribs[ "type" ] != null ) |
|
51 { |
|
52 string typeName = attribs[ "type" ].Value.Trim().ToUpper(); |
|
53 if ( typeName == "FAILED") |
|
54 { |
|
55 type = SXILElementExtension.TType.ETypeFailure; |
|
56 } |
|
57 } |
|
58 |
|
59 SXILElementExtension entry = new SXILElementExtension( name, type ); |
|
60 base.Document.CurrentNode.Add( entry ); |
|
61 } |
|
62 #endregion |
|
63 |
|
64 #region Properties |
|
65 #endregion |
|
66 |
|
67 #region From System.Object |
|
68 public override int GetHashCode() |
|
69 { |
|
70 return "extension".GetHashCode(); |
|
71 } |
|
72 #endregion |
|
73 } |
|
74 } |