dd

跨平台应用开发框架 Bridge.NET

十度 手机开发工具 收藏

Bridge.NET 通过将 C# 转换成 JavaScript 来构建跨平台的移动应用、Web应用和桌面应用。

通过 Visual Studio 插件,它为开发者提供了项目模版和编译器。

它提供了对很多流行的 JavaScript 框架的支持,如 jQuery,Bootstrap,PhoneGap,AngularJS ……。只需在项目中安装对应的 NuGet Package,就可以引用相关的 JavaScript API

C#:

// Full JavaScript API
Document.GetElementById("demo")
    .InnerHTML = "Hello";
 
 
// Call Alert()
Window.Alert("Bridge.NET");
 
 
// C# Classes
var person = new Demo.App.Person();
 
 
// Set C# Property
person.Name = "Frank";
 
 
// Generic Lists
var people = new List<Person>();
people.Add(person);
 
 
// Write to the Console
Console.WriteLine(people[0].Name); // Frank

JavaScript:

// Converted to correct JavaScript syntax
document.getElementById("demo")
    .innerHTML = "Hello";
 
 
// Call alert()
window.alert("Bridge.NET");
 
 
// JavaScript Classes
var person = new Demo.App.Person();
 
 
// Converted to proper 'set' and 'get' functions
person.setName("Frank");
 
 
// Equivalent List in pure JavaScript
var people = new Bridge.List(Demo.App.Person)();
people.add(person);
 
 
// Properly converted to console.log
console.log(people.get(0).getName()); // Frank


下载地址

dd