2016年5月18日

摘要: 1.引用 阅读全文
posted @ 2016-05-18 13:46 探索、追寻 阅读(592) 评论(0) 推荐(0)

2012年2月9日

摘要: 定义:将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以创建不同的表示。通用类图:示例代码:View Code 1 // Builder pattern -- Structural example 2 3 using System; 4 5 using System.Collections.Generic; 6 7 8 namespace DoFactory.GangOfFour.Builder.Structural 9 10 { 11 12 /// <summary> 13 14 /// MainApp startup class for S... 阅读全文
posted @ 2012-02-09 14:10 探索、追寻 阅读(98) 评论(0) 推荐(0)

2012年2月7日

摘要: 定义:用于为子系统中的接口提供统一的接口。Facade设计模式定义了一个较高级的接口,它使得子系统的使用更加容易。UML:示例:View Code 1 // Facade pattern -- Structural example 2 3 4 using System; 5 6 7 namespace DoFactory.GangOfFour.Facade.Structural 8 9 { 10 11 /// <summary> 12 13 /// MainApp startup class for Structural 14 15 /// ... 阅读全文
posted @ 2012-02-07 16:42 探索、追寻 阅读(235) 评论(0) 推荐(0)
 
摘要: 定义:将一个类的接口转换为另外一个用户所期望的接口。Adapter设计模式允许一些类可以共同运行,这些类因为具有不兼容的接口而不能使用其它的方法。UML:示例:View Code 1 // Adapter pattern -- Structural example 2 3 4 using System; 5 6 7 namespace DoFactory.GangOfFour.Adapter.Structural 8 9 { 10 11 /// <summary> 12 13 /// MainApp startup class for Stru... 阅读全文
posted @ 2012-02-07 16:26 探索、追寻 阅读(183) 评论(0) 推荐(0)

2011年9月27日

摘要: 1.图片存到数据库//fn为图片的URIFileStream fs = new FileStream(fn, FileMode.OpenOrCreate, FileAccess.Read);// 定义插入到数据库中的数据 bufferbuffer = new byte[fs.Length];BinaryReader br = new BinaryReader(fs);buffer = br.ReadBytes(Convert.ToInt32(fs.Length)); fs.Close();fs.Dispose();2.将图片取出BitmapImage im... 阅读全文
posted @ 2011-09-27 15:48 探索、追寻 阅读(713) 评论(0) 推荐(0)