为什么不Windows Phone 7的完全支持C#规范? [英] Why doesn't Windows Phone 7 fully support the C# specification?

查看:182
本文介绍了为什么不Windows Phone 7的完全支持C#规范?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不Windows Phone 7的完全支持C#规范的时候提供给它的唯一语言是C#?好吧,我可以理解,缺乏对动态的支持,但为什么没有禁忌的协方差支持?为什么没有第三方库是我们熟悉的,而我们在服务器的桌面项目的电话7不兼容使用?什么是在一个具有中等IL code意义,如果我们仍然在这里结束?

Why doesn't Windows Phone 7 fully support the C# specification when the only language available to it is C#? Okay, I can understand the lack of "dynamic" support, but why isn't contra-covariance supported? Why aren't third-party libraries that are familiar to us and that we use in server-desktop projects not compatible with the Phone 7? What's sense in an having an intermediate IL code if we still end up here?

推荐答案

记住,它是在Compact Framework的CLR运行 - 它不具有桌面CLR的所有功能

Bear in mind that it's running on the Compact Framework CLR - which doesn't have all the features of the desktop CLR.

编辑:后有点拖网,我发现通用方差不支持Compact Framework的(或至少不早在2005年,我怀疑它没有被执行,因为,因为一直没有多大用处,直到最近):

After a bit of trawling, I've found that generic variance isn't supported in the Compact Framework (or at least wasn't back in 2005, and I suspect it hasn't been implemented since as there's been little use until very recently):

没有方差修饰符支持。虽然方差/协方差是整体ECMA规格仿制药的组成部分,并为完整的.NET CLR实现,它不会在基类库或C#和VB中使用。

No support for variance modifiers. Though variance/co-variance forms part of the overall ECMA spec for generics, and is implemented for the full .NET CLR, it is not used in Base Class Library or by C# and VB.

好了,所以也没有完全支持C#4(绝对最新版本),但你知道它不支持任何C#3语言功能?

Okay, so it doesn't "fully support" C# 4 (the absolutely latest release), but do you know of any C# 3 language features which aren't supported?

在,你正在处理一个框架库而言这大概是基于Silverlight 3中,但与一些的Silverlight 4位,并与桌面Silverlight中删除各个方面。 (编辑:根据评论的链接,它应该包含的的Silverlight 3。我不知道这是否是准确与否......这些API的所有的),换句话说,这是自己的兽,真的。尽管IL本身可能是便携式的,这是很难给出兼容性的保证,当各种API已被删除。然而,在很多情况下,你可以重建图书馆的目标WP7。我同意这很烦人有这样做的,但它比它们不是用为好。

In terms of libraries, you're dealing with a framework which is roughly based on Silverlight 3 but with some Silverlight 4 bits, and with various aspects of "desktop" Silverlight removed. ( According to a link in the comments, it should contain all of the APIs of Silverlight 3. I'm not sure whether that's accurate or not...) In other words, it's its own beast, really. Even though the IL itself may be portable, it's hard to give a guarantee of compatibility when various APIs have been removed. However, in many cases you can rebuild the libraries to target WP7. I agree it's annoying to have to do so, but it's better than them not being available at all.

编辑:引文我的要求,它使用CF CLR:

Citations for my claims that it uses the CF CLR:

<一个href="http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/2892a6f0-ab26-48d6-b63c-e38f62eda3b3">Windows Phone 7 Series的开发者一般问题:

我可以使用程序为Windows Phone 7系列什么样的技术和工具?
  您目前可以使用托管语言C#中使用Silverlight和XNA基于Compact Framework的。

What technologies and tools can I use to program for Windows Phone 7 Series?
You can currently use the managed language C# using Silverlight and XNA based on Compact Framework.

我使用Windows窗体?
  不,Windows窗体不支持Compact Framework中的附带版本   的Windows Phone 7系列。

Can I use Windows Forms?
No, Windows Forms are not supported in the version of Compact Framework included with Windows Phone 7 Series.

(或更高版本)

我可以使用在Silverlight XNA库调用?
  Silverlight和XNA分享Compact Framework的一个共同code基地。如果呼叫没有图形界面的,在大多数情况下,它可以被Silverlight和XNA之间共享。

Can I use XNA library calls in Silverlight?
Silverlight and XNA share a common code base in the Compact Framework. If a call is not GUI based, in most cases it can be shared between Silverlight and XNA.

A <一个href="http://blogs.msdn.com/b/abhinaba/archive/2010/07/29/windows-phone-7-app-development-when-does-the-gc-run.aspx">CF团队成员的博客文章:

有关从Windows桌面开发来的Windows Phone 7(WP7)首先我想澄清的运行时(CLR),它在WP7运行的是不一样的对视了一眼桌面上运行。 WP7的运行被称为.NET精简框架(NETCF),它的工作原理不同于桌面CLR。

For the developers coming to Windows Phone 7 (WP7) from the Windows desktop let me first clarify that the runtime (CLR) that is running on the WP7 is not the same as the one running on the desktop. The WP7 runtime is known as .NET Compact Framework (NETCF) and it works differently than the "desktop CLR".

这篇关于为什么不Windows Phone 7的完全支持C#规范?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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