From 3de84bb20ff2677ce9c1ac57d067d798f00f19d6 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Fri, 9 Mar 2018 15:58:17 -0800 Subject: [PATCH] Add Ooui.Wasm sample --- .gitignore | 13 +++ Ooui.Wasm/README.md | 26 ++++++ Ooui.Wasm/ooui-sample.cs | 16 ++++ Ooui.Wasm/ooui-sample.html | 176 +++++++++++++++++++++++++++++++++++++ 4 files changed, 231 insertions(+) create mode 100644 Ooui.Wasm/README.md create mode 100644 Ooui.Wasm/ooui-sample.cs create mode 100644 Ooui.Wasm/ooui-sample.html diff --git a/.gitignore b/.gitignore index fd8fca6..7da3b43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,16 @@ + +# Wasm SDK +/Ooui.Wasm/bcl +/Ooui.Wasm/debug +/Ooui.Wasm/release +/Ooui.Wasm/managed +/Ooui.Wasm/driver.c +/Ooui.Wasm/mono.js +/Ooui.Wasm/server.py +/Ooui.Wasm/sample* +/Ooui.Wasm/lib* +/Ooui.Wasm/*.w* + # Social media files /Media diff --git a/Ooui.Wasm/README.md b/Ooui.Wasm/README.md new file mode 100644 index 0000000..f2518cf --- /dev/null +++ b/Ooui.Wasm/README.md @@ -0,0 +1,26 @@ + +## Install + +Download [Mono WebAssembly support on Jenkins](https://jenkins.mono-project.com//job/test-mono-mainline-webassembly/) by +grabbing the latest build's Azure Artifact. + +[mono-wasm-03914603a3b.zip](https://jenkins.mono-project.com/job/test-mono-mainline-webassembly/71/label=highsierra/Azure/processDownloadRequest/71/highsierra/sdks/wasm/mono-wasm-03914603a3b.zip) + +Expand that into this directory. + + + +## Build + +```bash +csc /nostdlib /target:library /r:managed/mscorlib.dll /r:managed/Ooui.dll /out:managed/Ooui.Sample.dll ooui-sample.cs +``` + + +## Run + +```bash +python server.py +``` + +Go to `locahost:8000/ooui.html` diff --git a/Ooui.Wasm/ooui-sample.cs b/Ooui.Wasm/ooui-sample.cs new file mode 100644 index 0000000..a080e86 --- /dev/null +++ b/Ooui.Wasm/ooui-sample.cs @@ -0,0 +1,16 @@ +using System; +using Ooui; + +public class Math { + public static string Add (string a, string b) { + try { + Console.WriteLine ("ENTER"); + var e = new Div (); + return e.Id; + } + catch (Exception e) { + Console.WriteLine (e); + return e.ToString (); + } + } +} diff --git a/Ooui.Wasm/ooui-sample.html b/Ooui.Wasm/ooui-sample.html new file mode 100644 index 0000000..9062d34 --- /dev/null +++ b/Ooui.Wasm/ooui-sample.html @@ -0,0 +1,176 @@ + + + + + + C# output: +
+ +
+ +
+ + + + + \ No newline at end of file