crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Memory/CXmlSegMemoryInfo.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     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.Base;
       
    21 using CrashItemLib.Crash.Memory;
       
    22 using CrashItemLib.Crash.Utils;
       
    23 using CrashXmlPlugin.FileFormat.Versions;
       
    24 
       
    25 namespace CrashXmlPlugin.FileFormat.Segment.Entries.Memory
       
    26 {
       
    27     internal class CXmlSegMemoryInfo : CXmlSegBase
       
    28 	{
       
    29 		#region Constructors
       
    30         public CXmlSegMemoryInfo()
       
    31             : base( SegConstants.MemoryInfo )
       
    32 		{
       
    33 		}
       
    34 		#endregion
       
    35 
       
    36         #region From CXmlSegBase
       
    37         public override int SegmentPriority
       
    38         {
       
    39             get { return 110; }
       
    40         }
       
    41         #endregion
       
    42 
       
    43         #region From CXmlNode
       
    44         public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters )
       
    45         {
       
    46             iList = aParameters.Container.ChildrenByType<CIMemoryInfo>( CIElement.TChildSearchType.EEntireHierarchy );
       
    47             //
       
    48             if ( iList != null && iList.Count > 0 )
       
    49             {
       
    50                 base.XmlSerialize( aParameters );
       
    51             }
       
    52             //
       
    53             iList = null;
       
    54         }
       
    55 
       
    56         protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters )
       
    57         {
       
    58             System.Diagnostics.Debug.Assert( iList != null );
       
    59             foreach ( CIMemoryInfo info in iList )
       
    60             {
       
    61                 string name = SegConstants.MemoryInfo_Drive;
       
    62                 if ( info.Type == CIMemoryInfo.TType.ETypeRAM )
       
    63                 {
       
    64                     name = SegConstants.MemoryInfo_RAM;
       
    65                 }
       
    66                 //
       
    67                 CXmlMemoryInfo xmlInfo = new CXmlMemoryInfo( info, name );
       
    68                 xmlInfo.XmlSerialize( aParameters );
       
    69             }
       
    70         }
       
    71         #endregion
       
    72 
       
    73         #region Properties
       
    74         #endregion
       
    75 
       
    76         #region From SegBase
       
    77         #endregion
       
    78 
       
    79         #region Data members
       
    80         private CIElementList<CIMemoryInfo> iList = null;
       
    81         #endregion
       
    82     }
       
    83 }