-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- moved every type to its own file - added logical folders and grouped files into folders so they're easier to find - moved some internal types to other namespaces as they were in the wrong namespace - added some warnings on sqlclient using code in generic classes.
- Loading branch information
1 parent
e2901b9
commit c4985f6
Showing
67 changed files
with
6,613 additions
and
5,079 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Data.Linq.Mapping; | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace System.Data.Linq.BindingLists | ||
{ | ||
internal static class BindingList | ||
{ | ||
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] | ||
internal static IBindingList Create<T>(DataContext context, IEnumerable<T> sequence) | ||
{ | ||
List<T> list = sequence.ToList(); | ||
MetaTable metaTable = context.Services.Model.GetTable(typeof(T)); | ||
if(metaTable != null) | ||
{ | ||
ITable table = context.GetTable(metaTable.RowType.Type); | ||
Type bindingType = typeof(DataBindingList<>).MakeGenericType(metaTable.RowType.Type); | ||
return (IBindingList)Activator.CreateInstance(bindingType, | ||
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, | ||
new object[] { list, table }, null | ||
); | ||
} | ||
else | ||
{ | ||
return new SortableBindingList<T>(list); | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.