心如止水

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 4 5 6 7 8 9 下一页

2008年10月7日

摘要: 2007-11-29 17:01:12 Enum类为枚举提供基类。下面介绍几个方法: 1.Enum.GetValues方法:返回枚举常量对应的整数值,默认第一个枚举常量的值为0,其他的依次递增。 eg. enum Colors { Red, Green, Blue, Yellow }; enum Styles { Plaid = 0, Striped = 23, Tartan = 65, Co... 阅读全文
posted @ 2008-10-07 14:09 cutebear 阅读(305) 评论(0) 推荐(0) 编辑

2008年9月23日

摘要: 下面是它的介绍: Sparx Systems' Enterprise Architect is a Computer Aided Software Engineering (CASE) tool for designing and constructing software systems, for business process modeling, and for generalized mo... 阅读全文
posted @ 2008-09-23 16:52 cutebear 阅读(1392) 评论(0) 推荐(0) 编辑

2008年9月17日

摘要: 下面的例子描述了delegate的声明,初始化和调用:public partial class Form1 : Form{// declares a delegate, it has one parameter.delegate void help(string message);public Form1(){InitializeComponent();// anonymous method.th... 阅读全文
posted @ 2008-09-17 17:20 cutebear 阅读(483) 评论(0) 推荐(0) 编辑

2008年9月16日

摘要: 曾经面试的时候被问到写一段函数,实现不用系统已经提供的方法计算两个日期的差值。当时时间很短,脑袋很糊涂,今天细想了一下,实现如下:首先定义了一个MyDate类:classMydate{privateintyear;privateintmonth;privateintday;publicintYear{get{returnyear;}}publicintMonth{get{returnmonth;}}publicintDay{get{returnday;}}publicMydate(intyear,intmonth,intday){this.year=year;this.month=month; 阅读全文
posted @ 2008-09-16 15:03 cutebear 阅读(1484) 评论(0) 推荐(0) 编辑

2008年9月12日

摘要: 最近看到有人写的从一个网页读出源文件的代码,觉得很有趣。于是想到平时我经常从源文件中寻找自己喜欢的一个歌曲的路径,这里用一个正则表达式去匹配源文件的string,并得到路径。下面能得到源文件: public static string Get_Http(string webUrl) { string strResult = ""; try ... 阅读全文
posted @ 2008-09-12 15:47 cutebear 阅读(713) 评论(0) 推荐(0) 编辑

2008年8月22日

摘要: 通过注册ComponentDispatcher.ThreadPreprocessMessage 事件实现。 // Registering against a stack event will cause memory leak, please unregister this event when you are done with it. ComponentDispatcher.Th... 阅读全文
posted @ 2008-08-22 16:24 cutebear 阅读(359) 评论(0) 推荐(0) 编辑

摘要: 本文参考自http://www.cnblogs.com/zhouyinhui/archive/2007/08/03/841569.html,表示感谢。下面的第一个例子提供了可以将画的内容保存为文件或者是图片的功能,是Sacha Barber提供的:Download第二个例子的xaml文件如下: CodeCode highlighting produced by Actipro CodeHighli... 阅读全文
posted @ 2008-08-22 16:20 cutebear 阅读(3122) 评论(0) 推荐(0) 编辑

2008年8月20日

摘要: 假设有一个数据库Test,下面创建一个表,它有一个字段是image类型,我们把图片转换成Byte数组存放在数据库中: CREATE TABLE Images ([stream] [image] NULL)下面是例子,参考自http://www.codeproject.com/KB/database/images2db.aspxdownload the sample 阅读全文
posted @ 2008-08-20 13:10 cutebear 阅读(238) 评论(0) 推荐(0) 编辑

摘要: download the sample 阅读全文
posted @ 2008-08-20 09:46 cutebear 阅读(1105) 评论(0) 推荐(0) 编辑

2008年8月14日

摘要: 定义: 序列化就是将我们程序中的对象实例转换成流存储在存储介质上或在网络中传输。 反序列化就是把已存入的介质中或接收的网络流中的内容转换成程序运行中的对象。 目的: 1 .以某种存储形式使自定义对象持久化 2.将对象从一个地方传递到另一个地方。 在.NET中提供了两种序列化的方式: 一.BinaryFormatter 是使用二进制来格式化,它甚至可以把私有成员都序列化。 要使某个类的对象可以被序... 阅读全文
posted @ 2008-08-14 10:10 cutebear 阅读(878) 评论(0) 推荐(0) 编辑

2008年8月13日

摘要: Typically, you create a DataTemplateSelector when you have more than one DataTemplate for the same type of objects and you want to supply your own logic to choose a DataTemplate to apply based on the ... 阅读全文
posted @ 2008-08-13 16:43 cutebear 阅读(454) 评论(0) 推荐(0) 编辑

摘要: download this sample 阅读全文
posted @ 2008-08-13 15:23 cutebear 阅读(492) 评论(0) 推荐(0) 编辑

2008年8月11日

摘要: 参考自http://www.cnblogs.com/SkyD/archive/2008/08/09/1264294.html,非常感谢。用Style的BaseOn属性可以实现WPF样式的显式继承,例如,有一个基样式: CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighligh... 阅读全文
posted @ 2008-08-11 16:30 cutebear 阅读(3711) 评论(0) 推荐(1) 编辑

2008年8月8日

摘要: Bridge模式定义:实现数据对象和对数据操作的分离。例如有Insert和Update两种操作,有两个表Table1和Table2,这时为了对两个表分别进行Insert和Update操作,我们可能会写4个类:Table1Insert、Table1Update、Table2Insert和Table2Update。这时如果要新加一种Delete操作,又要多写两个类,当操作种类越多时,即使表的数量不变,... 阅读全文
posted @ 2008-08-08 10:57 cutebear 阅读(233) 评论(0) 推荐(0) 编辑

2008年8月7日

摘要: Command模式把发出命令的一方和执行命令的一方分离开来,使得请求的一方不必知道接收的一方的接口,更不必知道请求是怎么被接收,以及操作是否被执行、何时被执行,以及是怎么被执行的。它包含下面几个角色: 命令(Command)角色:声明了一个给所有具体命令类的抽象接口。 具体命令(ConcreteCommand)角色:定义一个接受者和行为之间的弱耦合,实现Execute()方法,负责调用接收考的相应... 阅读全文
posted @ 2008-08-07 16:27 cutebear 阅读(247) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 下一页