科尔多瓦在插件C#开发的Windows 8.1 / 10的Windows [英] Cordova plugin development in C# for Windows 8.1 / Windows 10

查看:181
本文介绍了科尔多瓦在插件C#开发的Windows 8.1 / 10的Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能写在C#科尔多瓦插件的Windows(8.1 / 10)?或者,可以用C#编写的库组件被包装成科尔多瓦插件?如果我没有错过任何东西, MSDN 并的阿帕奇文档只显示了如何用C#的Windows Phone 8 (一JS实现预期的Windows通用)

Is it possible to write a Cordova plugin for Windows (8.1/10) in C#? Alternatively, can a library component written in C# be wrapped as a Cordova plugin? If I haven't missed anything, MSDN and Apache documentation only show how to use C# for Windows Phone 8 (a JS implementation is expected for "Windows Universal")

推荐答案

是的,但也有一些要求。首先,您的图书馆必须是Windows运行时组件项目。您可以参考在你的插件一winmd或的csproj(见 https://cordova.apache.org/docs/fr/latest/guide/platforms/win8/plugin.html )。如果你的插件是有效的,并在运行时正确装载在你的应用程序,可以在JavaScript中直接使用你的C#类(这只是WinJS)。这是你的responsability暴露在插件的C#库的JavaScript包装,但它不是强制性的(只是普通最大限度地共享代码与你的插件的其他平台实现)。

Yes but there are some requirements. First, your library must be a Windows Runtime Component project. You can reference a winmd or a csproj in your plugin (see https://cordova.apache.org/docs/fr/latest/guide/platforms/win8/plugin.html). If your plugin is valid and correctly loaded in your application at runtime, you can use your C# classes in JavaScript directly (it's just WinJS). It's your responsability to expose a JavaScript wrapper of your C# library in the plugin, but it's not mandatory (just common to maximize code sharing with other platforms implementations of your plugin).

这篇关于科尔多瓦在插件C#开发的Windows 8.1 / 10的Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