Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ToDoType.cs « corcompare « tools « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9235ed5ab8a7b1543e822bfee092ca5e25d1e261 (plain)
1
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
178
179
180
181
182
183
184
185
186
187
188
189
// Mono.Util.CorCompare.ToDoType
//
// Author(s):
//   Nick Drochak (ndrochak@gol.com)
//
// (C) 2001-2002 Nick Drochak

using System;
using System.Reflection;
using System.Collections;

namespace Mono.Util.CorCompare {

	/// <summary>
	/// 	Represents a class that is marked with MonoTODO
	/// </summary>
	/// <remarks>
	/// 	created by - Nick
	/// 	created on - 2/20/2002 10:43:57 PM
	/// </remarks>
	class ToDoType : MissingType 
	{
		// e.g. <class name="System.Array" status="todo" missing="5" todo="6" complete="45">
		
		ArrayList missingMethodList = new ArrayList();
		public ArrayList MissingMethods {
			get {
				return missingMethodList;
			}
		}

		ArrayList todoMethodList = new ArrayList();
		public ArrayList ToDoMethods {
			get {
				return todoMethodList;
			}
		}

		ArrayList missingPropertyList = new ArrayList();
		public ArrayList MissingProperties {
			get {
				return missingPropertyList;
			}
		}

		ArrayList todoPropertyList = new ArrayList();
		public ArrayList ToDoProperties {
			get {
				return todoPropertyList;
			}
		}

		ArrayList missingEventList = new ArrayList();
		public ArrayList MissingEvents {
			get {
				return missingEventList;
			}
		}

		ArrayList todoEventList = new ArrayList();
		public ArrayList ToDoEvents {
			get {
				return todoEventList;
			}
		}

		ArrayList missingFieldList = new ArrayList();
		public ArrayList MissingFields {
			get {
				return missingFieldList;
			}
		}

		ArrayList todoFieldList = new ArrayList();
		public ArrayList ToDoFields {
			get {
				return todoFieldList;
			}
		}

		ArrayList missingConstructorList = new ArrayList();
		public ArrayList MissingConstructors {
			get {
				return missingConstructorList;
			}
		}

		ArrayList todoConstructorList = new ArrayList();
		public ArrayList ToDoConstructors {
			get {
				return todoConstructorList;
			}
		}

		ArrayList missingNestedTypeList = new ArrayList();
		public ArrayList MissingNestedTypes {
			get {
				return missingNestedTypeList;
			}
		}

		ArrayList todoNestedTypeList = new ArrayList();
		public ArrayList ToDoNestedTypes {
			get {
				return todoNestedTypeList;
			}
		}

		public ToDoType(Type t) : base(t) {
		}

		public int MissingCount {
			get {
				return missingMethodList.Count + missingPropertyList.Count;
			}
		}

		public int ToDoCount {
			get {
				return todoMethodList.Count + todoPropertyList.Count;
			}
		}
		
		public static int IndexOf(Type t, ArrayList todoTypes) {
			for(int index = 0; index < todoTypes.Count; index++) {
				if (((ToDoType)todoTypes[index]).Name == t.Name) {
					return index;
				}
			}
			return -1;
		}

		public override string Status {
			get {
				return "todo";
			}
		}

		public void AddToDoMember(Type t, MemberInfo info){
			switch (info.MemberType){
				case MemberTypes.Method:
					todoMethodList.Add(new ToDoMethod(info));
					break;
				case MemberTypes.Property:
					todoPropertyList.Add(new ToDoProperty(info));
					break;
				case MemberTypes.Event:
					todoEventList.Add(new ToDoEvent(info));
					break;
				case MemberTypes.Field:
					todoFieldList.Add(new ToDoField(info));
					break;
				case MemberTypes.Constructor:
					todoConstructorList.Add(new ToDoConstructor(info));
					break;
				case MemberTypes.NestedType:
					todoNestedTypeList.Add(new ToDoNestedType(info));
					break;
				default:
					throw new Exception("Didn't code todo member type: " + info.MemberType.ToString());
			}
		}

		public void AddMissingMember(MemberInfo info){
			switch (info.MemberType){
				case MemberTypes.Method:
					missingMethodList.Add(new MissingMethod(info));
					break;
				case MemberTypes.Property:
					missingPropertyList.Add(new MissingProperty(info));
					break;
				case MemberTypes.Event:
					missingEventList.Add(new MissingEvent(info));
					break;
				case MemberTypes.Field:
					missingFieldList.Add(new MissingField(info));
					break;
				case MemberTypes.Constructor:
					missingConstructorList.Add(new MissingConstructor(info));
					break;
				case MemberTypes.NestedType:
					missingNestedTypeList.Add(new MissingNestedType(info));
					break;
				default:
					throw new Exception("Didn't code missing member type: " + info.MemberType.ToString());
			}
		}
	}
}