(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / nunit20 / util / AssemblyList.cs
blob1c5bb930591dce79c0d32f3ef10ad1e92c683ef6
1 #region Copyright (c) 2002-2003, James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole, Philip A. Craig
2 /************************************************************************************
4 ' Copyright 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole
5 ' Copyright 2000-2002 Philip A. Craig
7 ' This software is provided 'as-is', without any express or implied warranty. In no
8 ' event will the authors be held liable for any damages arising from the use of this
9 ' software.
11 ' Permission is granted to anyone to use this software for any purpose, including
12 ' commercial applications, and to alter it and redistribute it freely, subject to the
13 ' following restrictions:
15 ' 1. The origin of this software must not be misrepresented; you must not claim that
16 ' you wrote the original software. If you use this software in a product, an
17 ' acknowledgment (see the following) in the product documentation is required.
19 ' Portions Copyright 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole
20 ' or Copyright 2000-2002 Philip A. Craig
22 ' 2. Altered source versions must be plainly marked as such, and must not be
23 ' misrepresented as being the original software.
25 ' 3. This notice may not be removed or altered from any source distribution.
27 '***********************************************************************************/
28 #endregion
30 using System;
31 using System.IO;
32 using System.Collections;
34 namespace NUnit.Util
36 /// <summary>
37 /// Represents a list of assemblies. It stores paths
38 /// that are added and marks it's ProjectContainer
39 /// as dirty whenever it changes. All paths must
40 /// be added as absolute paths.
41 /// </summary>
42 public class AssemblyList : CollectionBase
44 private ProjectConfig config;
46 public AssemblyList( ProjectConfig config )
48 this.config = config;
51 #region Properties
53 public ProjectConfig Config
55 get { return config; }
58 /// <summary>
59 /// Our indexer
60 /// </summary>
61 public AssemblyListItem this[int index]
63 get { return (AssemblyListItem)List[index]; }
64 // set { List[index] = value; }
67 #endregion
69 #region Methods
71 public void Add( string assemblyPath, bool hasTests )
73 List.Add( new AssemblyListItem( this.config, assemblyPath, hasTests ) );
76 public void Add( string assemblyPath )
78 Add( assemblyPath, true );
81 public void Remove( string assemblyPath )
83 for( int index = 0; index < this.Count; index++ )
85 if ( this[index].FullPath == assemblyPath )
86 RemoveAt( index );
90 protected override void OnRemoveComplete(int index, object value)
92 config.IsDirty = true;
95 protected override void OnInsertComplete(int index, object value)
97 config.IsDirty = true;
100 protected override void OnSetComplete(int index, object oldValue, object newValue )
102 config.IsDirty = true;
105 #endregion