public static void Startup() { #if __MOBILE__ SQLite.Net.SQLiteConnection connection = null; SQLite.Net.Interop.ISQLitePlatform platform = null; string dbLocation = "videoDB.db3"; #endif #if XAMARIN_ANDROID var library = Environment.GetFolderPath(Environment.SpecialFolder.Personal); dbLocation = Path.Combine(library, dbLocation); platform = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(); #elif XAMARIN_IOS var docsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); var library = Path.Combine(docsPath, "../Library/"); dbLocation = Path.Combine(library, dbLocation); platform = new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS(); #elif WINDOWS_PHONE platform = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); #elif NETFX_CORE platform = new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(); #endif ServiceContainer.Register<IMovieService>(() => new MovieService()); #if __MOBILE__ connection = new SQLite.Net.SQLiteConnection(platform, dbLocation); ServiceContainer.Register<IStorageService>(() => new StorageService(connection)); ServiceContainer.Register<IMessageDialog>(() => new Video.PlatformSpecific.MessageDialog()); #endif ServiceContainer.Register<MoviesViewModel>(); ServiceContainer.Register<MovieViewModel>(); }
public SQLiteConnection GetSqlConnection(string fileName) { var path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); var plat=new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var conn=new SQLiteConnection(plat, path); return conn; }
public SQLite.Net.SQLiteConnection GetConnection(string filename) { string path = Path.Combine(ApplicationData.Current.LocalFolder.Path, filename); var plat = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var conn = new SQLite.Net.SQLiteConnection(plat, path); return(conn); }
public SQLite.Net.SQLiteConnection GetConnection() { var filename = "Notes.db"; var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, filename); var platfrom = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var connection = new SQLite.Net.SQLiteConnection(platfrom, path); return connection; }
public SQLiteConnection GetConnection() { var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, Constants.DatabaseFileName); var plat = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var conn = new SQLiteConnection(plat, path); // Return the database connection return(conn); }
public SQLite.Net.SQLiteConnection GetConnection() { var filename = "Student.db3"; var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, filename); var platfrom = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var connection = new SQLite.Net.SQLiteConnection(platfrom, path); return(connection); }
public SQLite.Net.SQLiteConnection GetConnection() { var sqliteFilename = "TodoSQLite.db3"; string path = Path.Combine(ApplicationData.Current.LocalFolder.Path, sqliteFilename); var plat = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var conn = new SQLite.Net.SQLiteConnection(plat, path); // Return the database connection return conn; }
public SQLite.Net.SQLiteConnection GetConnection() { var sqliteFilename = "TodoSQLite.db3"; string path = Path.Combine(ApplicationData.Current.LocalFolder.Path, sqliteFilename); var plat = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var conn = new SQLite.Net.SQLiteConnection(plat, path); // Return the database connection return(conn); }
public MainPage() { InitializeComponent(); Forms.Init(); var sqliteFilename = "TodoSQLite.db3"; string path = Path.Combine(ApplicationData.Current.LocalFolder.Path, sqliteFilename); var plat = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var conn = new SQLite.Net.SQLiteConnection(plat, path); // Set the database connection string Todo.App.SetDatabaseConnection(conn); Content = Todo.App.GetMainPage().ConvertPageToUIElement(this); }
public SQLite.Net.SQLiteConnection GetConnection() { try { var fileName = "PurposeColorDB.db3"; var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, fileName); var platform = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); //wp 8.0 var connection = new SQLite.Net.SQLiteConnection(platform, path); return connection; } catch (System.Exception ex) { var test = ex.Message; return null; } }
public MainPage() { InitializeComponent(); Forms.Init(); try { var sqliteFilename = "TodoSQLite.db3"; var path = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, sqliteFilename); ; var plat = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var conn = new SQLite.Net.SQLiteConnection(plat, path); // Set the database connection string Todo.App.SetDatabaseConnection(conn); Todo.App.SetTextToSpeech(new TextToSpeech_WinPhone()); Content = Todo.App.GetMainPage().ConvertPageToUIElement(this); } catch (Exception e) { Debug.WriteLine(e); } }
public MainPage() { InitializeComponent(); Forms.Init(); try { var sqliteFilename = "TodoSQLite.db3"; var path = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, sqliteFilename);; var plat = new SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8(); var conn = new SQLite.Net.SQLiteConnection(plat, path); // Set the database connection string Todo.App.SetDatabaseConnection(conn); Todo.App.SetTextToSpeech(new TextToSpeech_WinPhone()); Content = Todo.App.GetMainPage().ConvertPageToUIElement(this); } catch (Exception e) { Debug.WriteLine(e); } }