|
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.Text; |
|
19 using System.Collections.Generic; |
|
20 using CrashItemLib.Crash.Telephony; |
|
21 using CrashItemLib.Crash.Utils; |
|
22 using CrashXmlPlugin.FileFormat.Versions; |
|
23 |
|
24 namespace CrashXmlPlugin.FileFormat.Segment.Entries.Telephony |
|
25 { |
|
26 internal class CXmlSegTelephony : CXmlSegBase |
|
27 { |
|
28 #region Constructors |
|
29 public CXmlSegTelephony() |
|
30 : base( SegConstants.Telephony ) |
|
31 { |
|
32 } |
|
33 #endregion |
|
34 |
|
35 #region From CXmlSegBase |
|
36 public override int SegmentPriority |
|
37 { |
|
38 get { return 100; } |
|
39 } |
|
40 #endregion |
|
41 |
|
42 #region From CXmlNode |
|
43 public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) |
|
44 { |
|
45 CITelephony info = (CITelephony) aParameters.Container.ChildByType( typeof( CITelephony ) ); |
|
46 if ( info != null ) |
|
47 { |
|
48 base.XmlSerialize( aParameters ); |
|
49 } |
|
50 } |
|
51 |
|
52 protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) |
|
53 { |
|
54 CITelephony info = (CITelephony) aParameters.Container.ChildByType( typeof( CITelephony ) ); |
|
55 if ( info != null ) |
|
56 { |
|
57 string phoneNumber = info.PhoneNumber; |
|
58 WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_PhoneNumber, phoneNumber ); |
|
59 |
|
60 string imei = info.IMEI; |
|
61 WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Imei, imei ); |
|
62 |
|
63 string imsi = info.IMSI; |
|
64 WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Imsi, imsi ); |
|
65 } |
|
66 } |
|
67 |
|
68 protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) |
|
69 { |
|
70 CITelephony info = (CITelephony) aParameters.Container.ChildByType( typeof( CITelephony ) ); |
|
71 if ( info != null ) |
|
72 { |
|
73 CITelephonyNetworkInfo networkInfo = info.NetworkInfo; |
|
74 // |
|
75 aParameters.Writer.WriteStartElement( SegConstants.Telephony_Network ); |
|
76 WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Network_Country, networkInfo.Country ); |
|
77 WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Network_Identity, networkInfo.Identity ); |
|
78 WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Network_Cell, networkInfo.CellId ); |
|
79 // |
|
80 string regMode = SymbianUtils.Enum.EnumUtils.ToString( networkInfo.RegistrationMode ); |
|
81 WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Network_Registration, regMode ); |
|
82 // |
|
83 aParameters.Writer.WriteEndElement(); |
|
84 } |
|
85 } |
|
86 #endregion |
|
87 |
|
88 #region Properties |
|
89 #endregion |
|
90 |
|
91 #region From SegBase |
|
92 #endregion |
|
93 |
|
94 #region Data members |
|
95 #endregion |
|
96 } |
|
97 } |