|
1 /* |
|
2 * Copyright (c) 2010 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 * The class ErrorLibraryError holds information of the one error in error library. |
|
16 * |
|
17 */ |
|
18 using System; |
|
19 using System.Collections.Generic; |
|
20 using System.Text; |
|
21 |
|
22 namespace ErrorLibrary |
|
23 { |
|
24 class ErrorLibraryError |
|
25 { |
|
26 /** |
|
27 * Constructor |
|
28 * @param name error name |
|
29 * @param description error description |
|
30 */ |
|
31 public ErrorLibraryError(string key, string name, string description) |
|
32 { |
|
33 searchKey = key; |
|
34 errorName = name; |
|
35 errorDescription = description; |
|
36 } |
|
37 |
|
38 /** |
|
39 * Constructor |
|
40 */ |
|
41 public ErrorLibraryError() |
|
42 { |
|
43 // for empty ErrorLibraryError creation |
|
44 } |
|
45 |
|
46 /** |
|
47 * Set name for an error |
|
48 * @param name error name |
|
49 */ |
|
50 public void SetName(string name) |
|
51 { |
|
52 errorName = name; |
|
53 } |
|
54 |
|
55 /** |
|
56 * Set description for an error. |
|
57 * @param description error description |
|
58 */ |
|
59 public void SetDescription(string description) |
|
60 { |
|
61 errorDescription = description; |
|
62 } |
|
63 |
|
64 /** |
|
65 * Adds information to an error description |
|
66 * @param description error description |
|
67 */ |
|
68 public void AddToDescription(string description) |
|
69 { |
|
70 errorDescription += description; |
|
71 } |
|
72 |
|
73 /** |
|
74 * Overrides ToString. Returns the name of the error. |
|
75 * @return Error name |
|
76 */ |
|
77 public override string ToString() |
|
78 { |
|
79 return errorName; |
|
80 } |
|
81 |
|
82 /** |
|
83 * Returns the description of the error. |
|
84 * @return Error description |
|
85 */ |
|
86 public string GetDescription() |
|
87 { |
|
88 return errorDescription; |
|
89 } |
|
90 |
|
91 /** |
|
92 * Sets key which is used in searching. |
|
93 */ |
|
94 public void SetSearchKey(string key) |
|
95 { |
|
96 searchKey = key; |
|
97 } |
|
98 |
|
99 /** |
|
100 * Gets key which is used in searching. |
|
101 */ |
|
102 public string GetSearchKey() |
|
103 { |
|
104 return searchKey; |
|
105 } |
|
106 |
|
107 private string searchKey = string.Empty; |
|
108 private string errorName = string.Empty; |
|
109 private string errorDescription = string.Empty; |
|
110 |
|
111 } |
|
112 } |