WinFX开发手记 Part1 WinFX概述

WinFX开发手记(本文都是基于WinFX Beta2做出的)
Part1 WinFX概述
作者:张程

WinFX是一种在Microsoft Windows下的托管编程模型。它包含了.NET Framework 2.0、Windows Presentation Foundation、Windows Communication Foundation、Windows WorkFlow Foundation。

.NET Framework
核心API包含了被所有WinFX类型的程序共享的类。它的很大一部分都被包含在System命名空间下。.Net Framework API主要包括以下几个方面:
1、 基本的值类型和引用类型
2、 集合与数据结构
3、 数据
4、 图像和绘画
5、 输入和输出
6、 基本的网络支持
7、 安全
8、 线程和运行时服务
.NET Framework不仅可以用来创建Windows From程序,同样也提供了创建Web应用程序的支持。

Windows Communication Foundation
构建在Web Service协议之上的新的面向服务的基础通信结构。提供了互操作安全、可靠性保证、事务化消息。
Windows Communication Foundation构建在.Net Framework之上的,根本上简化了互联系统的构建工作。对于分布式系统提供了统一的购建化、可扩展的架构,支持多路传输、消息模式、编码、网络拓扑和Hosting模型。可以说是现有的ASP.Net(asmx)、Microsoft Web Service Enhancements for Microsoft .NET(WSE)、.NET Remoting、Enterprise Service和System.Messaging集中统一的下一个版本。
Windows Communication Foundation的类和API大部分都包含在System.ServiceModel命名空间内,提供了对一下技术的支持:
1、 单向和双向消息
2、 同步和异步远程过程调用
3、 回调
4、 会话
5、 多契约服务
6、 基于传输、消息的安全性、可靠性和有序分发
7、 消息队列
8、 事务支持

Windows Presentation Foundation
Windows Presentation Foundation是未来Windows中的图形子系统的统一基础构架。包含了显示引擎和一系列的托管类用以创建令人惊异的应用。引入了XAML这是一种基于声明的模型,可以用来操控Windows Presentation Foundation对象模型。
Windows Presentation Foundation提供的API和类很大一部分都包含在System.Windows命名空间内。主要的组件包括:
1、 一个应用程序模型,包含导航、窗口和对话框
2、 UI数据绑定
3、 丰富的扩展布局和控件对象
4、 2D、3D图形支持
5、 动画
6、 多媒体
7、 文档

Windows WorkFlow Foundation
Windows WorkFlow Foundation是构建在.NET Framework基础上的全新的工作流开发平台。
Windows WorkFlow Foundation为创建和执行多样的、长时间运行的、稳定的工作流应用提供了统一的编程模型。
Windows WorkFlow Foundation提供了简便易用的工作流功能,让开发例如文档管理、商业票据流转、IT管理和其他各种各样的商业应用程序变得更加容易。
应用程序可以方便的载入工作流引擎,并且插入各种各样的运行时组件,因此它具有高度的可扩展性,可以创建适合特定商业领域的工作流组件并实现功能。
Windows WorkFlow Foundation也同时提供了对ASP.NET的支持,因此在IIS(Internet Information Service)/ASP.NET环境下开发工作流程序也变得十分方便。

获取和安装检测WinFX
从微软网站上现在可以方便的获取WinFX Beta2的版本,分为x86、IA64、x64三个版本,下载后参照安装说明就可以完成安装过程。
安装了的朋友可以使用以下HTML代码来确定自己的WinFX版本是多少。

None.gif < html >
None.gif
< head >
None.gif    
< title > Test for WinFX Runtime </ title >
None.gif    
< meta  http-equiv ="Content-Type"  content ="text/html; charset=utf-8"   />
None.gif
ExpandedBlockStart.gifContractedBlock.gif    
< script  language ="JavaScript" > dot.gif
InBlock.gif
InBlock.gif
<!--
InBlock.gif
var WinFXRuntimeVersion = "3.0.50727";
InBlock.gif
InBlock.gif
function window::onload()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
if (HasRuntimeVersion(WinFXRuntimeVersion))
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gifresult.innerText 
= "This machine has the correct version of WinFX Runtime: " + WinFXRuntimeVersion + "." + "\n\nThis machine's userAgent string is: " + navigator.userAgent + ".";
ExpandedSubBlockEnd.gif}
 
InBlock.gif
else
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gifdocument.write(
"This machine does not have the correct version of WinFX Runtime.<br>"
InBlock.gif
+ "<a href='http://msdn.microsoft.com/windowsvista/default.aspx'>"
ExpandedSubBlockEnd.gif
+ "Click here to get</a> WinFX now."); }

ExpandedSubBlockEnd.gif}

InBlock.gif
InBlock.gif
//
InBlock.gif//
 Retrieve the version from the user agent string and compare with specified version.
InBlock.gif//
InBlock.gif
function HasRuntimeVersion(versionToCheck)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
var userAgentString = navigator.userAgent.match(/WinFX RunTime [0-9.]+/g);
InBlock.gif
InBlock.gif
if (userAgentString != null)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
var i;
InBlock.gif
for (i = 0; i < userAgentString.length; ++i)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
if (CompareVersions(GetVersion(versionToCheck), GetVersion(userAgentString[i])) <= 0)
InBlock.gif
return true;
ExpandedSubBlockEnd.gif}

ExpandedSubBlockEnd.gif}

InBlock.gif
return false;
ExpandedSubBlockEnd.gif}

InBlock.gif
InBlock.gif
//
InBlock.gif//
 Extract the numeric part of the version string.
InBlock.gif//
InBlock.gif
function GetVersion(versionString)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
var numericString = versionString.match(/([0-9]+)\.([0-9]+)\.([0-9]+)/i);
InBlock.gif
return numericString.slice(1);
ExpandedSubBlockEnd.gif}

InBlock.gif
InBlock.gif
//
InBlock.gif//
 Compare the 2 version strings by converting them to numeric format.
InBlock.gif//
InBlock.gif
function CompareVersions(version1, version2)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
for (i = 0; i < version1.length; ++i)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
var number1 = new Number(version1[i]);
InBlock.gif
var number2 = new Number(version2[i]);
InBlock.gif
if (number1 < number2)
InBlock.gif
return -1;
InBlock.gif
if (number1 > number2)
InBlock.gif
return 1;
ExpandedSubBlockEnd.gif}

InBlock.gif
return 0;
ExpandedSubBlockEnd.gif}

InBlock.gif
-->
ExpandedBlockEnd.gif    
</ script >
None.gif
None.gif
</ head >
None.gif
< body >
None.gif    
< div  id ="result"   />
None.gif
</ body >
None.gif
</ html >

如果成功安装了WinFX Beta2,那么浏览器会显示以下内容:
This machine has the correct version of WinFX Runtime: 3.0.50727.

This machine's userAgent string is: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; WinFX RunTime 3.0.50727).

转载于:https://www.cnblogs.com/zc1984/archive/2006/06/12/423772.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值