
















ok, this is the classes,
1
using System;
2
using System.Collections;
3
using System.Collections.Generic;
4
using System.Text;
5
6
namespace ABM.Lib.Common
7
{
8
public class AbmArrayList : ArrayList
9
{
10
public override bool Contains(object item)
11
{
12
return base.Contains(item);
13
}
14
public ArrayList GetKeys()
15
{
16
try
17
{
18
ArrayList list = new ArrayList();
19
foreach (AbmObject o in this)
20
{
21
if (!list.Contains(o.GetKey()))
22
{
23
list.Add(o.GetKey());
24
}
25
}
26
return list;
27
}
28
catch (Exception e)
29
{
30
return null;
31
}
32
}
33
public ArrayList GetValues()
34
{
35
try
36
{
37
ArrayList list = new ArrayList();
38
foreach (AbmObject o in this)
39
{
40
if (!list.Contains(o.GetValue()))
41
{
42
list.Add(o.GetValue());
43
}
44
}
45
return list;
46
}
47
catch (Exception e)
48
{
49
return null;
50
}
51
}
52
53
public ArrayList GetKeysIn(ArrayList keys)
54
{
55
try
56
{
57
ArrayList list = new ArrayList();
58
ArrayList allKeys = GetKeys();
59
foreach (object o in keys)
60
{
61
if (!allKeys.Contains(o))
62
{
63
list.Add(o);
64
}
65
}
66
return list;
67
}
68
catch (Exception e)
69
{
70
return null;
71
}
72
}
73
74
public ArrayList GetValuesIn(ArrayList values)
75
{
76
try
77
{
78
ArrayList list = new ArrayList();
79
ArrayList allValues = GetValues();
80
foreach (object o in allValues)
81
{
82
if (!allValues.Contains(o))
83
{
84
list.Add(o);
85
}
86
}
87
88
return list;
89
}
90
catch (Exception d)
91
{
92
return null;
93
}
94
}
95
96
public ArrayList GetItemsIn(ArrayList m_list)
97
{
98
try
99
{
100
ArrayList list = new ArrayList();
101
foreach (AbmObject o in m_list)
102
{
103
if (this.Contains(o))
104
{
105
list.Add(o);
106
}
107
}
108
return list;
109
}
110
catch (Exception e)
111
{
112
return null;
113
}
114
}
115
public ArrayList GetKeysByValue(object vl)
116
{
117
try
118
{
119
ArrayList list = new ArrayList();
120
foreach (AbmObject o in this)
121
{
122
if (o.GetValue().ToString().Equals(vl))
123
{
124
list.Add(o.GetKey());
125
}
126
}
127
return list;
128
}
129
catch (Exception e)
130
{
131
return null;
132
}
133
134
}
135
public ArrayList GetValuesByKey(object key)
136
{
137
try
138
{
139
ArrayList list = new ArrayList();
140
foreach (AbmObject o in this)
141
{
142
if (o.GetKey().Equals(key))
143
{
144
list.Add(o.GetValue());
145
}
146
}
147
return list;
148
}
149
catch (Exception e)
150
{
151
return null;
152
}
153
}
154
}
155
156
157
public class AbmObject
158
{
159
private object m_o1;
160
private object m_o2;
161
162
public object GetValue()
163
{
164
return m_o2;
165
}
166
public object GetKey()
167
{
168
return m_o1;
169
}
170
public AbmObject(object o1, object o2)
171
{
172
m_o1 = o1;
173
m_o2 = o2;
174
}
175
}
176
}
177

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

and the method has errors.