Remove DBPort, Align nuget packages
authorcskim <charles0.kim@samsung.com>
Thu, 23 Mar 2017 09:06:54 +0000 (18:06 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:49 +0000 (18:34 +0900)
Change-Id: I7134b46941a0f3ab0302c9612a9b1653d323dbc2

LibTVRefCommonPortable/LibTVRefCommonPortable.csproj
LibTVRefCommonPortable/Utils/IDBAPIs.cs [deleted file]
LibTVRefCommonTizen/LibTVRefCommonTizen.csproj
LibTVRefCommonTizen/LibTVRefCommonTizen.project.json
LibTVRefCommonTizen/Ports/DBPort.cs [deleted file]
TVApps/TVApps.TizenTV/TVApps.TizenTV.cs
TVApps/TVApps.TizenTV/TVApps.TizenTV.project.json
TVApps/TVApps/Views/MainPage.xaml.cs
TVHome/TVHome.TizenTV/TVHome.TizenTV.project.json
TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk

index 3aa2f42..e686bda 100644 (file)
@@ -70,7 +70,6 @@
     <Compile Include="Utils\IAppLifeControl.cs" />
     <Compile Include="Utils\IPlatformNotification.cs" />
     <Compile Include="Utils\IBTAPIs.cs" />
-    <Compile Include="Utils\IDBAPIs.cs" />
     <Compile Include="Utils\IDebuggingAPIs.cs" />
     <Compile Include="Utils\IFileSystemAPIs.cs" />
     <Compile Include="Utils\IFileSystemWatcherAPIs.cs" />
diff --git a/LibTVRefCommonPortable/Utils/IDBAPIs.cs b/LibTVRefCommonPortable/Utils/IDBAPIs.cs
deleted file mode 100644 (file)
index 2026e3a..0000000
+++ /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<DBItem> items);
-    }
-}
index c102a36..83e49b3 100644 (file)
@@ -48,7 +48,6 @@
     <Compile Include="Ports\AppControlPort.cs" />
     <Compile Include="Ports\ApplicationManagerPort.cs" />
     <Compile Include="Ports\BTModulePort.cs" />
-    <Compile Include="Ports\DBPort.cs" />
     <Compile Include="Ports\DebuggingPort.cs" />
     <Compile Include="Ports\ElmPort.cs" />
     <Compile Include="Ports\FileSystemPort.cs" />
index 497ae2f..0d6d066 100644 (file)
@@ -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 (file)
index 5900617..0000000
+++ /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<IntPtr>();
-
-        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<DBItem> dbItems = new List<DBItem>();
-            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<DBItem> givenItems = new List<DBItem>();
-
-        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<DBItem> 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;
-        }
-
-    }
-
-}
index 5e60de0..ee4622e 100644 (file)
@@ -107,7 +107,6 @@ namespace TVApps.TizenTV
             instance = new Program();
 
             Xamarin.Forms.DependencyService.Register<DebuggingPort>();
-            Xamarin.Forms.DependencyService.Register<DBPort>();
             Xamarin.Forms.DependencyService.Register<Program>();
             Xamarin.Forms.DependencyService.Register<AppControlPort>();
             Xamarin.Forms.DependencyService.Register<PackageManagerPort>();
index af921db..e89e8e5 100644 (file)
@@ -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": {},
index 83b8883..de43579 100644 (file)
@@ -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);
index 507598a..e89e8e5 100644 (file)
@@ -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": {},
index 859143d..2f8b0f4 100644 (file)
Binary files a/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk and b/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk differ