2005年11月3日

人民币大写转化函数(C#版) 二十四画生的Blog

摘要: using System; namespace Test { /**//// /// Rmb 的摘要说明。 /// public class Rmb { /**//// /// 转换人民币大小金额 /// /// 金额 /// 返回大写形式 public... 阅读全文

posted @ 2005-11-03 12:01 井泉 阅读(476) 评论(0) 推荐(0) 编辑

控件的拖动和缩放

摘要: using System;using System.Drawing;using System.Windows.Forms; public class Form1 : System.Windows.Forms.Form { Form1() { InitializeComponent(); } [STAThread] static void Main() { A... 阅读全文

posted @ 2005-11-03 09:43 井泉 阅读(350) 评论(0) 推荐(0) 编辑

2005年11月1日

proxy

摘要: 若需处理需要大量创建时间、复杂或占用内存太多的对象,应使用proxy模式。通过proxy模式 可以将大对象的创建时间推迟至真正使用之时public class HelloPrinterProxy:IHelloPrinter{ string language; IHelloPrinter printer=null; HelloPrinterProxy(string language) ... 阅读全文

posted @ 2005-11-01 13:51 井泉 阅读(277) 评论(0) 推荐(0) 编辑

memento 纪念品

摘要: memento仅存储对象状态 ,以便以后进行恢复。public class OurObjectMemento{ int internalState; string anotherState; public int InternalState { get { return internalState; } set { internalState =... 阅读全文

posted @ 2005-11-01 13:32 井泉 阅读(155) 评论(0) 推荐(0) 编辑

strategy 策略

摘要: strategy 可以封装算法 并在运行时更改他们相比较而言,decorator 模式更改了皮肤 而 strategy 模式改变的是内脏strategy 模式类似于factory 模式 但factory模式在创建时改变对象 ,而 stratrgy 模式则可以自由切换public interface IHelloStrategy{ string GenerateHelloString();} ... 阅读全文

posted @ 2005-11-01 11:48 井泉 阅读(151) 评论(0) 推荐(0) 编辑

decorator 装饰者

摘要: decorator运行时为对象添加功能public interface IHelloPrinter{ void PrintHello();} public interface IHelloPrinterDecorator : IHelloPrinter{ void PrintGoodbye();} public abstract class AbstractHelloPrinterDe... 阅读全文

posted @ 2005-11-01 11:09 井泉 阅读(200) 评论(0) 推荐(0) 编辑

factory

摘要: factory 模式 从若干个可能类创建对象 public interface IHelloPrinter{ void PrintHello();}public class EnglishHelloPrinter:IHelloPrinter{ void PrintHello(){ System.Console.write(""); ... 阅读全文

posted @ 2005-11-01 10:21 井泉 阅读(223) 评论(0) 推荐(0) 编辑

singleton

摘要: singleton 模式是一种面向模式的全局变量创建方法,确保了在运行时只有singleton类的一个实例。他还提供了一个全局访问点。 在应用程序运行时,如果确定只需要一个对象实例,那么就应该使用singleton模式。 class ExampleSingleton{ public void PrintHello() { Syste... 阅读全文

posted @ 2005-11-01 09:18 井泉 阅读(235) 评论(0) 推荐(0) 编辑

2005年10月31日

用C#实现生成PDF文档 作者:sunheartlee

摘要: //write by wenhui.orgusing System;using System.IO;using System.Text;using System.Collections; namespace PDFGenerator{ public class PDFGenerator{static float pageWidth = 594.0f;static float pageDepth ... 阅读全文

posted @ 2005-10-31 15:29 井泉 阅读(283) 评论(1) 推荐(0) 编辑

游戏开发

摘要: 游戏开发向来都是c,c++的天下,大型游戏甚至连c++都靠边站。心想什么时候C#能成主流。 终于等到了托管的directx9 支持c# 和 vb.net 后来又发现 Avalon (Windows Presentation Foundation)不准确的说是 directx10 ,以下是引用的话。 (Windows Presentation Foundat... 阅读全文

posted @ 2005-10-31 11:17 井泉 阅读(1958) 评论(12) 推荐(0) 编辑

导航