Initial commit
|
@ -0,0 +1,41 @@
|
|||
# Autosave files
|
||||
*~
|
||||
|
||||
# build
|
||||
[Oo]bj/
|
||||
[Bb]in/
|
||||
packages/
|
||||
TestResults/
|
||||
|
||||
# globs
|
||||
Makefile.in
|
||||
*.DS_Store
|
||||
*.sln.cache
|
||||
*.suo
|
||||
*.cache
|
||||
*.pidb
|
||||
*.userprefs
|
||||
*.usertasks
|
||||
config.log
|
||||
config.make
|
||||
config.status
|
||||
aclocal.m4
|
||||
install-sh
|
||||
autom4te.cache/
|
||||
*.user
|
||||
*.tar.gz
|
||||
tarballs/
|
||||
test-results/
|
||||
Thumbs.db
|
||||
.vs/
|
||||
|
||||
# Mac bundle stuff
|
||||
*.dmg
|
||||
*.app
|
||||
|
||||
# resharper
|
||||
*_Resharper.*
|
||||
*.Resharper
|
||||
|
||||
# dotCover
|
||||
*.dotCover
|
|
@ -0,0 +1,7 @@
|
|||
<html><body>
|
||||
<h1>Add-in Repository</h1>
|
||||
<p>This is a list of add-ins available in this repository.</p>
|
||||
<table border=1><thead><tr><th>Add-in</th><th>Version</th><th>Description</th></tr></thead>
|
||||
<tr><td>XAMLator.Client.MonoDevelop</td><td>1.0</td><td>XAMLator.Client.MonoDevelop</td></tr>
|
||||
</table>
|
||||
</body></html>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Repository xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Repository>
|
||||
<Url>root.mrep</Url>
|
||||
<LastModified>2018-09-05T11:38:30.471786+02:00</LastModified>
|
||||
</Repository>
|
||||
</Repository>
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Repository xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Addin>
|
||||
<Url>XAMLator.Client.MonoDevelop.mpack</Url>
|
||||
<Addin>
|
||||
<Id>XAMLator.Client.MonoDevelop</Id>
|
||||
<Namespace>XAMLator.Client.MonoDevelop</Namespace>
|
||||
<Name>XAMLator.Client.MonoDevelop</Name>
|
||||
<Version>1.0</Version>
|
||||
<BaseVersion />
|
||||
<Author>Mikayla Hutchinson</Author>
|
||||
<Copyright />
|
||||
<Url />
|
||||
<Description>XAMLator.Client.MonoDevelop</Description>
|
||||
<Category>IDE extensions</Category>
|
||||
<Dependencies />
|
||||
<OptionalDependencies />
|
||||
<Properties>
|
||||
<Property name="DownloadSize">215261</Property>
|
||||
</Properties>
|
||||
</Addin>
|
||||
</Addin>
|
||||
</Repository>
|
|
@ -0,0 +1,10 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) <2018> <Fluendo S.A.>
|
||||
Copyright (c) <2018> <Andoni Morales Alastruey>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,6 @@
|
|||
pack:
|
||||
# FIXME: Too many open files bug, build with the IDE
|
||||
# msbuild /p:Configuration=Release XAMLator.Client.MonoDevelop/XAMLator.Client.MonoDevelop.csproj
|
||||
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool setup pack XAMLator.Client.MonoDevelop/bin/Release/net461/XAMLator.Client.MonoDevelop.dll
|
||||
mv XAMLator.Client.MonoDevelop.XAMLator.Client.MonoDevelop_*.mpack AddinRepo/XAMLator.Client.MonoDevelop.mpack
|
||||
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool setup rep-build AddinRepo
|
|
@ -0,0 +1,19 @@
|
|||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with you package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.OS;
|
||||
|
||||
namespace XAMLator.SampleApp.Droid
|
||||
{
|
||||
[Activity(Label = "XAMLator.SampleApp", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
|
||||
base.OnCreate(savedInstanceState);
|
||||
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
LoadApplication(new App());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.fluendo.XAMLator_SampleApp">
|
||||
<uses-sdk android:minSdkVersion="21" />
|
||||
<application android:label="XAMLator.SampleApp.Android"></application>
|
||||
</manifest>
|
|
@ -0,0 +1,34 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// 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("XAMLator.SampleApp.Android")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("XAMLator.SampleApp.Android")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 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")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
|
@ -0,0 +1,50 @@
|
|||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.xml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable-hdpi/
|
||||
icon.png
|
||||
|
||||
drawable-ldpi/
|
||||
icon.png
|
||||
|
||||
drawable-mdpi/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.xml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called
|
||||
"Resource" that contains the tokens for each one of the resources included. For example,
|
||||
for the above Resources layout, this is what the Resource class would expose:
|
||||
|
||||
public class Resource {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
|
||||
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
7504
SampleApp/XAMLator.SampleApp.Android/Resources/Resource.designer.cs
сгенерированный
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/sliding_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed" />
|
|
@ -0,0 +1,9 @@
|
|||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/launcher_background" />
|
||||
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||
</adaptive-icon>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/launcher_background" />
|
||||
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||
</adaptive-icon>
|
После Ширина: | Высота: | Размер: 4.6 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.Android/Resources/mipmap-hdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 11 KiB |
После Ширина: | Высота: | Размер: 2.7 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.Android/Resources/mipmap-mdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 6.3 KiB |
После Ширина: | Высота: | Размер: 6.9 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.Android/Resources/mipmap-xhdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 18 KiB |
После Ширина: | Высота: | Размер: 12 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 33 KiB |
После Ширина: | Высота: | Размер: 19 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 51 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="launcher_background">#FFFFFF</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
</resources>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources>
|
||||
|
||||
<style name="MainTheme" parent="MainTheme.Base">
|
||||
</style>
|
||||
<!-- Base theme applied no matter what API -->
|
||||
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!--We will be using the toolbar so no need to show ActionBar-->
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
|
||||
<!-- colorPrimary is used for the default action bar background -->
|
||||
<item name="colorPrimary">#2196F3</item>
|
||||
<!-- colorPrimaryDark is used for the status bar -->
|
||||
<item name="colorPrimaryDark">#1976D2</item>
|
||||
<!-- colorAccent is used as the default value for colorControlActivated
|
||||
which is used to tint widgets -->
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
<!-- You can also set colorControlNormal, colorControlActivated
|
||||
colorControlHighlight and colorSwitchThumbNormal. -->
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
|
||||
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A8AF73A1-E1A1-40EF-943E-4FBF475B0C8A}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>XAMLator.SampleApp.Droid</RootNamespace>
|
||||
<AssemblyName>XAMLator.SampleApp.Android</AssemblyName>
|
||||
<AndroidApplication>True</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Mono.Android" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Forms">
|
||||
<Version>3.0.0.446417</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\Tabbar.axml" />
|
||||
<AndroidResource Include="Resources\layout\Toolbar.axml" />
|
||||
<AndroidResource Include="Resources\values\styles.xml" />
|
||||
<AndroidResource Include="Resources\values\colors.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\drawable\" />
|
||||
<Folder Include="Resources\drawable-hdpi\" />
|
||||
<Folder Include="Resources\drawable-xhdpi\" />
|
||||
<Folder Include="Resources\drawable-xxhdpi\" />
|
||||
<Folder Include="Resources\drawable-xxxhdpi\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\XAMLator.Server.Droid\XAMLator.Server.Droid.csproj">
|
||||
<Project>{8634D953-84BF-4BBD-873B-B4339BEEA7BF}</Project>
|
||||
<Name>XAMLator.Server.Droid</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\XAMLator.SampleApp\XAMLator.SampleApp.projitems" Label="Shared" Condition="Exists('..\XAMLator.SampleApp\XAMLator.SampleApp.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using Gtk;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.GTK;
|
||||
using Xamarin.Forms.Platform.GTK.Helpers;
|
||||
|
||||
namespace XAMLator.SampleApp
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
GtkThemes.Init();
|
||||
Gtk.Application.Init();
|
||||
Forms.Init();
|
||||
var app = new App();
|
||||
var window = new FormsWindow();
|
||||
window.LoadApplication(app);
|
||||
window.SetApplicationTitle("XAMLator Sample App");
|
||||
window.Show();
|
||||
Server.PreviewServer.Run();
|
||||
Gtk.Application.Run();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\Xamarin.Forms.3.0.0.446417 \build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.3.0.0.446417 \build\netstandard2.0\Xamarin.Forms.props')" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{040C0E99-7128-4968-AB57-47E3CBFBF2BD}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<RootNamespace>XAMLator.SampleApp.Gtk</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\XAMLator.Server.Net45\XAMLator.Server.Net45.csproj">
|
||||
<Project>{E3F80ADC-71F8-454E-BA3B-87BD0D78B051}</Project>
|
||||
<Name>XAMLator.Server.Net45</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mono.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="Xamarin.Forms.Core.Design">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Design\Xamarin.Forms.Core.Design.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml.Design">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Design\Xamarin.Forms.Xaml.Design.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Core">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\OpenTK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="webkit-sharp">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\webkit-sharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform.GTK">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="webkit-sharp.dll.config" />
|
||||
<None Include="OpenTK.dll.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\XAMLator.SampleApp\XAMLator.SampleApp.projitems" Label="Shared" Condition="Exists('..\XAMLator.SampleApp\XAMLator.SampleApp.projitems')" />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.3.0.0.446417 \build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.3.0.0.446417 \build\netstandard2.0\Xamarin.Forms.targets')" />
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net47" />
|
||||
<package id="Xamarin.Forms" version="3.0.0.446417" targetFramework="net47" />
|
||||
<package id="Xamarin.Forms.Platform.GTK" version="3.0.0.446417" targetFramework="net47" />
|
||||
</packages>
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace XAMLator.SampleApp.iOS
|
||||
{
|
||||
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
// User Interface of the application, as well as listening (and optionally responding) to
|
||||
// application events from iOS.
|
||||
[Register("AppDelegate")]
|
||||
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
||||
{
|
||||
//
|
||||
// This method is invoked when the application has loaded and is ready to run. In this
|
||||
// method you should instantiate the window, load the UI into it and then make the window
|
||||
// visible.
|
||||
//
|
||||
// You have 17 seconds to return from this method, or iOS will terminate your application.
|
||||
//
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
global::Xamarin.Forms.Forms.Init();
|
||||
LoadApplication(new App());
|
||||
|
||||
return base.FinishedLaunching(app, options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon60.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon58.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon87.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon80.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon180.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon20.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon29.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon58.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon80.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon76.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon152.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "83.5x83.5",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon167.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "1024x1024",
|
||||
"idiom": "ios-marketing",
|
||||
"filename": "Icon1024.png"
|
||||
}
|
||||
],
|
||||
"properties": {},
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
Normal file
После Ширина: | Высота: | Размер: 69 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
Normal file
После Ширина: | Высота: | Размер: 3.7 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
Normal file
После Ширина: | Высота: | Размер: 4.6 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
Normal file
После Ширина: | Высота: | Размер: 4.6 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
Normal file
После Ширина: | Высота: | Размер: 5.1 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
Normal file
После Ширина: | Высота: | Размер: 1.3 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
Normal file
После Ширина: | Высота: | Размер: 845 B |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
Normal file
После Ширина: | Высота: | Размер: 1.1 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
Normal file
После Ширина: | Высота: | Размер: 1.7 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
Normal file
После Ширина: | Высота: | Размер: 2.5 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
Normal file
После Ширина: | Высота: | Размер: 2.3 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
Normal file
После Ширина: | Высота: | Размер: 2.4 KiB |
Двоичные данные
SampleApp/XAMLator.SampleApp.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
Normal file
После Ширина: | Высота: | Размер: 2.7 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>XAMLator.SampleApp</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.fluendo.XAMLator-SampleApp</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>XAMLator.SampleApp</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace XAMLator.SampleApp.iOS
|
||||
{
|
||||
public class Application
|
||||
{
|
||||
// This is the main entry point of the application.
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main(args, null, "AppDelegate");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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("XAMLator.SampleApp.iOS")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("XAMLator.SampleApp.iOS")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[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("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
|
||||
|
||||
// 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")]
|
После Ширина: | Высота: | Размер: 8.7 KiB |
После Ширина: | Высота: | Размер: 10 KiB |
После Ширина: | Высота: | Размер: 34 KiB |
После Ширина: | Высота: | Размер: 7.1 KiB |
После Ширина: | Высота: | Размер: 8.2 KiB |
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="X5k-f2-b5h">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="gAE-YM-kbH">
|
||||
<objects>
|
||||
<viewController id="X5k-f2-b5h" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Y8P-hJ-Z43"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="9ZL-r4-8FZ"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="yd7-JS-zBw">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="Icon-60.png" translatesAutoresizingMaskIntoConstraints="NO" id="23">
|
||||
<rect key="frame" x="270" y="270" width="60" height="60"/>
|
||||
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.20392156862745098" green="0.59607843137254901" blue="0.85882352941176465" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="23" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" priority="1" id="39"/>
|
||||
<constraint firstItem="23" firstAttribute="centerX" secondItem="yd7-JS-zBw" secondAttribute="centerX" priority="1" id="41"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="XAI-xm-WK6" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="349" y="339"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="Icon-60.png" width="180" height="180"/>
|
||||
</resources>
|
||||
</document>
|
|
@ -0,0 +1,164 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{DA1A4802-05FA-496A-862D-74FC8B0FD5CA}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TemplateGuid>{6143fdea-f3c2-4a09-aafa-6e230626515e}</TemplateGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>XAMLator.SampleApp.iOS</RootNamespace>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AssemblyName>XAMLator.SampleApp.iOS</AssemblyName>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchExtraArgs>--enable-repl</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<BuildIpa>True</BuildIpa>
|
||||
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
|
||||
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\iPhone\AppStore</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignProvision>Automatic:AppStore</CodesignProvision>
|
||||
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<None Include="Info.plist" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon1024.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon180.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon167.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon152.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon120.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon87.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon80.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon76.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon60.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon58.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon40.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon29.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon20.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\XAMLator.Server.iOS\XAMLator.Server.iOS.csproj">
|
||||
<Project>{9F60986F-4549-436A-9467-8718FFE84CCE}</Project>
|
||||
<Name>XAMLator.Server.iOS</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms">
|
||||
<Version>3.0.0.446417</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\XAMLator.SampleApp\XAMLator.SampleApp.projitems" Label="Shared" Condition="Exists('..\XAMLator.SampleApp\XAMLator.SampleApp.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Application xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="XAMLator.SampleApp.App">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
namespace XAMLator.SampleApp
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
MainPage = new MainPage();
|
||||
|
||||
}
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
Server.PreviewServer.Run();
|
||||
// Handle when your app starts
|
||||
}
|
||||
|
||||
protected override void OnSleep()
|
||||
{
|
||||
// Handle when your app sleeps
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
// Handle when your app resumes
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XAMLator.SampleApp.Calculator">
|
||||
<ContentPage.Padding>
|
||||
<OnPlatform x:TypeArguments="Thickness">
|
||||
<OnPlatform.iOS>0,20,0,0</OnPlatform.iOS>
|
||||
</OnPlatform>
|
||||
</ContentPage.Padding>
|
||||
|
||||
<Grid Padding="5,0" RowSpacing="2" ColumnSpacing="2" BackgroundColor="Black">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label x:Name="resultText" FontSize="48" FontAttributes="Bold" BackgroundColor="Black" Text="0"
|
||||
TextColor="White" HorizontalTextAlignment="End" VerticalTextAlignment="Center"
|
||||
LineBreakMode="NoWrap" Grid.ColumnSpan="4" />
|
||||
|
||||
<Button Text="7" Grid.Row="1" Grid.Column="0"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
<Button Text="8" Grid.Row="1" Grid.Column="1"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
<Button Text="9" Grid.Row="1" Grid.Column="2"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
|
||||
<Button Text="4" Grid.Row="2" Grid.Column="0"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
<Button Text="5" Grid.Row="2" Grid.Column="1"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
<Button Text="6" Grid.Row="2" Grid.Column="2"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
|
||||
<Button Text="1" Grid.Row="3" Grid.Column="0"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
<Button Text="2" Grid.Row="3" Grid.Column="1"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
<Button Text="3" Grid.Row="3" Grid.Column="2"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
<Button Text="0" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3"
|
||||
BackgroundColor="White" TextColor="Black"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectNumber" />
|
||||
|
||||
<Button Text="÷" Grid.Row="1" Grid.Column="3"
|
||||
BackgroundColor="Olive" TextColor="White"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectOperator" />
|
||||
<Button Text="×" Grid.Row="2" Grid.Column="3"
|
||||
BackgroundColor="Yellow" TextColor="White"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectOperator" />
|
||||
<Button Text="-" Grid.Row="3" Grid.Column="3"
|
||||
BackgroundColor="Yellow" TextColor="White"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectOperator" />
|
||||
<Button Text="+" Grid.Row="4" Grid.Column="3"
|
||||
BackgroundColor="Yellow" TextColor="White"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnSelectOperator" />
|
||||
|
||||
<Button Text="C" Grid.Row="5" Grid.Column="0"
|
||||
BackgroundColor="#808080" TextColor="White"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnClear" />
|
||||
|
||||
<Button Text="=" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3"
|
||||
BackgroundColor="Yellow" TextColor="White"
|
||||
FontSize="36" BorderRadius="0" Clicked="OnCalculate" />
|
||||
</Grid>
|
||||
</ContentPage>
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace XAMLator.SampleApp
|
||||
{
|
||||
public partial class Calculator : ContentPage
|
||||
{
|
||||
public Calculator()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void OnSelectNumber(object sender, EventArgs args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnSelectOperator(object sender, EventArgs args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnClear(object sender, EventArgs args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnCalculate(object sender, EventArgs args)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:XAMLator.SampleApp"
|
||||
x:Class="XAMLator.SampleApp.MainPage">
|
||||
<StackLayout>
|
||||
<!-- Place new controls here -->
|
||||
<Label Text="This is a page!"
|
||||
TextColor="White"
|
||||
HorizontalOptions="Center"
|
||||
BackgroundColor = "Red"
|
||||
VerticalOptions="CenterAndExpand" />
|
||||
</StackLayout>
|
||||
</ContentPage>
|
|
@ -0,0 +1,12 @@
|
|||
using Xamarin.Forms;
|
||||
|
||||
namespace XAMLator.SampleApp
|
||||
{
|
||||
public partial class MainPage : ContentPage
|
||||
{
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XAMLator.SampleApp.TestView"
|
||||
>
|
||||
<ContentView.Content>
|
||||
</ContentView.Content>
|
||||
<StackLayout>
|
||||
<!-- Place new controls here -->
|
||||
<Label Text="This is a view"
|
||||
HorizontalOptions="Center"
|
||||
BackgroundColor = "Green"
|
||||
VerticalOptions="CenterAndExpand" />
|
||||
</StackLayout>
|
||||
</ContentView>
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace XAMLator.SampleApp
|
||||
{
|
||||
public partial class TestView : ContentView
|
||||
{
|
||||
public TestView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.0.0.446417 " />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<SharedGUID>{8115E626-B954-42AE-9A4C-889AFD311912}</SharedGUID>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<Import_RootNamespace>XAMLator.SampleApp</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)App.xaml" />
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)MainPage.xaml" />
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)TestView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Calculator.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)TestView.xaml.cs">
|
||||
<DependentUpon>TestView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Calculator.xaml.cs">
|
||||
<DependentUpon>Calculator.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{8115E626-B954-42AE-9A4C-889AFD311912}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||
<Import Project="XAMLator.SampleApp.projitems" Label="Shared" />
|
||||
</Project>
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// AddinInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Mikayla Hutchinson <m.j.hutchinson@gmail.com>
|
||||
//
|
||||
// Copyright (c) 2017 Microsoft Corp.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using Mono.Addins;
|
||||
using Mono.Addins.Description;
|
||||
|
||||
[assembly: Addin(
|
||||
"XAMLator.Client.MonoDevelop",
|
||||
Namespace = "XAMLator.Client.MonoDevelop",
|
||||
Version = "1.0"
|
||||
)]
|
||||
|
||||
[assembly: AddinName("XAMLator.Client.MonoDevelop")]
|
||||
[assembly: AddinCategory("IDE extensions")]
|
||||
[assembly: AddinDescription("XAMLator.Client.MonoDevelop")]
|
||||
[assembly: AddinAuthor("Mikayla Hutchinson")]
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ExtensionModel>
|
||||
<Runtime>
|
||||
</Runtime>
|
||||
<Extension path="/MonoDevelop/Ide/StartupHandlers">
|
||||
<Class class="XAMLator.Client.StartupHandler" />
|
||||
</Extension>
|
||||
</ExtensionModel>
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using MonoDevelop.Components.Commands;
|
||||
|
||||
namespace XAMLator.Client
|
||||
{
|
||||
public class StartupHandler : CommandHandler
|
||||
{
|
||||
protected override void Run()
|
||||
{
|
||||
XAMLatorMonitor.Instance.StartMonitoring();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<RootNamespace>XAMLator.Client</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MonoDevelop.Addins" Version="0.4.4" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\XAMLator.Core\XAMLator.Core.projitems" Label="Shared" Condition="Exists('..\XAMLator.Core\XAMLator.Core.projitems')" />
|
||||
<Import Project="..\XAMLator.Client\XAMLator.Client.projitems" Label="Shared" Condition="Exists('..\XAMLator.Client\XAMLator.Client.projitems')" />
|
||||
</Project>
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using MonoDevelop.Ide;
|
||||
|
||||
namespace XAMLator.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// MonoDevelop addin implementation that monitors document changes
|
||||
/// and requests previews to the clients.
|
||||
/// </summary>
|
||||
public partial class XAMLatorMonitor
|
||||
{
|
||||
MonoDevelop.Ide.Gui.Document boundDoc;
|
||||
|
||||
protected void MonitorEditorChanges()
|
||||
{
|
||||
IdeApp.Workbench.ActiveDocumentChanged += BindActiveDoc;
|
||||
BindActiveDoc(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
void BindActiveDoc(object sender, EventArgs e)
|
||||
{
|
||||
var doc = IdeApp.Workbench.ActiveDocument;
|
||||
if (boundDoc == doc)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (boundDoc != null)
|
||||
{
|
||||
boundDoc.DocumentParsed -= BoundDoc_Saved;
|
||||
boundDoc = null;
|
||||
}
|
||||
|
||||
if (doc?.FileName.Extension == ".xaml")
|
||||
{
|
||||
boundDoc = doc;
|
||||
Log.Information($"Monitoring XAML document {boundDoc.FileName}");
|
||||
boundDoc.Saved += BoundDoc_Saved;
|
||||
Preview();
|
||||
}
|
||||
}
|
||||
|
||||
Task Preview()
|
||||
{
|
||||
Log.Information($"XAML document changed {boundDoc.Name}");
|
||||
return OnXAMLChanged(boundDoc.Editor.Text);
|
||||
}
|
||||
|
||||
async void BoundDoc_Saved(object sender, EventArgs e)
|
||||
{
|
||||
await Preview();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace XAMLator.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Device information where the service is running.
|
||||
/// </summary>
|
||||
public class DeviceInfo : IEquatable<DeviceInfo>
|
||||
{
|
||||
public DeviceInfo(string id, string ip, int port)
|
||||
{
|
||||
ID = id;
|
||||
IP = ip;
|
||||
Port = port;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the device identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
public string ID { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IP of the device where the service is running.
|
||||
/// </summary>
|
||||
/// <value>The IP.</value>
|
||||
public string IP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the port where the service is running.
|
||||
/// </summary>
|
||||
/// <value>The port.</value>
|
||||
public int Port { get; }
|
||||
|
||||
public bool Equals(DeviceInfo other)
|
||||
{
|
||||
return other != null &&
|
||||
ID == other.ID &&
|
||||
IP == other.IP &&
|
||||
Port == other.Port;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hashCode = -305899678;
|
||||
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(ID);
|
||||
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(IP);
|
||||
hashCode = hashCode * -1521134295 + EqualityComparer<int>.Default.GetHashCode(Port);
|
||||
return hashCode;
|
||||
}
|
||||
|
||||
public static bool operator ==(DeviceInfo info1, DeviceInfo info2)
|
||||
{
|
||||
return EqualityComparer<DeviceInfo>.Default.Equals(info1, info2);
|
||||
}
|
||||
|
||||
public static bool operator !=(DeviceInfo info1, DeviceInfo info2)
|
||||
{
|
||||
return !(info1 == info2);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using MonoDevelop.Ide;
|
||||
|
||||
namespace XAMLator.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Listen for <see cref="DiscoveryBroadcast"/> messages published by devices
|
||||
/// announcing the XAMLator service.
|
||||
/// </summary>
|
||||
public class DiscoveryReceiver
|
||||
{
|
||||
public event EventHandler DevicesChanged;
|
||||
|
||||
readonly UdpClient listener;
|
||||
readonly Dictionary<DeviceInfo, DiscoveryBroadcast> devices;
|
||||
Thread thread;
|
||||
bool running;
|
||||
|
||||
|
||||
public DiscoveryReceiver()
|
||||
{
|
||||
devices = new Dictionary<DeviceInfo, DiscoveryBroadcast>();
|
||||
try
|
||||
{
|
||||
listener = new UdpClient(Constants.DISCOVERY_BROADCAST_RECEIVER_PORT, AddressFamily.InterNetwork);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageService.ShowError($"XAMLator: Failed to start the discovery receiver", ex);
|
||||
Debug.WriteLine("XAMLator: Failed to listen: " + ex);
|
||||
listener = null;
|
||||
}
|
||||
if (listener != null)
|
||||
{
|
||||
thread = new Thread(Run);
|
||||
thread.Start();
|
||||
}
|
||||
running = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current list of devices running announcing the service.
|
||||
/// </summary>
|
||||
public DeviceInfo[] Devices
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (devices)
|
||||
{
|
||||
return devices.Keys.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
running = false;
|
||||
thread = null;
|
||||
}
|
||||
|
||||
void Run()
|
||||
{
|
||||
while (running)
|
||||
{
|
||||
try
|
||||
{
|
||||
Listen();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("DISCOVERY RECEIVE FAILED " + ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Listen()
|
||||
{
|
||||
var broadcastEndpoint = new IPEndPoint(IPAddress.Any, Constants.DISCOVERY_BROADCAST_RECEIVER_PORT);
|
||||
|
||||
var bytes = listener.Receive(ref broadcastEndpoint);
|
||||
|
||||
var json = System.Text.Encoding.UTF8.GetString(bytes);
|
||||
|
||||
var newBroadcast = Newtonsoft.Json.JsonConvert.DeserializeObject<DiscoveryBroadcast>(json);
|
||||
|
||||
bool changed = false;
|
||||
lock (devices)
|
||||
{
|
||||
if (newBroadcast.Addresses.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DeviceInfo device = new DeviceInfo(newBroadcast.Id, newBroadcast.Addresses[0].Address, newBroadcast.Addresses[0].Port);
|
||||
DiscoveryBroadcast oldBroadcast;
|
||||
if (devices.TryGetValue(device, out oldBroadcast))
|
||||
{
|
||||
if (!oldBroadcast.Equals(newBroadcast))
|
||||
{
|
||||
changed = true;
|
||||
devices[device] = newBroadcast;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
changed = true;
|
||||
devices[device] = newBroadcast;
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
{
|
||||
DevicesChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
</configuration>
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace XAMLator.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Http client to communicate the XAMLator server.
|
||||
/// </summary>
|
||||
public class HttpClient
|
||||
{
|
||||
string baseUri;
|
||||
System.Net.Http.HttpClient client;
|
||||
|
||||
public HttpClient(string uri)
|
||||
{
|
||||
client = new System.Net.Http.HttpClient();
|
||||
baseUri = uri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request to preview a xaml document.
|
||||
/// </summary>
|
||||
/// <returns>The evaluation response.</returns>
|
||||
/// <param name="doc">The XAML document.</param>
|
||||
public async Task<EvalResponse> PreviewXaml(XAMLDocument doc)
|
||||
{
|
||||
EvalRequest request = new EvalRequest { Xaml = doc.XAML, XamlType = doc.Type };
|
||||
var content = new StringContent(Serializer.SerializeJson(request), Encoding.UTF8);
|
||||
var response = await client.PostAsync(baseUri + "/xaml", content);
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
return Serializer.DeserializeJson<EvalResponse>(await response.Content.ReadAsStringAsync());
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<SharedGUID>{188F8020-6474-43BA-A6E7-0947C385B54C}</SharedGUID>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<Import_RootNamespace>XAMLator.Client</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)XAMLator.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DiscoveryReceiver.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)HttpClient.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DeviceInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{188F8020-6474-43BA-A6E7-0947C385B54C}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||
<Import Project="XAMLator.Client.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,115 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace XAMLator.Client
|
||||
{
|
||||
public partial class XAMLatorMonitor
|
||||
{
|
||||
static readonly XAMLatorMonitor instance = new XAMLatorMonitor();
|
||||
readonly DiscoveryReceiver discovery;
|
||||
Dictionary<DeviceInfo, HttpClient> clients;
|
||||
object devicesLock = new object();
|
||||
|
||||
XAMLatorMonitor()
|
||||
{
|
||||
discovery = new DiscoveryReceiver();
|
||||
discovery.DevicesChanged += HandleDiscoveryDevicesChanged;
|
||||
clients = new Dictionary<DeviceInfo, HttpClient>();
|
||||
}
|
||||
|
||||
public static XAMLatorMonitor Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
public void StartMonitoring()
|
||||
{
|
||||
MonitorEditorChanges();
|
||||
}
|
||||
|
||||
protected virtual async Task OnXAMLChanged(string xaml)
|
||||
{
|
||||
if (clients.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var doc = ParseXAML(xaml);
|
||||
if (doc == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<HttpClient> currentClients = clients.Values.ToList();
|
||||
|
||||
await currentClients.ForEachAsync(10, async (client) =>
|
||||
{
|
||||
var res = await client.PreviewXaml(doc);
|
||||
});
|
||||
}
|
||||
|
||||
XAMLDocument ParseXAML(string xaml)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var stream = new StringReader(xaml))
|
||||
{
|
||||
var reader = XmlReader.Create(stream);
|
||||
var xdoc = XDocument.Load(reader);
|
||||
XNamespace x = "http://schemas.microsoft.com/winfx/2009/xaml";
|
||||
var classAttribute = xdoc.Root.Attribute(x + "Class");
|
||||
CleanAutomationIds(xdoc.Root);
|
||||
xaml = xdoc.ToString();
|
||||
return new XAMLDocument(xaml, classAttribute.Value);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Exception(ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void CleanAutomationIds(XElement xdoc)
|
||||
{
|
||||
xdoc.SetAttributeValue("AutomationId", null);
|
||||
foreach (var el in xdoc.Elements())
|
||||
{
|
||||
CleanAutomationIds(el);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleDiscoveryDevicesChanged(object sender, EventArgs e)
|
||||
{
|
||||
var currentDevices = discovery.Devices;
|
||||
lock (devicesLock)
|
||||
{
|
||||
// Remove disconnected devices
|
||||
foreach (var deviceName in clients.Keys)
|
||||
{
|
||||
if (!currentDevices.Contains(deviceName))
|
||||
{
|
||||
clients.Remove(deviceName);
|
||||
}
|
||||
}
|
||||
|
||||
// Add new devices
|
||||
foreach (var device in currentDevices)
|
||||
{
|
||||
if (!clients.ContainsKey(device))
|
||||
{
|
||||
clients.Add(device, new HttpClient($"http://{device.IP}:{device.Port}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,260 @@
|
|||
//
|
||||
// ConsoleCrayon.cs
|
||||
//
|
||||
// Author:
|
||||
// Aaron Bockover <abockover@novell.com>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace XAMLator
|
||||
{
|
||||
public static class ConsoleCrayon
|
||||
{
|
||||
|
||||
#region Public API
|
||||
|
||||
static ConsoleColor foreground_color;
|
||||
|
||||
public static ConsoleColor ForegroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return foreground_color;
|
||||
}
|
||||
set
|
||||
{
|
||||
foreground_color = value;
|
||||
SetColor(foreground_color, true);
|
||||
}
|
||||
}
|
||||
|
||||
static ConsoleColor background_color;
|
||||
|
||||
public static ConsoleColor BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return background_color;
|
||||
}
|
||||
set
|
||||
{
|
||||
background_color = value;
|
||||
SetColor(background_color, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ResetColor()
|
||||
{
|
||||
if (XtermColors)
|
||||
{
|
||||
Console.Write(GetAnsiResetControlCode());
|
||||
}
|
||||
else if (Environment.OSVersion.Platform != PlatformID.Unix && !RuntimeIsMono)
|
||||
{
|
||||
#if !__ANDROID__ && !__IOS__
|
||||
Console.ResetColor();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetColor(ConsoleColor color, bool isForeground)
|
||||
{
|
||||
if (color < ConsoleColor.Black || color > ConsoleColor.White)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("color", "Not a ConsoleColor value.");
|
||||
}
|
||||
|
||||
if (XtermColors)
|
||||
{
|
||||
Console.Write(GetAnsiColorControlCode(color, isForeground));
|
||||
}
|
||||
else if (Environment.OSVersion.Platform != PlatformID.Unix && !RuntimeIsMono)
|
||||
{
|
||||
#if !__ANDROID__ && !__IOS__
|
||||
if (isForeground)
|
||||
{
|
||||
Console.ForegroundColor = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.BackgroundColor = color;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ansi/VT Code Calculation
|
||||
|
||||
// Modified from Mono's System.TermInfoDriver
|
||||
// License: MIT/X11
|
||||
// Authors: Gonzalo Paniagua Javier <gonzalo@ximian.com>
|
||||
// (C) 2005-2006 Novell, Inc <http://www.novell.com>
|
||||
|
||||
private static int TranslateColor(ConsoleColor desired, out bool light)
|
||||
{
|
||||
light = false;
|
||||
switch (desired)
|
||||
{
|
||||
// Dark colors
|
||||
case ConsoleColor.Black:
|
||||
return 0;
|
||||
case ConsoleColor.DarkRed:
|
||||
return 1;
|
||||
case ConsoleColor.DarkGreen:
|
||||
return 2;
|
||||
case ConsoleColor.DarkYellow:
|
||||
return 3;
|
||||
case ConsoleColor.DarkBlue:
|
||||
return 4;
|
||||
case ConsoleColor.DarkMagenta:
|
||||
return 5;
|
||||
case ConsoleColor.DarkCyan:
|
||||
return 6;
|
||||
case ConsoleColor.Gray:
|
||||
return 7;
|
||||
|
||||
// Light colors
|
||||
case ConsoleColor.DarkGray:
|
||||
light = true;
|
||||
return 0;
|
||||
case ConsoleColor.Red:
|
||||
light = true;
|
||||
return 1;
|
||||
case ConsoleColor.Green:
|
||||
light = true;
|
||||
return 2;
|
||||
case ConsoleColor.Yellow:
|
||||
light = true;
|
||||
return 3;
|
||||
case ConsoleColor.Blue:
|
||||
light = true;
|
||||
return 4;
|
||||
case ConsoleColor.Magenta:
|
||||
light = true;
|
||||
return 5;
|
||||
case ConsoleColor.Cyan:
|
||||
light = true;
|
||||
return 6;
|
||||
case ConsoleColor.White:
|
||||
default:
|
||||
light = true;
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetAnsiColorControlCode(ConsoleColor color, bool isForeground)
|
||||
{
|
||||
// lighter fg colours are 90 -> 97 rather than 30 -> 37
|
||||
// lighter bg colours are 100 -> 107 rather than 40 -> 47
|
||||
bool light;
|
||||
int code = TranslateColor(color, out light) + (isForeground ? 30 : 40) + (light ? 60 : 0);
|
||||
return String.Format("\x001b[{0}m", code);
|
||||
}
|
||||
|
||||
private static string GetAnsiResetControlCode()
|
||||
{
|
||||
return "\x001b[0m";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region xterm Detection
|
||||
|
||||
private static bool? xterm_colors = null;
|
||||
|
||||
public static bool XtermColors
|
||||
{
|
||||
get
|
||||
{
|
||||
if (xterm_colors == null)
|
||||
{
|
||||
DetectXtermColors();
|
||||
}
|
||||
|
||||
return xterm_colors.Value;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Runtime.InteropServices.DllImport("libc", EntryPoint = "isatty")]
|
||||
private extern static int _isatty(int fd);
|
||||
|
||||
private static bool isatty(int fd)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _isatty(fd) == 1;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void DetectXtermColors()
|
||||
{
|
||||
bool _xterm_colors = false;
|
||||
|
||||
switch (Environment.GetEnvironmentVariable("TERM"))
|
||||
{
|
||||
case "xterm":
|
||||
case "rxvt":
|
||||
case "rxvt-unicode":
|
||||
if (Environment.GetEnvironmentVariable("COLORTERM") != null)
|
||||
{
|
||||
_xterm_colors = true;
|
||||
}
|
||||
break;
|
||||
case "xterm-color":
|
||||
_xterm_colors = true;
|
||||
break;
|
||||
}
|
||||
|
||||
xterm_colors = _xterm_colors && isatty(1) && isatty(2);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Runtime Detection
|
||||
|
||||
private static bool? runtime_is_mono;
|
||||
|
||||
public static bool RuntimeIsMono
|
||||
{
|
||||
get
|
||||
{
|
||||
if (runtime_is_mono == null)
|
||||
{
|
||||
runtime_is_mono = Type.GetType("System.MonoType") != null;
|
||||
}
|
||||
|
||||
return runtime_is_mono.Value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
namespace XAMLator
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const string DEFAULT_HOST = "127.0.0.1";
|
||||
|
||||
public const int DEFAULT_PORT = 8490;
|
||||
|
||||
public const int DISCOVERY_BROADCAST_PORT = 8488;
|
||||
|
||||
public const int DISCOVERY_BROADCAST_RECEIVER_PORT = 8489;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace XAMLator
|
||||
{
|
||||
/// <summary>
|
||||
/// Discovery broadcast message sent by devices to announce the service.
|
||||
/// </summary>
|
||||
public class DiscoveryBroadcast
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the device.
|
||||
/// </summary>
|
||||
/// <value>The name of the device.</value>
|
||||
public string DeviceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the device model.
|
||||
/// </summary>
|
||||
/// <value>The device model.</value>
|
||||
public string DeviceModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
public string Id => $"{DeviceName} ({DeviceModel})";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the addresses.
|
||||
/// </summary>
|
||||
/// <value>The addresses.</value>
|
||||
public DiscoveryBroadcastAddress[] Addresses { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
var o = obj as DiscoveryBroadcast;
|
||||
if (o == null) return false;
|
||||
if (DeviceName != o.DeviceName || DeviceModel != o.DeviceModel || Addresses.Length != o.Addresses.Length) return false;
|
||||
for (var i = 0; i < Addresses.Length; i++)
|
||||
{
|
||||
if (!Addresses[i].Equals(o.Addresses[i]))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var s = 1;
|
||||
if (Addresses != null)
|
||||
{
|
||||
foreach (var a in Addresses)
|
||||
{
|
||||
s += a.GetHashCode();
|
||||
}
|
||||
}
|
||||
s += (DeviceName?.GetHashCode() + DeviceModel?.GetHashCode()) ?? 0;
|
||||
return s;
|
||||
}
|
||||
|
||||
public static DiscoveryBroadcast CreateForDevice(int port)
|
||||
{
|
||||
var allInterfaces = NetworkInterface.GetAllNetworkInterfaces();
|
||||
var goodInterfaces =
|
||||
allInterfaces.Where(x => x.NetworkInterfaceType != NetworkInterfaceType.Loopback &&
|
||||
!x.Name.StartsWith("pdp_ip", StringComparison.Ordinal) &&
|
||||
x.OperationalStatus == OperationalStatus.Up);
|
||||
var iips = goodInterfaces.SelectMany(x =>
|
||||
x.GetIPProperties().UnicastAddresses
|
||||
.Where(y => y.Address.AddressFamily == AddressFamily.InterNetwork)
|
||||
.Select(y => new DiscoveryBroadcastAddress
|
||||
{
|
||||
Address = y.Address.ToString(),
|
||||
Port = port,
|
||||
Interface = x.Name
|
||||
}));
|
||||
var r = new DiscoveryBroadcast
|
||||
{
|
||||
DeviceName = "Device",
|
||||
DeviceModel = "Model",
|
||||
Addresses = iips.ToArray()
|
||||
};
|
||||
#if __IOS__
|
||||
var dev = UIKit.UIDevice.CurrentDevice;
|
||||
r.DeviceName = dev.Name;
|
||||
r.DeviceModel = dev.Model;
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
namespace XAMLator
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents Discovery broadcast address.
|
||||
/// </summary>
|
||||
public class DiscoveryBroadcastAddress
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the IP address.
|
||||
/// </summary>
|
||||
/// <value>The address.</value>
|
||||
public string Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the port where the service is running.
|
||||
/// </summary>
|
||||
/// <value>The port.</value>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the interface.
|
||||
/// </summary>
|
||||
/// <value>The interface name.</value>
|
||||
public string Interface { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
var o = obj as DiscoveryBroadcastAddress;
|
||||
if (o == null) return false;
|
||||
if (Address != o.Address || Interface != o.Interface || Port != o.Port) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var s = 1;
|
||||
s += Address.GetHashCode() + Interface.GetHashCode() + Port.GetHashCode();
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace XAMLator
|
||||
{
|
||||
public class EvalRequest
|
||||
{
|
||||
public string Declarations;
|
||||
public string ValueExpression;
|
||||
public string Xaml;
|
||||
public string XamlType;
|
||||
}
|
||||
|
||||
public class EvalMessage : INotifyPropertyChanged
|
||||
{
|
||||
public string MessageType;
|
||||
public string Text;
|
||||
public int Line;
|
||||
public int Column;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
}
|
||||
|
||||
public class EvalResult
|
||||
{
|
||||
public EvalMessage [] Messages;
|
||||
public TimeSpan Duration;
|
||||
public object Result;
|
||||
public bool HasResult;
|
||||
public string Xaml;
|
||||
|
||||
public bool HasErrors {
|
||||
get { return Messages != null && Messages.Any (m => m.MessageType == "error"); }
|
||||
}
|
||||
}
|
||||
|
||||
public class EvalResponse
|
||||
{
|
||||
public EvalMessage [] Messages;
|
||||
public Dictionary<string, List<string>> WatchValues;
|
||||
public TimeSpan Duration;
|
||||
|
||||
public bool HasErrors {
|
||||
get { return Messages != null && Messages.Any (m => m.MessageType == "error"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace XAMLator
|
||||
{
|
||||
public static class ExtensionMethods
|
||||
{
|
||||
/// <summary>
|
||||
/// Parallelize tasks in partitions limiting the number of operations that are able to run in parallel
|
||||
/// like <see cref="Parallel.ForEach"/> do but being an Asynchronous method.
|
||||
/// https://blogs.msdn.microsoft.com/pfxteam/2012/03/05/implementing-a-simple-foreachasync-part-2/
|
||||
/// </summary>
|
||||
/// <returns>The each async.</returns>
|
||||
/// <param name="source">Source.</param>
|
||||
/// <param name="dop">Degree of parallelism.</param>
|
||||
/// <param name="body">Body.</param>
|
||||
/// <param name="ct">CancellationToken?, null if not used.</param>
|
||||
/// <typeparam name="T">The 1st type parameter.</typeparam>
|
||||
public static Task ForEachAsync<T>(this IEnumerable<T> source, int dop, Func<T, Task> body, CancellationToken ct = default(CancellationToken))
|
||||
{
|
||||
return Task.WhenAll(
|
||||
Partitioner.Create(source).GetPartitions(dop).Select(partition =>
|
||||
{
|
||||
return Task.Factory.StartNew(async () =>
|
||||
{
|
||||
using (partition)
|
||||
{
|
||||
while (partition.MoveNext())
|
||||
{
|
||||
await body(partition.Current);
|
||||
ct.ThrowIfCancellationRequested();
|
||||
}
|
||||
}
|
||||
}, ct).Unwrap();
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,154 @@
|
|||
//
|
||||
// Log.cs
|
||||
//
|
||||
// Author:
|
||||
// Aaron Bockover <abockover@novell.com>
|
||||
// Andoni Morales <ylatuya@gmail.com>
|
||||
//
|
||||
// Copyright (C) 2005-2007 Novell, Inc.
|
||||
// Copyright (C) 2018 Andoni Morales Alastruey
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace XAMLator
|
||||
{
|
||||
public static class Log
|
||||
{
|
||||
static readonly object writeLock = new object();
|
||||
|
||||
public enum LogEntryType
|
||||
{
|
||||
Debug,
|
||||
Warning,
|
||||
Error,
|
||||
Information
|
||||
}
|
||||
|
||||
public static bool Debugging { get; set; }
|
||||
|
||||
public static void Debug(string message)
|
||||
{
|
||||
if (Debugging)
|
||||
{
|
||||
Commit(LogEntryType.Debug, message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Information(string message) => Commit(LogEntryType.Information, message);
|
||||
|
||||
public static void Warning(string message) => Commit(LogEntryType.Warning, message);
|
||||
|
||||
public static void Error(string message) => Commit(LogEntryType.Warning, message);
|
||||
|
||||
public static void Exception(Exception e)
|
||||
{
|
||||
Stack<Exception> exception_chain = new Stack<Exception>();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
while (e != null)
|
||||
{
|
||||
exception_chain.Push(e);
|
||||
e = e.InnerException;
|
||||
}
|
||||
|
||||
while (exception_chain.Count > 0)
|
||||
{
|
||||
e = exception_chain.Pop();
|
||||
builder.AppendFormat("{0}: {1} (in `{2}')", e.GetType(), e.Message, e.Source).AppendLine();
|
||||
builder.Append(e.StackTrace);
|
||||
if (exception_chain.Count > 0)
|
||||
{
|
||||
builder.AppendLine();
|
||||
}
|
||||
}
|
||||
|
||||
Log.Warning($"Caught an exception {builder.ToString()}");
|
||||
}
|
||||
|
||||
static void Commit(LogEntryType type, string message)
|
||||
{
|
||||
if (type == LogEntryType.Debug && !Debugging)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (type != LogEntryType.Information)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case LogEntryType.Error:
|
||||
ConsoleCrayon.ForegroundColor = ConsoleColor.Red;
|
||||
break;
|
||||
case LogEntryType.Warning:
|
||||
ConsoleCrayon.ForegroundColor = ConsoleColor.DarkYellow;
|
||||
break;
|
||||
case LogEntryType.Information:
|
||||
ConsoleCrayon.ForegroundColor = ConsoleColor.Green;
|
||||
break;
|
||||
case LogEntryType.Debug:
|
||||
ConsoleCrayon.ForegroundColor = ConsoleColor.Blue;
|
||||
break;
|
||||
}
|
||||
|
||||
var thread_name = String.Empty;
|
||||
if (Debugging)
|
||||
{
|
||||
thread_name = $"{Thread.CurrentThread.ManagedThreadId}";
|
||||
}
|
||||
|
||||
lock (writeLock)
|
||||
{
|
||||
Write("[{5}{0} {1:00}:{2:00}:{3:00}.{4:000}]", TypeString(type), DateTime.Now.Hour,
|
||||
DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond, thread_name);
|
||||
|
||||
ConsoleCrayon.ResetColor();
|
||||
|
||||
Write($" {message}\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Write(string format, params object[] args)
|
||||
{
|
||||
System.Diagnostics.Debug.Write(String.Format(format, args));
|
||||
}
|
||||
|
||||
static string TypeString(LogEntryType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case LogEntryType.Debug:
|
||||
return "Debug";
|
||||
case LogEntryType.Warning:
|
||||
return "Warn ";
|
||||
case LogEntryType.Error:
|
||||
return "Error";
|
||||
case LogEntryType.Information:
|
||||
return "Info ";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace XAMLator
|
||||
{
|
||||
public static class Serializer
|
||||
{
|
||||
static JsonSerializerSettings JsonSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
JsonSerializerSettings settings = new JsonSerializerSettings
|
||||
{
|
||||
Formatting = Formatting.None,
|
||||
PreserveReferencesHandling = PreserveReferencesHandling.Objects,
|
||||
TypeNameHandling = TypeNameHandling.None,
|
||||
ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead,
|
||||
};
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes a json string into an object.
|
||||
/// </summary>
|
||||
/// <returns>The object.</returns>
|
||||
/// <param name="json">Json.</param>
|
||||
public static object DeserializeJson(string json)
|
||||
{
|
||||
return DeserializeJson(json, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes a json string into an object.
|
||||
/// </summary>
|
||||
/// <returns>The object.</returns>
|
||||
/// <param name="json">Json.</param>
|
||||
/// <typeparam name="TType">The type of the object.</typeparam>
|
||||
public static TType DeserializeJson<TType>(string json)
|
||||
{
|
||||
return (TType)DeserializeJson(json, typeof(TType));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializes an object to a json string.
|
||||
/// </summary>
|
||||
/// <returns>The json string.</returns>
|
||||
/// <param name="obj">Object to serialize.</param>
|
||||
/// <typeparam name="TType">The type of the object.</typeparam>
|
||||
public static string SerializeJson<TType>(TType obj)
|
||||
{
|
||||
JsonSerializerSettings settings = JsonSettings;
|
||||
var json = JsonConvert.SerializeObject(obj, settings);
|
||||
return json;
|
||||
}
|
||||
|
||||
static object DeserializeJson(string jsonString, Type type = null)
|
||||
{
|
||||
JsonSerializerSettings settings = JsonSettings;
|
||||
if (type != null)
|
||||
{
|
||||
return JsonConvert.DeserializeObject(jsonString, type, settings);
|
||||
}
|
||||
return JsonConvert.DeserializeObject(jsonString, settings);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
namespace XAMLator
|
||||
{
|
||||
public class XAMLDocument
|
||||
{
|
||||
public XAMLDocument(string xaml, string type)
|
||||
{
|
||||
XAML = xaml;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
public string XAML { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<SharedGUID>{20C03245-0672-4153-809C-A99F2307B9E9}</SharedGUID>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<Import_RootNamespace>XAMLator</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Log.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ConsoleCrayon.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Serializer.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Constants.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DiscoveryBroadcast.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)EvalRequest.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)XAMLDocument.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ExtensionMethods.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)DiscoveryBroadcastAddress.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{20C03245-0672-4153-809C-A99F2307B9E9}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||
<Import Project="XAMLator.Core.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.props" Condition="Exists('$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{07B8EA9B-DE45-4FD2-B9DC-B1F364F2144D}</ProjectGuid>
|
||||
<Description>Live XAML previewer for Xamarin Forms</Description>
|
||||
<PackageId>XAMLator</PackageId>
|
||||
<PackageVersion>1.0.0</PackageVersion>
|
||||
<Authors>Andoni Morales Alastruey</Authors>
|
||||
<DevelopmentDependency>false</DevelopmentDependency>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>XAMLator.Nuget</RootNamespace>
|
||||
<UsePartialTypes>false</UsePartialTypes>
|
||||
<AssemblyName>XAMLator.Nuget</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\XAMLator.Server.Droid\XAMLator.Server.Droid.csproj">
|
||||
<Project>{8634D953-84BF-4BBD-873B-B4339BEEA7BF}</Project>
|
||||
<Name>XAMLator.Server.Droid</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\XAMLator.Server.iOS\XAMLator.Server.iOS.csproj">
|
||||
<Project>{9F60986F-4549-436A-9467-8718FFE84CCE}</Project>
|
||||
<Name>XAMLator.Server.iOS</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\XAMLator.Server.Net45\XAMLator.Server.Net45.csproj">
|
||||
<Project>{E3F80ADC-71F8-454E-BA3B-87BD0D78B051}</Project>
|
||||
<Name>XAMLator.Server.Net45</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NuGet.Build.Packaging">
|
||||
<Version>0.2.2</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
|
||||
<Import Project="$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.targets" Condition="Exists('$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.targets')" />
|
||||
</Project>
|
|
@ -0,0 +1,26 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle("XAMLator.Server.Droid")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("Fluendo S.A.")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using Mono.CSharp;
|
||||
|
||||
namespace XAMLator.Server
|
||||
{
|
||||
public partial class VM
|
||||
{
|
||||
partial void PlatformSettings(CompilerSettings settings)
|
||||
{
|
||||
settings.AddConditionalSymbol("__ANDROID__");
|
||||
}
|
||||
|
||||
partial void PlatformInit()
|
||||
{
|
||||
object res;
|
||||
bool hasRes;
|
||||
eval.Evaluate("using Android.OS;", out res, out hasRes);
|
||||
eval.Evaluate("using Android.App;", out res, out hasRes);
|
||||
eval.Evaluate("using Android.Widget;", out res, out hasRes);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\NuGet.Build.Packaging.0.2.0\build\NuGet.Build.Packaging.props" Condition="Exists('..\packages\NuGet.Build.Packaging.0.2.0\build\NuGet.Build.Packaging.props')" />
|
||||
<Import Project="..\packages\Xamarin.Forms.3.0.0.446417 \build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.0.0.446417 \build\netstandard2.0\Xamarin.Forms.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{8634D953-84BF-4BBD-873B-B4339BEEA7BF}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>XAMLator.Server.Droid</RootNamespace>
|
||||
<AssemblyName>XAMLator.Server.Droid</AssemblyName>
|
||||
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<JavaMaximumHeapSize></JavaMaximumHeapSize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
<JavaMaximumHeapSize></JavaMaximumHeapSize>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="Mono.CSharp" />
|
||||
<Reference Include="Xamarin.Forms.Core">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform.Android">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="VM.Android.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\XAMLator.Server\XAMLator.Server.projitems" Label="Shared" Condition="Exists('..\XAMLator.Server\XAMLator.Server.projitems')" />
|
||||
<Import Project="..\XAMLator.Core\XAMLator.Core.projitems" Label="Shared" Condition="Exists('..\XAMLator.Core\XAMLator.Core.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\packages\NuGet.Build.Packaging.0.2.0\build\NuGet.Build.Packaging.targets" Condition="Exists('..\packages\NuGet.Build.Packaging.0.2.0\build\NuGet.Build.Packaging.targets')" />
|
||||
<Import Project="..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets')" />
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="monoandroid90" />
|
||||
<package id="NuGet.Build.Packaging" version="0.2.0" targetFramework="monoandroid90" developmentDependency="true" />
|
||||
<package id="Xamarin.Forms" version="3.0.0.446417" targetFramework="monoandroid90" />
|
||||
</packages>
|
|
@ -0,0 +1,26 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle("XAMLator.Server.Net45")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("Fluendo S.A.")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
|
@ -0,0 +1,64 @@
|
|||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.props')" />
|
||||
<Import Project="..\packages\NuGet.Build.Packaging.0.2.0\build\NuGet.Build.Packaging.props" Condition="Exists('..\packages\NuGet.Build.Packaging.0.2.0\build\NuGet.Build.Packaging.props')" />
|
||||
<Import Project="..\packages\Xamarin.Forms.3.0.0.446417 \build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.0.0.446417 \build\netstandard2.0\Xamarin.Forms.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E3F80ADC-71F8-454E-BA3B-87BD0D78B051}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>XAMLator.Server.Net45</RootNamespace>
|
||||
<AssemblyName>XAMLator.Server.Net45</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Mono.CSharp" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Core.Design">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Design\Xamarin.Forms.Core.Design.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml.Design">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Design\Xamarin.Forms.Xaml.Design.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Core">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml">
|
||||
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\XAMLator.Server\XAMLator.Server.projitems" Label="Shared" Condition="Exists('..\XAMLator.Server\XAMLator.Server.projitems')" />
|
||||
<Import Project="..\XAMLator.Core\XAMLator.Core.projitems" Label="Shared" Condition="Exists('..\XAMLator.Core\XAMLator.Core.projitems')" />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\NuGet.Build.Packaging.0.2.0\build\NuGet.Build.Packaging.targets" Condition="Exists('..\packages\NuGet.Build.Packaging.0.2.0\build\NuGet.Build.Packaging.targets')" />
|
||||
<Import Project="..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets')" />
|
||||
</Project>
|