You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/Demo/Demo/App.xaml.cs

47 lines
1.2 KiB

using System.Threading.Tasks;
using Unosquare.Labs.EmbedIO;
using Unosquare.Labs.EmbedIO.Modules;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace Demo
{
public partial class App : Application
{
public App()
{
InitializeComponent();
#if DEBUG
foreach (var res in System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames())
{
System.Diagnostics.Debug.WriteLine("found resource: " + res);
}
#endif
Task.Factory.StartNew(async () =>
{
using (var server = new WebServer("http://*:5000"))
{
var assembly = typeof(App).Assembly;
server.RegisterModule(new ResourceFilesModule(assembly, "Demo.wwwroot"));
await server.RunAsync();
}
});
MainPage = new NavigationPage(new MainPage());
}
protected override void OnStart()
{
}
protected override void OnSleep()
{
}
protected override void OnResume()
{
}
}
}