07 2009 档案

Adapter 模式(对象适配器模式)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Adapter{ public interface INewLog { void WriteLog(); } public interface IOldLog { void Write(); } class File... 阅读全文

posted @ 2009-07-25 14:01 Acor 阅读(190) 评论(0) 推荐(0)

State 模式
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;//work : 变量 time, bfinished, state, //work : 方法 WriteProgram, SetState, //state: 方法 WriteProgram(work w)namespace stat... 阅读全文

posted @ 2009-07-25 13:57 Acor 阅读(168) 评论(0) 推荐(0)

AbstractFactory 模式
摘要://问题描述:操作数据库。数据库可能是Access、SQL等。以操作用户信息、部门信息为例。//可能在任意数据库中操作。//User类;Department类; IUser,UserOperAccess,UserOperSQL;//IDep,DepOperAccess,DepOperSQL;//DataAccess:创建出操作类型//通过配置文件来管理(通过反射机制动态加载)要创建的操作类型。us... 阅读全文

posted @ 2009-07-23 08:55 Acor 阅读(170) 评论(0) 推荐(0)

vc6 和 vs2008 的问题
摘要:问题描述:vc 6 下Cstring 字符串无法查看变量值;vs 2008下可以。vc 6 函数语法检查似乎更为严格;vc 6下参数类型不对,不能得到正确结果;vs 2008下传Cstring 可以得到正确结果,且不会有异常。CStdioFile::WriteStringvirtual void WriteString( LPCTSTR lpsz );CFile::Open virtual BOO... 阅读全文

posted @ 2009-07-19 10:36 Acor 阅读(337) 评论(0) 推荐(0)

shellapi.h error C2065: “HDROP”: 未声明的标识符,编译出无数错误,都是这个头文件的错误
摘要:solution:#include "windows.h " // 前面加上这个 #include "shellapi.h " 阅读全文

posted @ 2009-07-15 09:50 Acor 阅读(1480) 评论(0) 推荐(0)

Proxy 模式
摘要:namespace ProxyPursuit{ class Beauty { private string name; public string BeautyName { get; set; } public Beauty() { } public Beauty(string name2) { this.name = name2; } } interface GiveGift { void Gi... 阅读全文

posted @ 2009-07-13 21:10 Acor 阅读(244) 评论(0) 推荐(0)

nafxcw.lib(afxmem.obj): LNK 2005 错误:"void * _cdecl 运算符 new (unsigned int)"(stdafx.obj 中已定义 2@YAPAXI@Z)
摘要:http://support.microsoft.com/kb/184235解决方案:删除 _ ATL _ MIN _ CRT 预处理器定义,并重建该项目。 为此,请在 项目 菜单上单击 设置 。 在 C/C++ 选项卡上选择 预处理器 类别,并删除 _ ATL _ MIN _ CRT 定义。 阅读全文

posted @ 2009-07-13 13:26 Acor 阅读(1368) 评论(0) 推荐(0)

Decorate模式 组合
摘要:装饰:修饰Class Person //人有名字和形象。一个人逐渐发展,形象不断完善,如何避免多重继承?Class PersonWrapper:Person //包装类,对人进行修饰,专门用于扩展包装//他可能硬汉,可能柔情,可能博学,可能多金...也可能既硬汉柔情,又博学多金...(完美的化身)class PersonYingHan:PersonWrapper //硬汉包装类class Pers... 阅读全文

posted @ 2009-07-11 14:40 Acor 阅读(453) 评论(0) 推荐(0)

Strategy 模式
摘要:目录:AbstractPunish.cs;//抽象策略类Context.cs;//管理类LaJiaoShui.cs;//具体策略类LaoHuDeng.cs;//具体策略类XiaZhuQian.cs;//具体策略类Program.cs.//客户端类//AbstractPunish.cs;namespace StrategyPunish{ abstract class Punish { public ... 阅读全文

posted @ 2009-07-11 13:20 Acor 阅读(274) 评论(0) 推荐(0)

error LNK2001
摘要:Searching for 'PathFileExists'...F:\ElecRoc2\SourceCode\PJTP\ColorPrnParam\ParamSet.cpp(959):if (!name.IsEmpty() && PathFileExists(name))F:\ElecRoc2\SourceCode\PJTP\ColorPrnParam\ParamSet.cpp(... 阅读全文

posted @ 2009-07-08 15:14 Acor 阅读(634) 评论(0) 推荐(0)

Event and Delegate
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace EventDelegate { class CatShoutEventArgs:EventArgs { private string name; public string Name { get{return nam... 阅读全文

posted @ 2009-07-04 19:23 Acor 阅读(177) 评论(0) 推荐(0)

Singleton 模式
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace SingletonB{ //class SingletonB //{ // private static SingletonB instance; // private SingletonB() // { // } ... 阅读全文

posted @ 2009-07-04 14:42 Acor 阅读(166) 评论(0) 推荐(0)

Lambda 表达式 问题
摘要:1、Lambda表达式可以应用于任何匿名方法可以应用的场合。 好处在于:简化编程,更节省编码时间。2、Predicate<T> 类型,(泛型委托)(它用于包装) 任何 输入参数类型为T 且 返回值为bool值的方法。如:Predicate<int> callback = new Predicate<int> (IsEvenNumber);staticbool I... 阅读全文

posted @ 2009-07-03 18:02 Acor 阅读(270) 评论(0) 推荐(0)

导航