Skip to content

Commit 1a7dda3

Browse files
committed
Adding Msi and OleDb providers
1 parent 52892e1 commit 1a7dda3

File tree

75 files changed

+4823
-1970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4823
-1970
lines changed

DataCommander.Foundation/Collections/IndexableCollection/EnumerableIndex.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace DataCommander.Foundation.Collections.IndexableCollection
1+
namespace DataCommander.Foundation.Collections
22
{
33
using System;
44
using System.Collections;
@@ -57,12 +57,18 @@ void ICollection<T>.CopyTo(T[] array, int arrayIndex)
5757

5858
int ICollection<T>.Count
5959
{
60-
get { throw new NotImplementedException(); }
60+
get
61+
{
62+
throw new NotImplementedException();
63+
}
6164
}
6265

6366
bool ICollection<T>.IsReadOnly
6467
{
65-
get { throw new NotImplementedException(); }
68+
get
69+
{
70+
throw new NotImplementedException();
71+
}
6672
}
6773

6874
bool ICollection<T>.Remove(T item)
@@ -80,4 +86,4 @@ IEnumerator IEnumerable.GetEnumerator()
8086
throw new NotImplementedException();
8187
}
8288
}
83-
}
89+
}

DataCommander.Foundation/Collections/IndexableCollection/IndexableCollection-1.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace DataCommander.Foundation.Collections
22
{
3+
using System;
34
using System.Diagnostics.Contracts;
45

56
/// <summary>
@@ -48,13 +49,13 @@ public partial class IndexableCollection<T>
4849
///
4950
/// </summary>
5051
/// <param name="defaultIndex"></param>
51-
public IndexableCollection( ICollectionIndex<T> defaultIndex )
52+
public IndexableCollection(ICollectionIndex<T> defaultIndex)
5253
{
53-
Contract.Requires( defaultIndex != null );
54-
Contract.Ensures( this.indexes.Count == 1 );
54+
Contract.Requires<ArgumentNullException>(defaultIndex != null);
55+
Contract.Ensures(this.indexes.Count == 1);
5556

5657
this.defaultIndex = defaultIndex;
57-
this.indexes.Add( defaultIndex );
58+
this.indexes.Add(defaultIndex);
5859
}
5960

6061
/// <summary>
@@ -71,9 +72,9 @@ public IndexCollection<T> Indexes
7172
[ContractInvariantMethod]
7273
private void ContractInvariant()
7374
{
74-
Contract.Invariant( this.indexes != null );
75-
Contract.Invariant( this.defaultIndex != null );
76-
Contract.Invariant( this.indexes.Count > 0 );
75+
Contract.Invariant(this.indexes != null);
76+
Contract.Invariant(this.defaultIndex != null);
77+
Contract.Invariant(this.indexes.Count > 0);
7778
}
7879
}
7980
}

DataCommander.Foundation/Collections/IndexableCollection/ListIndex.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ IEnumerator IEnumerable.GetEnumerator()
205205

206206
private void Initialize(string name, IList<T> list)
207207
{
208-
Contract.Requires(name != null);
209-
Contract.Requires(list != null);
208+
Contract.Requires<ArgumentNullException>(name != null);
209+
Contract.Requires<ArgumentNullException>(list != null);
210210

211211
this.name = name;
212212
this.list = list;

DataCommander.Foundation/Collections/IndexableCollection/LookupIndex.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace DataCommander.Foundation.Collections.IndexableCollection
1+
namespace DataCommander.Foundation.Collections
22
{
33
using System;
44
using System.Collections;
@@ -104,4 +104,4 @@ IEnumerator IEnumerable.GetEnumerator()
104104
throw new NotImplementedException();
105105
}
106106
}
107-
}
107+
}

