|
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 CrashXmlPlugin.FileFormat.Segment; |
|
21 using CrashXmlPlugin.FileFormat.Versions; |
|
22 using CrashXmlPlugin.FileFormat.Node; |
|
23 using CrashXmlPlugin.FileFormat.Document; |
|
24 using CrashItemLib.Crash.Base; |
|
25 using CrashItemLib.Crash.Messages; |
|
26 |
|
27 namespace CrashXmlPlugin.FileFormat.Segment.Entries |
|
28 { |
|
29 internal abstract class CXmlSegBase : CXmlNode |
|
30 { |
|
31 #region Constructors |
|
32 protected CXmlSegBase( string aName ) |
|
33 : base( aName ) |
|
34 { |
|
35 } |
|
36 #endregion |
|
37 |
|
38 #region Framework API |
|
39 public abstract int SegmentPriority |
|
40 { |
|
41 get; |
|
42 } |
|
43 #endregion |
|
44 |
|
45 #region API |
|
46 public static void XmlSerializeMessages( CXmlDocumentSerializationParameters aParameters, CIElement aElement ) |
|
47 { |
|
48 CIElementList<CIMessage> messages = aElement.ChildrenByType<CIMessage>(); |
|
49 foreach ( CIMessage msg in messages ) |
|
50 { |
|
51 CXmlNode.WriteLink( msg.Id, SegConstants.Messages, aParameters.Writer ); |
|
52 } |
|
53 } |
|
54 #endregion |
|
55 |
|
56 #region From CXmlNode |
|
57 public override void XmlSerialize( CXmlDocumentSerializationParameters aParameters ) |
|
58 { |
|
59 iWasSerialized = true; |
|
60 base.XmlSerialize( aParameters ); |
|
61 } |
|
62 #endregion |
|
63 |
|
64 #region Properties |
|
65 public CXmlVersionExtended Version |
|
66 { |
|
67 get { return iVersion; } |
|
68 } |
|
69 |
|
70 public bool WasSerialized |
|
71 { |
|
72 get { return iWasSerialized; } |
|
73 } |
|
74 #endregion |
|
75 |
|
76 #region Internal methods |
|
77 #endregion |
|
78 |
|
79 #region Data members |
|
80 private CXmlVersionExtended iVersion = new CXmlVersionExtended(); |
|
81 private bool iWasSerialized = false; |
|
82 #endregion |
|
83 } |
|
84 } |