Skip to content

Commit 65991df

Browse files
committed
Added MONO conditionals
1 parent e946ba7 commit 65991df

4 files changed

Lines changed: 27 additions & 11 deletions

File tree

CommonAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
// COM, set the ComVisible attribute to true on that type.
2020
[assembly: ComVisible(false)]
2121

22-
[assembly: AssemblyVersion("0.11.3.2")]
23-
[assembly: AssemblyFileVersion("0.11.3.2")]
22+
[assembly: AssemblyVersion("0.11.4.1")]
23+
[assembly: AssemblyFileVersion("0.11.4.1")]
2424

Simple.Data.SqlServer/DbTypeLookup.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ internal static class DbTypeLookup
1111
{"uniqueidentifier", SqlDbType.UniqueIdentifier},
1212
{"date", SqlDbType.Date},
1313
{"time", SqlDbType.Time},
14-
// {"datetime2", SqlDbType.DateTime2},
15-
// {
16-
// "datetimeoffset",
17-
// SqlDbType.DateTimeOffset
18-
// },
14+
#if(!MONO)
15+
{"datetime2", SqlDbType.DateTime2},
16+
{
17+
"datetimeoffset",
18+
SqlDbType.DateTimeOffset
19+
},
20+
#endif
1921
{"tinyint", SqlDbType.TinyInt},
2022
{"smallint", SqlDbType.SmallInt},
2123
{"int", SqlDbType.Int},

Simple.Data.SqlTest/DatabaseHelper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ namespace Simple.Data.SqlTest
1010
{
1111
internal static class DatabaseHelper
1212
{
13-
public static readonly string ConnectionString =
13+
public static readonly string ConnectionString =
14+
#if(MONO)
1415
"Data Source=10.37.129.4;Initial Catalog=SimpleTest;User ID=SimpleUser;Password=SimplePassword";
16+
#else
17+
Properties.Settings.Default.ConnectionString;
18+
#endif
1519

1620
public static dynamic Open()
1721
{

Simple.Data/MefHelper.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,25 @@ public static T GetAdjacentComponent<T>(Type knownSiblingType)
5353
}
5454
}
5555

56-
private static CompositionContainer CreateContainer()
56+
static string GetThisAssemblyPath()
5757
{
58-
var path = Assembly.GetExecutingAssembly().CodeBase.Replace("file:///", "").Replace("file://","//");
58+
var path = Assembly.GetExecutingAssembly().CodeBase.Replace("file:///", "").Replace("file://", "//");
5959
path = Path.GetDirectoryName(path);
6060
if (path == null) throw new ArgumentException("Unrecognised file.");
61+
if (!Path.IsPathRooted(path))
62+
{
63+
path = Path.DirectorySeparatorChar + path;
64+
}
65+
return path;
66+
}
67+
68+
private static CompositionContainer CreateContainer()
69+
{
70+
var path = GetThisAssemblyPath ();
6171

6272
var assemblyCatalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());
6373
var aggregateCatalog = new AggregateCatalog(assemblyCatalog);
64-
foreach (string file in System.IO.Directory.GetFiles("/" + path, "Simple.Data.*.dll"))
74+
foreach (string file in System.IO.Directory.GetFiles(path, "Simple.Data.*.dll"))
6575
{
6676
var catalog = new AssemblyCatalog(file);
6777
aggregateCatalog.Catalogs.Add(catalog);

0 commit comments

Comments
 (0)