DataCommander.Foundation/Collections/IndexableCollection/NonUniqueIndex.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ private void Initialize(
289289
IDictionary<TKey, ICollection<T>> dictionary,
290290
Func<ICollection<T>> createCollection)
291291
{
292-
Contract.Requires(getKey != null);
293-
Contract.Requires(dictionary != null);
294-
Contract.Requires(createCollection != null);
292+
Contract.Requires<ArgumentNullException>(getKey != null);
293+
Contract.Requires<ArgumentNullException>(dictionary != null);
294+
Contract.Requires<ArgumentNullException>(createCollection != null);
295295

296296
this.name = name;
297297
this.getKey = getKey;

DataCommander.Foundation/Collections/IndexableCollection/SequenceIndex.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public SequenceIndex(
3030
Func<T, TKey> getKey,
3131
IDictionary<TKey, T> dictionary)
3232
{
33-
Contract.Requires(getNextKey != null);
34-
Contract.Requires(getKey != null);
35-
Contract.Requires(dictionary != null);
33+
Contract.Requires<ArgumentNullException>(getNextKey != null);
34+
Contract.Requires<ArgumentNullException>(getKey != null);
35+
Contract.Requires<ArgumentNullException>(dictionary != null);
3636

3737
this.name = name;
3838
this.getNextKey = getNextKey;

DataCommander.Foundation/Collections/IndexableCollection/UniqueIndex.cs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public class UniqueIndex<TKey, T> : ICollectionIndex<T>, IDictionary<TKey, T>
2525
public UniqueIndex(
2626
string name,
2727
Func<T, GetKeyResponse<TKey>> getKey,
28-
IDictionary<TKey, T> dictionary )
28+
IDictionary<TKey, T> dictionary)
2929
{
30-
this.Initialize( name, getKey, dictionary );
30+
this.Initialize(name, getKey, dictionary);
3131
}
3232

3333
/// <summary>
@@ -39,7 +39,7 @@ public UniqueIndex(
3939
public UniqueIndex(
4040
string name,
4141
Func<T, GetKeyResponse<TKey>> getKey,
42-
SortOrder sortOrder )
42+
SortOrder sortOrder)
4343
{
4444
IDictionary<TKey, T> dictionary;
4545
switch (sortOrder)
@@ -50,7 +50,7 @@ public UniqueIndex(
5050

5151
case SortOrder.Descending:
5252
var comparer = ReversedComparer<TKey>.Default;
53-
dictionary = new SortedDictionary<TKey, T>( comparer );
53+
dictionary = new SortedDictionary<TKey, T>(comparer);
5454
break;
5555

5656
case SortOrder.None:
@@ -61,7 +61,7 @@ public UniqueIndex(
6161
throw new ArgumentException();
6262
}
6363

64-
this.Initialize( name, getKey, dictionary );
64+
this.Initialize(name, getKey, dictionary);
6565
}
6666

6767
/// <summary>
@@ -80,11 +80,11 @@ public string Name
8080
/// </summary>
8181
/// <param name="key"></param>
8282
/// <returns></returns>
83-
public T this[ TKey key ]
83+
public T this[TKey key]
8484
{
8585
get
8686
{
87-
return this.dictionary[ key ];
87+
return this.dictionary[key];
8888
}
8989

9090
set
@@ -99,9 +99,9 @@ public T this[ TKey key ]
9999
/// <param name="key"></param>
100100
/// <returns></returns>
101101
[Pure]
102-
public bool ContainsKey( TKey key )
102+
public bool ContainsKey(TKey key)
103103
{
104-
return this.dictionary.ContainsKey( key );
104+
return this.dictionary.ContainsKey(key);
105105
}
106106

107107
#region ICollectionIndex<TKey,T> Members
@@ -133,9 +133,9 @@ public int Count
133133
/// </summary>
134134
/// <param name="array"></param>
135135
/// <param name="arrayIndex"></param>
136-
public void CopyTo( T[] array, int arrayIndex )
136+
public void CopyTo(T[] array, int arrayIndex)
137137
{
138-
this.dictionary.Values.CopyTo( array, arrayIndex );
138+
this.dictionary.Values.CopyTo(array, arrayIndex);
139139
}
140140

141141
/// <summary>
@@ -144,9 +144,9 @@ public void CopyTo( T[] array, int arrayIndex )
144144
/// <param name="key"></param>
145145
/// <param name="item"></param>
146146
/// <returns></returns>
147-
public bool TryGetValue( TKey key, out T item )
147+
public bool TryGetValue(TKey key, out T item)
148148
{
149-
return this.dictionary.TryGetValue( key, out item );
149+
return this.dictionary.TryGetValue(key, out item);
150150
}
151151

152152
/// <summary>
@@ -166,15 +166,15 @@ public IEnumerator<KeyValuePair<TKey, T>> GetEnumerator()
166166
///
167167
/// </summary>
168168
/// <param name="item"></param>
169-
void ICollection<T>.Add( T item )
169+
void ICollection<T>.Add(T item)
170170
{
171-
var response = this.getKey( item );
171+
var response = this.getKey(item);
172172

173173
if (response.HasKey)
174174
{
175175
var key = response.Key;
176-
Contract.Assert( !this.dictionary.ContainsKey( key ) );
177-
this.dictionary.Add( key, item );
176+
Contract.Assert(!this.dictionary.ContainsKey(key));
177+
this.dictionary.Add(key, item);
178178
}
179179
}
180180

@@ -191,16 +191,16 @@ void ICollection<T>.Clear()
191191
/// </summary>
192192
/// <param name="item"></param>
193193
/// <returns></returns>
194-
public bool Contains( T item )
194+
public bool Contains(T item)
195195
{
196-
Contract.Assert( item != null );
196+
Contract.Assert(item != null);
197197

198-
var response = this.getKey( item );
198+
var response = this.getKey(item);
199199
bool contains;
200200

201201
if (response.HasKey)
202202
{
203-
contains = this.dictionary.ContainsKey( response.Key );
203+
contains = this.dictionary.ContainsKey(response.Key);
204204
}
205205
else
206206
{
@@ -215,16 +215,16 @@ public bool Contains( T item )
215215
/// </summary>
216216
/// <param name="item"></param>
217217
/// <returns></returns>
218-
bool ICollection<T>.Remove( T item )
218+
bool ICollection<T>.Remove(T item)
219219
{
220-
Contract.Assert( item != null );
220+
Contract.Assert(item != null);
221221

222-
var response = this.getKey( item );
222+
var response = this.getKey(item);
223223
bool succeeded;
224224

225225
if (response.HasKey)
226226
{
227-
succeeded = this.dictionary.Remove( response.Key );
227+
succeeded = this.dictionary.Remove(response.Key);
228228
}
229229
else
230230
{
@@ -269,7 +269,7 @@ IEnumerator IEnumerable.GetEnumerator()
269269
/// </summary>
270270
/// <param name="key"></param>
271271
/// <param name="value"></param>
272-
void IDictionary<TKey, T>.Add( TKey key, T value )
272+
void IDictionary<TKey, T>.Add(TKey key, T value)
273273
{
274274
throw new NotSupportedException();
275275
}
@@ -290,7 +290,7 @@ public ICollection<TKey> Keys
290290
/// </summary>
291291
/// <param name="key"></param>
292292
/// <returns></returns>
293-
bool IDictionary<TKey, T>.Remove( TKey key )
293+
bool IDictionary<TKey, T>.Remove(TKey key)
294294
{
295295
throw new NotSupportedException();
296296
}
@@ -314,7 +314,7 @@ public ICollection<T> Values
314314
///
315315
/// </summary>
316316
/// <param name="item"></param>
317-
void ICollection<KeyValuePair<TKey, T>>.Add( KeyValuePair<TKey, T> item )
317+
void ICollection<KeyValuePair<TKey, T>>.Add(KeyValuePair<TKey, T> item)
318318
{
319319
throw new NotSupportedException();
320320
}
@@ -324,7 +324,7 @@ void ICollection<KeyValuePair<TKey, T>>.Add( KeyValuePair<TKey, T> item )
324324
/// </summary>
325325
/// <param name="item"></param>
326326
/// <returns></returns>
327-
bool ICollection<KeyValuePair<TKey, T>>.Contains( KeyValuePair<TKey, T> item )
327+
bool ICollection<KeyValuePair<TKey, T>>.Contains(KeyValuePair<TKey, T> item)
328328
{
329329
throw new NotSupportedException();
330330
}
@@ -339,7 +339,7 @@ void ICollection<KeyValuePair<TKey, T>>.Clear()
339339
/// </summary>
340340
/// <param name="array"></param>
341341
/// <param name="arrayIndex"></param>
342-
void ICollection<KeyValuePair<TKey, T>>.CopyTo( KeyValuePair<TKey, T>[] array, int arrayIndex )
342+
void ICollection<KeyValuePair<TKey, T>>.CopyTo(KeyValuePair<TKey, T>[] array, int arrayIndex)
343343
{
344344
throw new NotSupportedException();
345345
}
@@ -349,18 +349,18 @@ void ICollection<KeyValuePair<TKey, T>>.CopyTo( KeyValuePair<TKey, T>[] array, i
349349
/// </summary>
350350
/// <param name="item"></param>
351351
/// <returns></returns>
352-
public bool Remove( KeyValuePair<TKey, T> item )
352+
public bool Remove(KeyValuePair<TKey, T> item)
353353
{
354354
throw new NotSupportedException();
355355
}
356356

357357
#endregion
358358

359-
private void Initialize( string name, Func<T, GetKeyResponse<TKey>> getKey, IDictionary<TKey, T> dictionary )
359+
private void Initialize(string name, Func<T, GetKeyResponse<TKey>> getKey, IDictionary<TKey, T> dictionary)
360360
{
361-
Contract.Requires( name != null );
362-
Contract.Requires( getKey != null );
363-
Contract.Requires( dictionary != null );
361+
Contract.Requires<ArgumentNullException>(name != null);
362+
Contract.Requires<ArgumentNullException>(getKey != null);
363+
Contract.Requires<ArgumentNullException>(dictionary != null);
364364

365365
this.name = name;
366366
this.getKey = getKey;

DataCommander.Foundation/Collections/IndexableCollection/UniqueListIndex.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public UniqueListIndex(
2727
Func<T, TKey> keySelector,
2828
IList<T> list)
2929
{
30-
Contract.Requires(name != null);
31-
Contract.Requires(keySelector != null);
32-
Contract.Requires(list != null);
30+
Contract.Requires<ArgumentNullException>(name != null);
31+
Contract.Requires<ArgumentNullException>(keySelector != null);
32+
Contract.Requires<ArgumentNullException>(list != null);
3333

3434
this.name = name;
3535
this.keySelector = keySelector;

0 commit comments

Comments
 (0)