- 博客(17)
- 收藏
- 关注
原创 【代码】完整版的Splash.cs(包含XML注释)
Kwan.Delegates: namespace Kwan.Delegates{ /// /// Encapsulates a method that has one parameter and doesnt return a value. /// /// The type of the parameter of the method that this d
2008-03-29 15:40:00
558
原创 Splash.cs的改进
虽然做法很丑,但是,至少把跨线程调用的操心事儿留给了我自己而不是使用这个类的朋友首先定义一个Delegate:public delegate void SetT>(string propertyName, T val);然后在上一版Splash的基础上加上一个方法:public static void SetT>(string propertyName, T val){
2008-03-29 14:27:00
487
原创 一个连接主窗体与Splash窗体的Splash类
初步实现了2个窗体的连接。写为泛型,方便替换Splash窗体。当前的Splash类没有保证跨线程方法调用的线程安全,需要使用者在Splash窗体的代码中保证线程安全的调用,这也是我正在想办法解决的问题。放出包含注释的代码供批判Splash.cs/// /// A bridge class that connect a main form with a splash form/// ///
2008-03-27 22:47:00
937
原创 A little C# fun with Fibonacci
上午来到实验室,打开VS 2008,看了看Start Page中RSS的一些文章,其中有一篇讲使用多种语言实现Fibonacci函数的post,包括比较了C# 2.0与C# 3.0在实现上的不同。Post中提供了两种写法,首先是C# 2.0的static int Fibonacci (int x){ if (x 1) return 1; return Fibonac
2008-02-21 09:12:00
461
原创 与技术生活有关的一点点动向
这一年多以来,技术已经越来越融入了我的生活,不管以后将从事何行何业。昨天开始了研一下半年的工作,又恢复了每天7点20起床转钟1点左右睡觉中午午睡到13点40的作息。白天算是干正经事的时间,对着Visio 2007把Digital Pathology Solution的一些工作流程慢慢画出来了,把一些Issues & Tips也标注在上面,作为之后编码的备忘。虽然老板还没有和我交流本学期的工作任务,
2008-02-19 20:58:00
677
原创 RGB空间与HSI空间的转换算法的C#实现
这是为项目做的准备,将部分MATLAB函数的功能在C#上实现。完成标题中所说的功能,当然首先需要定义我自己的RGB类和HSI类。RGB类: /// /// RGB colorspace /// public sealed class RGB { /// /// Red component ///
2008-01-26 11:16:00
4159
原创 泛型委托 + Lambda表达式
发信人: joshuaG (秦之魅│加菲│我怀念的), 信区: DotNet标 题: 闪电,看这个,泛型委托 + Lambda表达式发信站: 武汉白云黄鹤站 (2008年01月21日15:46:01 星期一), 站内信件我觉得你给出的那个委托的第二个参数不需要用泛型,这样public delegate void GenericEventHandlerT>(T obj, EventAr
2008-01-21 15:52:00
509
原创 C#中的Partial Method
今天才看到的新玩意儿,细节就不在此说明了,编辑器能检查的东西没必要列出来讲。Partial method可以方便的加上拦截,有意思,给一个最初级的sample partial class Test { static partial void Intersector1(); static partial void Intersector2();
2008-01-18 20:17:00
532
原创 A Helper class with JSON serialization
直接参考ScottGu的blog,在其基础上加上了一个在String类型上的反向串行化的扩展,当出现异常时俘获异常,返回默认值。一个问题需要指出:这些方法中用到的JavaScriptSerializer已经obsolete了,建议选择System.Runtime.Serialization.DataContractJsonSerializer作为替代。有空我会研究如何使用新的类来完成工作。
2008-01-14 16:52:00
622
原创 【代码阅读摘记】阅读AForge.NET (1)
AForge.Imaging.Filters定义了3个公共接口public interface IFilterThe interface defines the set of methods, which should be provided by all image processing filters. Methods of this interface keep the so
2007-11-28 10:50:00
2341
原创 通过继承ServiceHost编写简化MEX编程的类
在WCF中完成同样的功能一般有2种选择:手工编码和撰写配置文件。MEX(Metadata Exchange)端点用于服务向外界发布其元数据,在WCF编程中非常常见。本文通过继承ServiceHost,编写一个简单的类来简化MEX的编程。通过这个扩展的类,不仅可以减少手工编码量,也可以减少配置文件的长度。首先定义一个CollectionHelper类,该类提供了一个静态的泛型方法,用于判断一个
2007-11-20 21:05:00
1028
1
原创 New Look of My Visual Studio Editor
Download a mono TTF from:http://damieng.com/blog/2007/11/14/droid-sans-mono-great-coding-fontAnd download a Visual Studio Settings file from:http://blog.wekeroad.com/2007/10/17/textmate-theme-for-visu
2007-11-19 00:06:00
442
原创 【WCF实践】编写最基础的公共聊天服务
学习了一段时间的WCF之后,应该开始写一些实用的工程来锻炼应用能力了。本文介绍了如何使用WCF编写最简单的公共聊天服务,当然,这只是开始,在未来,该工程将得到扩展。在上一篇关于WCF的文章中介绍了编写Duplex通讯方式的服务,在该聊天服务中我将利用到Duplex。首先还是新建一个空的解决方案,叫做WCFChat,按照惯常的手法添加2个C#类库项目,一个用于定义服务契约,一个用于服务契约的实现。在
2007-11-14 00:07:00
898
原创 Have Fun with Microsoft Popfly
Knowing that live ID is opening for registration, I cant wait to get one with the @live.cn suffix. With this id, users can enjoy various kinds of services from Microsoft.Popfly is one of the most
2007-11-09 09:43:00
586
原创 Build A Simple Duplex WCF Service
Step 1. Run Visual Studio 2008, create a blank solution called WCFDuplexService. Then add a C# Library project to the solution called DuplexServiceContract, in this project Ill define the servi
2007-11-07 10:59:00
1306
原创 Several Extension Methods for Char
Extension methods -- this new feature of C# 3.0 is good. Just write several simple methods for convenient operations on Char. /**//// /// This helper class extends the /// methods that C
2007-11-03 15:19:00
392
原创 How Do .NET Attributes Work?
I have written a sample as following:Step 1. Define my custom attribute [System.Flags()] public enum MyState ...{ State_1 = 0x0001, State_2 = 0x0002, State_3 = 0x0004
2007-11-03 14:52:00
552
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人