Datei: Provider/SqlCEProvider/SqlCeUISupport/SqlCeUIProvider.cs
Last Commit (f4949d4)
1 | using System; |
2 | using System.Collections.Generic; |
3 | using System.Linq; |
4 | using System.Text; |
5 | using System.Threading.Tasks; |
6 | using NDO.UISupport; |
7 | |
8 | namespace NDO.SqlCeUISupport |
9 | { |
10 | ····public class SqlCeUIProvider : DbUISupportBase |
11 | ····{ |
12 | ········public override string Name => "SqlCe"; |
13 | |
14 | ········public override NdoDialogResult ShowConnectionDialog( ref string connectionString ) |
15 | ········{ |
16 | ············ConnectionDialog cd = new ConnectionDialog(); |
17 | ············var result = (NdoDialogResult)cd.ShowDialog(); |
18 | ············if (result == NdoDialogResult.Cancel) |
19 | ················return result; |
20 | |
21 | ············connectionString = cd.Connection; |
22 | ············return NdoDialogResult.OK; |
23 | ········} |
24 | |
25 | ········public override NdoDialogResult ShowCreateDbDialog( ref object necessaryData ) |
26 | ········{ |
27 | ············string connectionString = string.Empty; |
28 | ············var result = ShowConnectionDialog( ref connectionString ); |
29 | ············if (result == NdoDialogResult.OK) |
30 | ············{ |
31 | ················necessaryData = connectionString; |
32 | ············} |
33 | |
34 | ············return result; |
35 | ········} |
36 | |
37 | ········public override string CreateDatabase( object necessaryData ) |
38 | ········{ |
39 | ············// DataSource="c:\Sqltest\hallo.sdf"; Password='lucky' |
40 | return Provider. CreateDatabase( ( string) necessaryData, ( string) necessaryData ) ; |
41 | ········} |
42 | ····} |
43 | } |
44 |
New Commit (947ce88)
1 | using System; |
2 | using System.Collections.Generic; |
3 | using System.Linq; |
4 | using System.Text; |
5 | using System.Threading.Tasks; |
6 | using NDO.UISupport; |
7 | |
8 | namespace NDO.SqlCeUISupport |
9 | { |
10 | ····public class SqlCeUIProvider : DbUISupportBase |
11 | ····{ |
12 | ········public override string Name => "SqlCe"; |
13 | |
14 | ········public override NdoDialogResult ShowConnectionDialog( ref string connectionString ) |
15 | ········{ |
16 | ············ConnectionDialog cd = new ConnectionDialog(); |
17 | ············var result = (NdoDialogResult)cd.ShowDialog(); |
18 | ············if (result == NdoDialogResult.Cancel) |
19 | ················return result; |
20 | |
21 | ············connectionString = cd.Connection; |
22 | ············return NdoDialogResult.OK; |
23 | ········} |
24 | |
25 | ········public override NdoDialogResult ShowCreateDbDialog( ref object necessaryData ) |
26 | ········{ |
27 | ············string connectionString = string.Empty; |
28 | ············var result = ShowConnectionDialog( ref connectionString ); |
29 | ············if (result == NdoDialogResult.OK) |
30 | ············{ |
31 | ················necessaryData = connectionString; |
32 | ············} |
33 | |
34 | ············return result; |
35 | ········} |
36 | |
37 | ········public override string CreateDatabase( object necessaryData ) |
38 | ········{ |
39 | ············// DataSource="c:\Sqltest\hallo.sdf"; Password='lucky' |
40 | return EnsureProvider( ) . CreateDatabase( ( string) necessaryData, ( string) necessaryData ) ; |
41 | ········} |
42 | ····} |
43 | } |
44 |