crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Reports/CIReportInfo.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;
       
    21 using CrashItemLib.Crash.Base;
       
    22 using CrashItemLib.Crash.Base.DataBinding;
       
    23 using SymbianUtils.Range;
       
    24 using SymbianStructuresLib.Uids;
       
    25 using SymbianUtils.DataBuffer;
       
    26 using CrashItemLib.Crash.Container;
       
    27 
       
    28 namespace CrashItemLib.Crash.Reports
       
    29 {
       
    30     [CIDBAttributeColumn( "Name", 0 )]
       
    31     [CIDBAttributeColumn( "Value", 1, true )]
       
    32     public class CIReportInfo : CIElement, IEnumerable<CIReportParameter>
       
    33     {
       
    34         #region Constructors
       
    35         public CIReportInfo( CIContainer aContainer )
       
    36             : base( aContainer )
       
    37 		{
       
    38 		}
       
    39 		#endregion
       
    40 
       
    41         #region API
       
    42         public void AddParameter( string aName, uint aValue )
       
    43         {
       
    44             CIReportParameter param = new CIReportParameter( this, aName, aValue );
       
    45             iParameters.Add( param );
       
    46         }
       
    47         #endregion
       
    48 
       
    49         #region Properties
       
    50         /// <summary>
       
    51         /// Type of crash report
       
    52         /// </summary>
       
    53         [CIDBAttributeCell( "Type", 1, "", "" )]
       
    54         public string Type
       
    55         {
       
    56             get { return iType; }
       
    57             set { iType = value; }
       
    58         }
       
    59 
       
    60         /// <summary>
       
    61         /// Reporter name
       
    62         /// </summary>
       
    63         [CIDBAttributeCell( "Name", 2, "", "" )]
       
    64         public override string Name
       
    65         {
       
    66             get { return iName; }
       
    67             set { iName = value; }
       
    68         }
       
    69 
       
    70         [CIDBAttributeCell( "Category", 3, "", "" )]
       
    71         public string Category
       
    72         {
       
    73             get { return iCategory; }
       
    74             set { iCategory = value; }
       
    75         }
       
    76 
       
    77         [CIDBAttributeCell( "Success Count", 4, "", "" )]
       
    78         public uint CountSuccess
       
    79         {
       
    80             get { return iCountSuccess; }
       
    81             set { iCountSuccess = value; }
       
    82         }
       
    83 
       
    84         [CIDBAttributeCell( "Fail Count", 5, "", "" )]
       
    85         public uint CountFail
       
    86         {
       
    87             get { return iCountFail; }
       
    88             set { iCountFail = value; }
       
    89         }
       
    90 
       
    91         /// <summary>
       
    92         /// Misc. reporter comments
       
    93         /// </summary>
       
    94         [CIDBAttributeCell( "Comments", 6, "", "" )]
       
    95         public string Comments
       
    96         {
       
    97             get { return iComments; }
       
    98             set { iComments = value; }
       
    99         }
       
   100 
       
   101         public int ParameterCount
       
   102         {
       
   103             get { return iParameters.Count; }
       
   104         }
       
   105         #endregion
       
   106 
       
   107         #region From CIElement
       
   108         public override void PrepareRows()
       
   109         {
       
   110             base.PrepareRows();
       
   111 
       
   112             // Need to add the version information
       
   113             foreach ( CIReportParameter rp in iParameters )
       
   114             {
       
   115                 DataBindingModel.Add( rp );
       
   116             }
       
   117         }
       
   118         #endregion
       
   119 
       
   120         #region From IEnumerable<CIReportParameter>
       
   121         public new IEnumerator<CIReportParameter> GetEnumerator()
       
   122         {
       
   123             foreach ( CIReportParameter rp in iParameters )
       
   124             {
       
   125                 yield return rp;
       
   126             }
       
   127         }
       
   128 
       
   129         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
       
   130         {
       
   131             foreach ( CIReportParameter rp in iParameters )
       
   132             {
       
   133                 yield return rp;
       
   134             }
       
   135         }
       
   136         #endregion
       
   137 
       
   138         #region Internal methods
       
   139         #endregion
       
   140 
       
   141         #region Data members
       
   142         private string iType = string.Empty;
       
   143         private string iName = string.Empty;
       
   144         private string iCategory = string.Empty;
       
   145         private string iComments = string.Empty;
       
   146         private uint iCountSuccess = 0;
       
   147         private uint iCountFail = 0;
       
   148         private List<CIReportParameter> iParameters = new List<CIReportParameter>();
       
   149         #endregion
       
   150     }
       
   151 }