1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
19 using System
.Collections
.Generic
;
21 public static class SilverlightExtensions
23 public static T
[] FindAll
<T
>(this T
[] array
, Predicate
<T
> match
)
27 throw new ArgumentNullException("array");
31 throw new ArgumentNullException("match");
33 List
<T
> list
= new List
<T
>();
34 for (int i
= 0; i
< array
.Length
; i
++)
41 return list
.ToArray();
46 namespace System
.Collections
.Specialized
50 public class NameValueCollection
: Dictionary
<string, string>
52 public NameValueCollection() : base(StringComparer
.InvariantCultureIgnoreCase
)
56 public new string this[string key
]
61 TryGetValue(key
, out result
);
72 namespace System
.Collections
76 public class CollectionBase
: List
<object>
78 protected CollectionBase InnerList
84 public class ReadOnlyCollectionBase
: List
<object>
86 protected ReadOnlyCollectionBase InnerList
93 namespace System
.Threading
95 public class ReaderWriterLock
97 private object _syncObject
= new object();
99 public ReaderWriterLock()
103 public void AcquireWriterLock(int timeout
)
105 Monitor
.Enter(_syncObject
);
108 public void AcquireReaderLock(int timeout
)
110 Monitor
.Enter(_syncObject
);
113 public void ReleaseWriterLock()
115 Monitor
.Exit(_syncObject
);
118 public void ReleaseLock()
120 Monitor
.Exit(_syncObject
);
125 namespace System
.Configuration
127 public class ConfigurationErrorsException
: Exception
129 public ConfigurationErrorsException(string message
) : base(message
)
133 public ConfigurationErrorsException(string message
, Exception inner
) : base(message
, inner
)
139 namespace System
.ComponentModel
141 public interface ISupportInitialize