|
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.IO; |
|
20 using System.Collections.Generic; |
|
21 using CrashItemLib.Crash.Messages; |
|
22 using CrashItemLib.Crash.Container; |
|
23 |
|
24 namespace CrashAnalyserServerExe.Engine |
|
25 { |
|
26 internal class CACmdLineMessage |
|
27 { |
|
28 #region Enumerations |
|
29 public enum TType |
|
30 { |
|
31 ETypeMessage = 0, |
|
32 ETypeWarning, |
|
33 ETypeError, |
|
34 ETypeDiagnostic |
|
35 } |
|
36 #endregion |
|
37 |
|
38 #region Constructors |
|
39 public CACmdLineMessage( TType aType, string aTitle, string aDescription ) |
|
40 { |
|
41 iType = aType; |
|
42 iTitle = aTitle; |
|
43 iDescription = aDescription; |
|
44 } |
|
45 #endregion |
|
46 |
|
47 #region API |
|
48 public void CopyToContainer( CIContainer aContainer ) |
|
49 { |
|
50 // Diagnostics never appear in the crash item itself. |
|
51 if ( Type != TType.ETypeDiagnostic ) |
|
52 { |
|
53 CIMessage msg = null; |
|
54 // |
|
55 if ( Type == TType.ETypeMessage ) |
|
56 { |
|
57 msg = CIMessage.NewMessage( aContainer ); |
|
58 } |
|
59 else if ( Type == TType.ETypeWarning ) |
|
60 { |
|
61 msg = new CIMessageWarning( aContainer ); |
|
62 } |
|
63 else if ( Type == TType.ETypeError ) |
|
64 { |
|
65 msg = new CIMessageError( aContainer ); |
|
66 } |
|
67 |
|
68 // Build details & add to container |
|
69 msg.Title = this.Title; |
|
70 msg.Description = this.Description; |
|
71 aContainer.Messages.Add( msg ); |
|
72 } |
|
73 } |
|
74 #endregion |
|
75 |
|
76 #region Properties |
|
77 public TType Type |
|
78 { |
|
79 get { return iType; } |
|
80 } |
|
81 |
|
82 public string Title |
|
83 { |
|
84 get { return iTitle; } |
|
85 } |
|
86 |
|
87 public string Description |
|
88 { |
|
89 get { return iDescription; } |
|
90 } |
|
91 #endregion |
|
92 |
|
93 #region Data members |
|
94 private readonly TType iType; |
|
95 private readonly string iTitle; |
|
96 private readonly string iDescription; |
|
97 #endregion |
|
98 } |
|
99 } |