跟小D每日学口语
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 77 下一页
摘要: using System;using System.Collections;using System.Collections.Generic;namespace BuilderFunc{ public class Product{ List<string> arrList = new List<string>(); // First in First Out (FIFO) Queue Q = new Queue(); // Last in First out (LIFO) Stack S = n... 阅读全文
posted @ 2012-08-22 23:35 Danny Chen 阅读(285) 评论(0) 推荐(0) 编辑
摘要: using System;namespace SingletonFunc{ public class Singleton{ private static object obj = new object(); private static Singleton singleton; public static Singleton CreateSingleton() { if(singleton == null){ lock(obj) { ... 阅读全文
posted @ 2012-08-22 22:15 Danny Chen 阅读(316) 评论(0) 推荐(0) 编辑
摘要: using System;namespace AbstractFactoryFunc{ public abstract class AbstractProductA{ public abstract void ProductAMethod(); } public class ProductA1 : AbstractProductA{ public override void ProductAMethod(){ Console.Write(this.ToString() + " : Method!"); C... 阅读全文
posted @ 2012-08-22 21:18 Danny Chen 阅读(192) 评论(0) 推荐(0) 编辑
摘要: Every Control in C# is full of events like MouseButtonDown and KeyDown, but what happens when you want an object to fire an event that isn't already built in? This snippet tutorial will go through all the code required to create your own events and custom event handlers.As an example, I'm go 阅读全文
posted @ 2012-08-22 10:03 Danny Chen 阅读(385) 评论(0) 推荐(0) 编辑
摘要: using System;namespace NotePadTest{ interface IFactor{ IProduct CreateIProduct(); } interface IProduct{ void showMethod(); } class BaseProduct : IProduct{ public void showMethod(){ Console.Write(this.ToString()); Console.Read(); ... 阅读全文
posted @ 2012-08-22 09:29 Danny Chen 阅读(381) 评论(0) 推荐(0) 编辑
摘要: See alsocopy (command)XCOPYList of DOS commandsrsyncSyncToyRichCopyhobocopy 阅读全文
posted @ 2012-08-22 09:26 Danny Chen 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://glorywine.blogbus.com/logs/35919064.html 以前项目管理使用的是CVS和SVN, 这两个算得上是老牌的项目管理工具了. 现今, 又多了Git, Mercurial和Bazaar这些管理工具. 自己平时没事的时候会写些程序, 因为有几台机器, 所以需要一个代码仓库来进行项目管理. 在网上google了一下, 发现了github, 非常不错, 一般的用户可以创建N个项目, 只要总容量不超过300M就行, 对于我来说够用了. 在这里记录一下github的使用方法, 以后方便查阅. 至于 阅读全文
posted @ 2012-08-20 13:36 Danny Chen 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 在Invoke或者BeginInvoke的使用中无一例外地使用了委托Delegate。一、为什么Control类提供了Invoke和BeginInvoke机制?关于这个问题的最主要的原因已经是dotnet程序员众所周知的,我在此费点笔墨再次记录到自己的日志,以便日后提醒一下自己。1、windows程序消息机制Windows GUI程序是基于消息机制的,有个主线程维护着一个消息泵。这个消息泵让windows程序生生不息。Windows GUI程序的消息循环Windows程序有个消息队列,窗体上的所有消息是这个队列里面消息的最主要来源。这里的while循环使用了GetMessage()这个方法,这 阅读全文
posted @ 2012-08-20 13:00 Danny Chen 阅读(6743) 评论(0) 推荐(0) 编辑
摘要: If you use multithreading to improve the performance your Windows Forms applications, you must be careful to make calls to your controls in a thread-safe way.ExampleAccess to Windows Forms controls is not inherently thread safe. If you have two or more threads manipulating the state of a control, it 阅读全文
posted @ 2012-08-20 11:01 Danny Chen 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 在开发应用中,我们经常用枚举来简化程序。但是让人头的是总得枚举一个别名Alias用于显示或者描述该枚举值,这时候如果我们采用if或者switch的方法来进行判读也可以,但是有点不够优雅。下面来给大家分享一下我的实现方法。今天同事把博客园里的一片文章发给我说和我之前推荐给大家的方法思路基本一样。看后感觉非常不错,于是兴起把我的思路也发布出来与大家一起分享一下。(欢迎一起交流)首先应该想到的是Attribute(在编译期初始化,用于给对象附加信息),这才是他的本职工作。首先我们就可以想到System.ComponentModel命名空间下的DescriptionAttribute,用它来担当记录描 阅读全文
posted @ 2012-08-20 10:47 Danny Chen 阅读(427) 评论(0) 推荐(0) 编辑
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 77 下一页