draft of Xamarin implementation 11/128611/1
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 10 May 2017 13:00:32 +0000 (15:00 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 10 May 2017 13:01:21 +0000 (15:01 +0200)
Change-Id: Ie242b52363a191ab3717b168b44816d7da4b3e77

13 files changed:
.gitignore [new file with mode: 0644]
TaskManager.sln [new file with mode: 0644]
TaskManager/TaskManager.Tizen/Model/ApplicationInfo.cs [new file with mode: 0644]
TaskManager/TaskManager.Tizen/Properties/AssemblyInfo.cs [new file with mode: 0644]
TaskManager/TaskManager.Tizen/Services/ApplicationService.cs [new file with mode: 0644]
TaskManager/TaskManager.Tizen/TaskManager.Tizen.cs [new file with mode: 0644]
TaskManager/TaskManager.Tizen/TaskManager.Tizen.csproj [new file with mode: 0644]
TaskManager/TaskManager.Tizen/TaskManager.Tizen.nuget.targets [new file with mode: 0644]
TaskManager/TaskManager.Tizen/TaskManager.Tizen.project.json [new file with mode: 0644]
TaskManager/TaskManager.Tizen/TaskManager.cs [new file with mode: 0644]
TaskManager/TaskManager.Tizen/ViewModels/MainViewModel.cs [new file with mode: 0644]
TaskManager/TaskManager.Tizen/shared/res/TaskManager.Tizen.png [new file with mode: 0644]
TaskManager/TaskManager.Tizen/tizen-manifest.xml [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..ce92896
--- /dev/null
@@ -0,0 +1,7 @@
+[Bb]in/
+[Oo]bj/
+/packages/
+.vs/
+*project.lock.json
+*project.fragment.lock.json
+*csproj.user
\ No newline at end of file
diff --git a/TaskManager.sln b/TaskManager.sln
new file mode 100644 (file)
index 0000000..9e428ef
--- /dev/null
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaskManager.Tizen", "TaskManager\TaskManager.Tizen\TaskManager.Tizen.csproj", "{DFB502D6-497D-48BC-ACAD-BEBB91696CE0}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {DFB502D6-497D-48BC-ACAD-BEBB91696CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {DFB502D6-497D-48BC-ACAD-BEBB91696CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {DFB502D6-497D-48BC-ACAD-BEBB91696CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {DFB502D6-497D-48BC-ACAD-BEBB91696CE0}.Release|Any CPU.Build.0 = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/TaskManager/TaskManager.Tizen/Model/ApplicationInfo.cs b/TaskManager/TaskManager.Tizen/Model/ApplicationInfo.cs
new file mode 100644 (file)
index 0000000..7aab1e5
--- /dev/null
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TaskManager.Tizen.Model
+{
+    class ApplicationInfo
+    {
+        public string Name;
+        public string Id;
+        public string AppId;
+        public string PackageId;
+        public string InstanceId;
+        public string URI;
+        public string Icon;
+        public DateTime LaunchTime;
+    };
+}
diff --git a/TaskManager/TaskManager.Tizen/Properties/AssemblyInfo.cs b/TaskManager/TaskManager.Tizen/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..f52e621
--- /dev/null
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("TaskManager.Tizen")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Samsung")]
+[assembly: AssemblyProduct("TaskManager.Tizen")]
+[assembly: AssemblyCopyright("Copyright © Samsung 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("dfb502d6-497d-48bc-acad-bebb91696ce0")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/TaskManager/TaskManager.Tizen/Services/ApplicationService.cs b/TaskManager/TaskManager.Tizen/Services/ApplicationService.cs
new file mode 100644 (file)
index 0000000..58594c7
--- /dev/null
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TaskManager.Tizen.Model;
+
+namespace TaskManager.Tizen.Services
+{
+    class ApplicationService
+    {
+        public static List<ApplicationInfo> GetApplicationsInfo()
+        {
+            return null;
+        }
+
+        public static void KillApplication(ApplicationInfo info)
+        {
+        }
+
+        public static void ResumeApplication(ApplicationInfo info)
+        {
+        }
+    }
+}
diff --git a/TaskManager/TaskManager.Tizen/TaskManager.Tizen.cs b/TaskManager/TaskManager.Tizen/TaskManager.Tizen.cs
new file mode 100644 (file)
index 0000000..c387055
--- /dev/null
@@ -0,0 +1,20 @@
+using System;
+
+namespace TaskManager.Tizen
+{
+    class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
+    {
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+            LoadApplication(new App());
+        }
+
+        static void Main(string[] args)
+        {
+            var app = new Program();
+            global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
+            app.Run(args);
+        }
+    }
+}
diff --git a/TaskManager/TaskManager.Tizen/TaskManager.Tizen.csproj b/TaskManager/TaskManager.Tizen/TaskManager.Tizen.csproj
new file mode 100644 (file)
index 0000000..39d1072
--- /dev/null
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectTypeGuids>{2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ProjectGuid>{DFB502D6-497D-48BC-ACAD-BEBB91696CE0}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>TaskManager.Tizen</RootNamespace>
+    <AssemblyName>TaskManager.Tizen</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <DefaultLanguage>en-US</DefaultLanguage>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetFrameworkIdentifier>DNXCore</TargetFrameworkIdentifier>
+    <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+    <NuGetTargetMoniker>.NETCoreApp,Version=v1.0</NuGetTargetMoniker>
+    <NoStdLib>true</NoStdLib>
+    <NoWarn>$(NoWarn);1701</NoWarn>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>portable</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>portable</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="TaskManager.Tizen.project.json" />
+    <None Include="tizen-manifest.xml" />
+    <None Include="shared\res\TaskManager.Tizen.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Model\ApplicationInfo.cs" />
+    <Compile Include="Services\ApplicationService.cs" />
+    <Compile Include="TaskManager.cs" />
+    <Compile Include="TaskManager.Tizen.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ViewModels\MainViewModel.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="lib\" />
+    <Folder Include="res\" />
+    <Folder Include="View\" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+               Other similar extension points exist, see Microsoft.Common.targets.
+       <Target Name="BeforeBuild">
+       </Target>
+       <Target Name="AfterBuild">
+       </Target>
+       -->
+  <PropertyGroup>
+    <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and
+                        https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
+               -->
+    <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two
+                        properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and
+                        to prevent it from outputting a warning (MSB3644).
+               -->
+    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
+    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
+    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
+  </PropertyGroup>
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
+        <ProjectCommonFlavorCfg />
+      </FlavorProperties>
+      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
+        <ProjectCommonFlavorCfg />
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
\ No newline at end of file
diff --git a/TaskManager/TaskManager.Tizen/TaskManager.Tizen.nuget.targets b/TaskManager/TaskManager.Tizen/TaskManager.Tizen.nuget.targets
new file mode 100644 (file)
index 0000000..079653d
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">
+    <NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
+  </PropertyGroup>
+  <ImportGroup>
+    <Import Project="$(NuGetPackageRoot)\Xamarin.Forms\2.3.4.214-pre5\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)\Xamarin.Forms\2.3.4.214-pre5\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/TaskManager/TaskManager.Tizen/TaskManager.Tizen.project.json b/TaskManager/TaskManager.Tizen/TaskManager.Tizen.project.json
new file mode 100644 (file)
index 0000000..925ad9a
--- /dev/null
@@ -0,0 +1,28 @@
+{
+       "buildOptions": {
+               "emitEntryPoint": true,
+               "debugType": "portable",
+               "platform": "AnyCPU",
+               "preserveCompilationContext": true
+       },
+       "dependencies": {
+               "Microsoft.NETCore.App": {
+               "version": "1.0.0"
+               },
+               "Tizen.Library": "1.0.0-pre3",
+               "Xamarin.Forms": "2.3.4.214-pre5",
+               "Xamarin.Forms.Platform.Tizen": "2.3.4-r214-002"
+       },
+       "runtimes": {
+               "win": {},
+               "linux": {}
+       },
+       "frameworks": {
+               "netcoreapp1.0": {
+                       "imports": [
+                               "portable-net45+wp80+win81+wpa81",
+                               "netstandard1.6"
+                       ]
+               }
+       }
+}
diff --git a/TaskManager/TaskManager.Tizen/TaskManager.cs b/TaskManager/TaskManager.Tizen/TaskManager.cs
new file mode 100644 (file)
index 0000000..b01037e
--- /dev/null
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using Xamarin.Forms;
+
+namespace TaskManager
+{
+    public class App : Application
+    {
+        public App()
+        {
+            // The root page of your application
+            MainPage = new ContentPage
+            {
+                Content = new StackLayout
+                {
+                    VerticalOptions = LayoutOptions.Center,
+                    Children = {
+                        new Label {
+                            HorizontalTextAlignment = TextAlignment.Center,
+                            Text = "Welcome to Xamarin Forms!"
+                        }
+                    }
+                }
+            };
+        }
+
+        protected override void OnStart()
+        {
+            // Handle when your app starts
+        }
+
+        protected override void OnSleep()
+        {
+            // Handle when your app sleeps
+        }
+
+        protected override void OnResume()
+        {
+            // Handle when your app resumes
+        }
+    }
+}
diff --git a/TaskManager/TaskManager.Tizen/ViewModels/MainViewModel.cs b/TaskManager/TaskManager.Tizen/ViewModels/MainViewModel.cs
new file mode 100644 (file)
index 0000000..41f1b86
--- /dev/null
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+using TaskManager.Tizen.Model;
+using Xamarin.Forms;
+
+namespace TaskManager.Tizen.ViewModels
+{
+    class MainViewModel : INotifyPropertyChanged
+    {
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        public ObservableCollection<ApplicationInfo> Applications { get; }
+
+        #region Commands
+        private ICommand _resumeApp;
+        public ICommand ResumeApp
+        {
+            get { return _resumeApp ?? (_resumeApp = new Command(ResumeApplication)); }
+        }
+
+        private ICommand _killApp;
+        public ICommand KillApp
+        {
+            get { return _killApp ?? (_killApp = new Command(KillApplication)); }
+        }
+
+        private ICommand _killAll;
+        public ICommand KillAll
+        {
+            get { return _killAll ?? (_killAll = new Command(KillAllApplications)); }
+        }
+        #endregion
+
+        private void ResumeApplication(object app)
+        {
+        }
+
+        private void KillApplication(object app)
+        {
+        }
+
+        private void KillAllApplications()
+        {
+        }
+    }
+}
diff --git a/TaskManager/TaskManager.Tizen/shared/res/TaskManager.Tizen.png b/TaskManager/TaskManager.Tizen/shared/res/TaskManager.Tizen.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/TaskManager/TaskManager.Tizen/shared/res/TaskManager.Tizen.png differ
diff --git a/TaskManager/TaskManager.Tizen/tizen-manifest.xml b/TaskManager/TaskManager.Tizen/tizen-manifest.xml
new file mode 100644 (file)
index 0000000..115ba17
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="org.tizen.task-mgr" version="1.0.0" api-version="3.0" xmlns="http://tizen.org/ns/packages">
+  <profile name="mobile" />
+  <ui-application appid="org.tizen.task-mgr" exec="TaskManager.Tizen.exe" multiple="false" nodisplay="false" taskmanage="false" splash-screen-display="true" type="dotnet" launch_mode="single">
+    <label>task-mgr</label>
+    <icon>TaskManager.Tizen.png</icon>
+  </ui-application>
+  <shortcut-list />
+</manifest>