Brad Abrams's blog Chinese version

Design Guidelines, Managed code and the .NET Framework: http://blogs.msdn.com/brada/default.aspx
随笔 - 51, 评论 - 26, 引用 - 1

导航

关于

These postings are provided "AS IS" with no warranties, and confer no rights.

标签

每月存档

最新留言

广告

可重用的WPF变换项目上线了

【原文地址】Reusable WPF Transitions Project is live!
【原文发表日期】29 April 08 12:33

Jared Bienz正致力于将一些很酷的WPF变换的代码发布到codeplex上。目前这个叫做Transitionals的项目,已经正式上线了。

Transitionals是一套创建及应用WPF变换的框架,这种变换提供了一种简便的方法将用户界面切换为一个丰富的、动态的显示方式。这种为应用程序所做的变换,和你在视频剪辑中所做的是一样的。消除、剪切、溶解、星形装饰、百叶窗和3D旋转立方体就是这个Transitionals框架所支持的变换的几个例子。

要开始上手这个Transitionals框架,最好的方式就是下载并查看Transitionals的帮助文件。你可以在“Releases”这个标签里找到它,这里面包括了一份非常全面的入门教程。你也可以下载它的二进制文件存档,其中包含了两个示例项目。Transitionals是针对.Net Framework 3.5,在Visual Studio 2008中进行编译的。

Transitionals

posted on 2008-05-22 16:44:48 by tshao  评论(0) 阅读(4549)

托管扩展性框架(Managed Extensibility Framework)

【原文地址】Managed Extensibility Framework
【原文发表日期】28 April 08 06:14

Krzysztof 最近在他的blog上宣布,我们已经开始致力于为.NET创建一个扩展性的框架了……

在接下来的几个月,我们会在blog上谈论MEF的更多细节,不过现在已经有一些初期的细节了(当然,很可能会作改动):MEF是一系列特性的集合,在学术界与工业上,这一集合即是一个命名与激活服务(返回一个“具名”的对象),依赖注入(DI)框架,以及一个结构化类型系统(动态类型)。将这些技术(以及其它技术如System.AddIn)组织在一起,我们将实现一个称之为“开放式与动态应用”的新天地。比方说,它会使得创建可扩展的应用与扩展更加简单方便了。

[……]

最后,这里有一段代码,展示了我们的框架所支持的基本的场景:

在应用中创建一个扩展点:

public class HelloWorld {

  [Import] // import declares what a component needs
  public OutputDevice Output;

  public void SayIt() {
        Output.WriteLine("Hello World");
  }
}

// Extension 
public abstract class OutputDevice {
  void WriteLine(string output){}
}

1. 创建一个扩展

[Export(typeof(OutputDevice))] // export declared what a component gives
public class CustomOutput : OutputDevice {
  public void WriteLine(string output) {
    Console.WriteLine(output);
  }
}

 

2. 将应用于扩展结合(依赖注入)起来的诀窍

var domain = new ComponentDomain();
var hello = new HelloWorld();
// of course this can be implicit
domain.AddComponent(hello); 
domain.AddComponent(new CustomOutput());
 
domain.Bind(); // bind matches the needs to gives
hello.SayIt();

我们乐于倾听您的意见……请加入到Kry的blog中一起讨论吧。

posted on 2008-05-19 13:27:17 by tshao  评论(0) 阅读(4340)

Powered by: Joycode.MVC引擎 0.5.2.0