From: cskim Date: Thu, 23 Mar 2017 09:06:54 +0000 (+0900) Subject: Remove DBPort, Align nuget packages X-Git-Tag: submit/tizen/20170808.015446~169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a43e2fd34ab15303ab8a82d7545dce4b532ed458;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Remove DBPort, Align nuget packages Change-Id: I7134b46941a0f3ab0302c9612a9b1653d323dbc2 --- diff --git a/LibTVRefCommonPortable/LibTVRefCommonPortable.csproj b/LibTVRefCommonPortable/LibTVRefCommonPortable.csproj index 3aa2f42..e686bda 100644 --- a/LibTVRefCommonPortable/LibTVRefCommonPortable.csproj +++ b/LibTVRefCommonPortable/LibTVRefCommonPortable.csproj @@ -70,7 +70,6 @@ - diff --git a/LibTVRefCommonPortable/Utils/IDBAPIs.cs b/LibTVRefCommonPortable/Utils/IDBAPIs.cs deleted file mode 100644 index 2026e3a..0000000 --- a/LibTVRefCommonPortable/Utils/IDBAPIs.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System.Collections.Generic; -using LibTVRefCommonPortable.DataModels; - -namespace LibTVRefCommonPortable.Utils -{ - public interface IDBAPIs - { - bool ExecSQL(string dbName, string sql); - - bool ExecSQL(string dbName, string sql, out IEnumerable items); - } -} diff --git a/LibTVRefCommonTizen/LibTVRefCommonTizen.csproj b/LibTVRefCommonTizen/LibTVRefCommonTizen.csproj index c102a36..83e49b3 100644 --- a/LibTVRefCommonTizen/LibTVRefCommonTizen.csproj +++ b/LibTVRefCommonTizen/LibTVRefCommonTizen.csproj @@ -48,7 +48,6 @@ - diff --git a/LibTVRefCommonTizen/LibTVRefCommonTizen.project.json b/LibTVRefCommonTizen/LibTVRefCommonTizen.project.json index 497ae2f..0d6d066 100644 --- a/LibTVRefCommonTizen/LibTVRefCommonTizen.project.json +++ b/LibTVRefCommonTizen/LibTVRefCommonTizen.project.json @@ -4,7 +4,7 @@ "Microsoft.NETCore.App": "1.1.0", "Tizen.Library": "1.0.0-pre2", "Xamarin.Forms": "2.3.3.193", - "Xamarin.Forms.Platform.Tizen": "2.3.4-r192-001" + "Xamarin.Forms.Platform.Tizen": "2.3.4-r192-004" }, "frameworks": { "netcoreapp1.0": { diff --git a/LibTVRefCommonTizen/Ports/DBPort.cs b/LibTVRefCommonTizen/Ports/DBPort.cs deleted file mode 100644 index 5900617..0000000 --- a/LibTVRefCommonTizen/Ports/DBPort.cs +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -using Tizen; - -using LibTVRefCommonPortable.DataModels; -using LibTVRefCommonPortable.Utils; - -namespace LibTVRefCommonTizen.Ports -{ - public class DBPort : IDBAPIs - { - internal class SQLite - { - private const string Library = "libsqlite3.so.0"; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate int ExecCallback(IntPtr notUsed, int numberOfColumn, IntPtr value, IntPtr column); - - [DllImport(Library, EntryPoint = "sqlite3_open", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Open(string fileName, out IntPtr handle); - - [DllImport(Library, EntryPoint = "sqlite3_close", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Close(IntPtr handle); - - [DllImport(Library, EntryPoint = "sqlite3_exec", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Exec(IntPtr handle, string sql, ExecCallback callback, IntPtr notUsed, IntPtr errorMessage); - } - - private const int SQLITE_OK = 0; - private const int SQLITE_ROW = 100; - - private const int FIRST_COLUMN = 0; - - private int ptrSize = Marshal.SizeOf(); - - public int PtrSize - { - get - { - return ptrSize; - } - } - - public String AppDataPath - { - get; - private set; - } - - public DBPort(String appDataPath) - { - this.AppDataPath = appDataPath; - - // TODO : make a unit test for this!!! - DebuggingPort.D("DBPort-------------------------------------"); - DebuggingPort.D("version " + ExecSQL("csk", "SELECT SQLITE_VERSION()")); - DebuggingPort.D("create " + ExecSQL("csk", "CREATE TABLE friends(Id INTEGER PRIMARY KEY, Name TEXT);")); - - DebuggingPort.D("insert 1 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Tom');")); - DebuggingPort.D("insert 2 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Rebecca');")); - DebuggingPort.D("insert 3 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Jim');")); - DebuggingPort.D("insert 4 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Roger');")); - DebuggingPort.D("insert 5 " + ExecSQL("csk", "INSERT INTO friends(Name) VALUES ('Robert');")); - - IEnumerable dbItems = new List(); - DebuggingPort.D("select " + ExecSQL("csk", "SELECT * FROM friends;", out dbItems)); - foreach (var item in dbItems) - { - foreach (var value in item.ItemProperties) - { - DebuggingPort.D("column[" + value.Key + "] = " + value.Value); - } - } - - DebuggingPort.D("insert 5 " + ExecSQL("csk", "DROP TABLE friends;")); - } - - private static bool CheckResult(int res, string desc) - { - if (res != SQLITE_OK) - { - DebuggingPort.D(String.Format("DB Error [{0}], {1}", desc, res)); - return false; - } - - return true; - } - - private static bool Open(string appDataPath, string dbName, out IntPtr handle) - { - DebuggingPort.D("[DB Open]"); - if (dbName == null) - { - DebuggingPort.E("DB Name is NULL!!!"); - handle = IntPtr.Zero; - return false; - } - - string dbPath = appDataPath + dbName; - Log.Debug("csk", dbPath); - return CheckResult(SQLite.Open(appDataPath + dbName + ".db", out handle), "open"); - - } - - private static void Close(IntPtr handle) - { - DebuggingPort.D("[DB Close]"); - if (handle == null) - { - return; - } - - SQLite.Close(handle); - } - - internal sealed class DBHandleRAII// : IDisposable - { - internal IntPtr handle; - internal DBHandleRAII(String appDataPath, string fileName) - { - Open(appDataPath, fileName, out handle); - } - - ~DBHandleRAII() - { - Close(handle); - } - // TODO : Change to use IDisposable!!! - // Dispose is not calling!!! - /* - public void Dispose() - { - Close(handle); - } - */ - } - - public bool ExecSQL(string dbName, string sql) - { - if (dbName == null || sql == null) - { - DebuggingPort.E("Invalid argument!!!"); - return false; - } - - DBHandleRAII db = new DBHandleRAII(AppDataPath, dbName); - if (db.handle == IntPtr.Zero) - { - DebuggingPort.E("DB open failed!!!"); - return false; - } - - return CheckResult(SQLite.Exec(db.handle, sql, null, IntPtr.Zero, IntPtr.Zero), "exec "); - } - - // TODO : Make this thread safe!!! - List givenItems = new List(); - - private int ExecCallback(IntPtr notUsed, int numberOfColumn, IntPtr value, IntPtr column) - { - DebuggingPort.D("ExecCallback"); - for (int i = 1; i < numberOfColumn; i++) - { - string _value = Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(value, i * PtrSize)); - DebuggingPort.E("" + i + " - " + _value + " / "); - DBItem item = new DBItem(); - item.Add(i, _value); - givenItems.Add(item); - } - - return 0; - } - - public bool ExecSQL(string dbName, string sql, out IEnumerable items) - { - givenItems.Clear(); - items = givenItems; - - DebuggingPort.D("ExecSQL"); - if (dbName == null || sql == null) - { - DebuggingPort.E("Invalid argument!!!"); - return false; - } - - DBHandleRAII db = new DBHandleRAII(AppDataPath, dbName); - if (db.handle == IntPtr.Zero) - { - DebuggingPort.E("DB open failed!!!"); - return false; - } - - if (CheckResult(SQLite.Exec(db.handle, sql, ExecCallback, IntPtr.Zero, IntPtr.Zero), "exec") == false) - { - return false; - } - - return true; - } - - } - -} diff --git a/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs b/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs index 5e60de0..ee4622e 100644 --- a/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs +++ b/TVApps/TVApps.TizenTV/TVApps.TizenTV.cs @@ -107,7 +107,6 @@ namespace TVApps.TizenTV instance = new Program(); Xamarin.Forms.DependencyService.Register(); - Xamarin.Forms.DependencyService.Register(); Xamarin.Forms.DependencyService.Register(); Xamarin.Forms.DependencyService.Register(); Xamarin.Forms.DependencyService.Register(); diff --git a/TVApps/TVApps.TizenTV/TVApps.TizenTV.project.json b/TVApps/TVApps.TizenTV/TVApps.TizenTV.project.json index af921db..e89e8e5 100644 --- a/TVApps/TVApps.TizenTV/TVApps.TizenTV.project.json +++ b/TVApps/TVApps.TizenTV/TVApps.TizenTV.project.json @@ -6,11 +6,11 @@ "preserveCompilationContext": true }, "dependencies": { - "ElmSharp": "1.1.0-beta-014", + "ElmSharp": "1.1.0-beta-015", "Microsoft.NETCore.App": "1.1.0", "Tizen.Library": "1.0.0-pre2", "Xamarin.Forms": "2.3.3.193", - "Xamarin.Forms.Platform.Tizen": "2.3.4-r192-001" + "Xamarin.Forms.Platform.Tizen": "2.3.4-r192-004" }, "runtimes": { "win": {}, diff --git a/TVApps/TVApps/Views/MainPage.xaml.cs b/TVApps/TVApps/Views/MainPage.xaml.cs index 83b8883..de43579 100644 --- a/TVApps/TVApps/Views/MainPage.xaml.cs +++ b/TVApps/TVApps/Views/MainPage.xaml.cs @@ -37,16 +37,18 @@ namespace TVApps.Views get { return (AppsStatus)GetValue(CurrentStatusProperty); } set { SetValue(CurrentStatusProperty, value); } } - + /* private async void PlayHideAnimation() { // TODO : Apps Out Animation. } - + */ private async void PlayShowAnimation() { await AppList.TranslateTo(0, 12, 0); +#pragma warning disable CS4014 AppList.TranslateTo(0, 0, 667); +#pragma warning restore CS4014 await PageDimBox.FadeTo(0.0, 667); PageDimBox.IsVisible = false; await Task.Delay(1); diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.project.json b/TVHome/TVHome.TizenTV/TVHome.TizenTV.project.json index 507598a..e89e8e5 100644 --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.project.json +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.project.json @@ -10,7 +10,7 @@ "Microsoft.NETCore.App": "1.1.0", "Tizen.Library": "1.0.0-pre2", "Xamarin.Forms": "2.3.3.193", - "Xamarin.Forms.Platform.Tizen": "2.3.4-r192-001" + "Xamarin.Forms.Platform.Tizen": "2.3.4-r192-004" }, "runtimes": { "win": {}, diff --git a/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk b/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk index 859143d..2f8b0f4 100644 Binary files a/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk and b/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk differ