[RTL]
[reactos.git] / reactos / tools / sysgen / SysGen.BuildEngine / Collections / TaskBuilderCollection.cs
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4
5 namespace SysGen.BuildEngine
6 {
7 public class TaskBuilderCollection : List<TaskBuilder>
8 {
9 public bool Add(TaskBuilder builder)
10 {
11 // prevent adding duplicate builders with the same task name
12 if (FindBuilderForTask(builder.TaskName) == null)
13 {
14 base.Add(builder);
15 return true;
16 }
17
18 return false;
19 }
20
21 public TaskBuilder FindBuilderForTask(string taskName)
22 {
23 foreach (TaskBuilder builder in this)
24 {
25 if (builder.TaskName == taskName)
26 {
27 return builder;
28 }
29 }
30 return null;
31 }
32 }
33 }