开始学习windows api了,写个hello,world纪念一下
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--#include<windows.h>#include<tchar.h>int_tmain(intargc,LPTSTRargv[]){HANDLEhFile=CreateFi...
阅读全文
posted @
2010-06-28 17:00
xhan
阅读(435)
推荐(0)
异步handler两个例子
摘要:实例1 : 在异步handler中异步访问网络 并返回结果代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--publicclassDemo1:IHttpAsyncHandler{#regionIHttpAsyncHandlerMemberspubli...
阅读全文
posted @
2010-06-23 09:55
xhan
阅读(418)
推荐(0)
解耦配置文件依赖,让单元测试跑起来
摘要:现在很多人都开始使用ioc框架了。新公司里也项目已在使用unity来管理对象依赖。将对象之间的依赖从程序里面放到配置文件里面,确实是我们的系统更加的灵活了我们能很容易的通过替换对象来实现程序的功能切换。另外的一个好处我觉得很多人都不太重视。那就是对象间的解耦给自动化的单元测试提供了可能性想象下我们测试我们的业务逻辑代码。如果业务逻辑代码使用了数据库,网络。比如处理一个订单这个用例。这个用例包括根据...
阅读全文
posted @
2010-06-13 16:22
xhan
阅读(525)
推荐(0)
Expression动态生成方法例子
摘要:实现和上个用DynamicMethod的方式生成的复制实体类对应一样功能代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--publicstaticclassExpMapper<TTarget,TSource>{privatestaticM...
阅读全文
posted @
2010-06-05 19:31
xhan
阅读(940)
推荐(0)
DynamicMethod应用例子实现实体类的对应属性的复制
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Reflection...
阅读全文
posted @
2010-06-04 15:54
xhan
阅读(962)
推荐(0)
c#4.0泛型接口和泛型委托的协变和逆变
摘要:先看个例子,此代码在c# 4.0下可以编译通过,因为c#4.0才开始支持逆变和协变代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Li...
阅读全文
posted @
2010-06-01 11:21
xhan
阅读(553)
推荐(0)