04 2007 档案

摘要:1. 利用ItemRemovedCallBack实现缓存中的项的依赖。 private void MyItemRemovedCallBack(string key, object value, CacheItemRemovedReason reason) { // remove the item from the cache if... 阅读全文
posted @ 2007-04-30 16:00 南守拥 阅读(214) 评论(0) 推荐(0)
摘要:A server class you are using needs several additional methods, but you can’t modify the class. Create a new class that contains these extra methods. Make this extension class a subclass or a wrapper ... 阅读全文
posted @ 2007-04-28 15:54 南守拥 阅读(179) 评论(0) 推荐(0)
摘要:A server class you are using needs an additional method, but you can’t modify the class. Create a method in the client class with an instance of the server class as its first argument. 阅读全文
posted @ 2007-04-28 15:54 南守拥 阅读(139) 评论(0) 推荐(0)
摘要:A class is doing too much simple delegation. Get the client to call the delegate directly. 阅读全文
posted @ 2007-04-28 15:53 南守拥 阅读(143) 评论(0) 推荐(0)
摘要:A client is calling a delegate class of an object. Create methods on the server to hide the delegate. 阅读全文
posted @ 2007-04-28 15:41 南守拥 阅读(153) 评论(0) 推荐(0)
摘要:A class isn’t doing very much. Move all its features into another class and delete it. 阅读全文
posted @ 2007-04-28 15:25 南守拥 阅读(209) 评论(0) 推荐(0)
摘要:You have one class doing work that should be done by two. Create a new class and move to relevant fields and methods from the old class into the new class. 阅读全文
posted @ 2007-04-28 15:23 南守拥 阅读(158) 评论(0) 推荐(0)
摘要:A field is, or will be, used by another class more than the class on which It is defined. Create a new field in the target class, and change all its users. 阅读全文
posted @ 2007-04-28 15:20 南守拥 阅读(153) 评论(0) 推荐(0)
摘要:A method is, or will be, using or used by more features of another class than the class on which it is defined. Crete a new method with a similar body in the class it uses most. Either turn the old me... 阅读全文
posted @ 2007-04-28 14:59 南守拥 阅读(124) 评论(0) 推荐(0)
摘要:You want to replace an algorithm with one that is clearer. Replace the body of the method with the new algorithm. 阅读全文
posted @ 2007-04-28 14:52 南守拥 阅读(148) 评论(0) 推荐(0)
摘要:You have a long method that uses local variables in such a way that you cannot apply extract method. Turn the method into its own object so that all the local variables become fields that object. You ... 阅读全文
posted @ 2007-04-28 14:51 南守拥 阅读(172) 评论(0) 推荐(0)
摘要:The code assigns to a parameter. Use a temporary variable instead. 阅读全文
posted @ 2007-04-28 14:49 南守拥 阅读(178) 评论(0) 推荐(0)
摘要:You have a temporary variable assigned to more than once, but is not a loop variable nor a collecting temporary variable.Make a separate temporary variable for each assignment. 阅读全文
posted @ 2007-04-28 14:40 南守拥 阅读(145) 评论(0) 推荐(0)
摘要:You have a complicated expression. Put the result of the expression, or parts of the expression, in a temporary variable with a name that explains the purpose. 阅读全文
posted @ 2007-04-28 13:56 南守拥 阅读(134) 评论(0) 推荐(0)
摘要:我们知道在用ArrayList之类时,Net对系统已经写好的许多类型有排序支持,但只是在相同类型的前提下:如都是Int或都是String。如果混合会怎么呢?/Files/nanshouyong326/TemplateAndStrategyForSort.rar 阅读全文
posted @ 2007-04-27 12:11 南守拥 阅读(223) 评论(0) 推荐(0)
摘要:表结构: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Three]') and OBJECTPROPER... 阅读全文
posted @ 2007-04-26 00:01 南守拥 阅读(235) 评论(0) 推荐(0)
摘要:Visible=' 0 %>'>后台: protected string FormatDate(object date) {if (date == DBNull.Value){ return "n/a";}try{return ((DateTime)date).ToShortDateString(); }catch{ return "n/a"; } } protected str... 阅读全文
posted @ 2007-04-24 12:20 南守拥 阅读(292) 评论(0) 推荐(0)
摘要:当向MSMQ队列添加消息时,可以成功。通过计算机管理-》服务和应用程序-》消息队列-》传出队列 便可以找到你创建的特定队列,里面也有添加的消息。但从队列中读取消息出了 远程计算机不可用 remotemachinenotavailable 的错误。郁闷Ing.. 代码如下:/Files/nanshouyong326/MSMQ.rar 阅读全文
posted @ 2007-04-23 11:38 南守拥 阅读(1770) 评论(4) 推荐(0)
摘要:林子在了啥鸟都有!怎么出这种错误了。 阅读全文
posted @ 2007-04-23 10:19 南守拥 阅读(2170) 评论(1) 推荐(0)
摘要:You are using a temporary variable to hold the result of an expression. Extract the expression into a method. Replace all references to the temp with the expression. The new method can then be used in... 阅读全文
posted @ 2007-04-20 17:12 南守拥 阅读(224) 评论(0) 推荐(0)
摘要:You have a temp that is assigned to once with a simple expression, and the temp is getting in the way of other refactoring.Sample: BeforeCode highlighting produced by Actipro CodeHighlighter (freewar... 阅读全文
posted @ 2007-04-20 16:58 南守拥 阅读(196) 评论(0) 推荐(0)
摘要:A method's body is just as clear as its name. Put the method’s body into the body of its callers and remove the method.Sample: BeforeRefactorCode highlighting produced by Actipro CodeHighlighter (fr... 阅读全文
posted @ 2007-04-20 16:49 南守拥 阅读(201) 评论(0) 推荐(0)
摘要:You have a code fragment that can be grouped together.Turn the fragment into a method whose name explains the purpose of the method. Why: First, it increases the chances that other methods can use a ... 阅读全文
posted @ 2007-04-20 15:03 南守拥 阅读(196) 评论(0) 推荐(0)
摘要:Test1 MyThreadCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace mult... 阅读全文
posted @ 2007-04-19 14:05 南守拥 阅读(285) 评论(0) 推荐(0)
摘要:Load办天还是用LoadFrom成功。 后来试了下,,把程序集加入,,SNK,就直接可以加载成功了。还没明白怎么回事呢! 阅读全文
posted @ 2007-04-18 15:57 南守拥 阅读(1460) 评论(1) 推荐(0)
摘要:在项目中可能会遇到这样的情况,我们需要时时的读取某个信息。如多个人一起报价,每个人的价格要在每个人的面前匿名显示。对于这样的时时性,很多时候我们就是定时的读数据库,显然这样不是最好的办法,在实际应用过程中,会出现很多问题,如速度、服务器负载。当我在看PetShop4.0的时候我看到了AggregateCacheDependency,它实现了Catch于数据库的时时性,并联想到了观察者模式,不知道那... 阅读全文
posted @ 2007-04-18 09:23 南守拥 阅读(1279) 评论(0) 推荐(0)
摘要:在项目中我们用SqlHelper,但又加了一下方法是返回Dataset的,于是项目中全部便用了返回DataSet的,看PetShop之类的例子人家用的是SqlDataReader,不知道有啥区别! 找到了一些数据:读取一百万条记录(秒)。SqlClient:Reader["ID"] 64.192304Reader[0] ... 阅读全文
posted @ 2007-04-17 17:29 南守拥 阅读(835) 评论(1) 推荐(0)
摘要:http://www.xnadevelopment.com/tutorials.shtml http://codeanxiety.com/ 阅读全文
posted @ 2007-04-16 13:55 南守拥 阅读(255) 评论(0) 推荐(0)
摘要:请问谁有电子的。呵呵 阅读全文
posted @ 2007-04-16 11:13 南守拥 阅读(221) 评论(0) 推荐(0)
摘要:静态缓冲区: a enventCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 try 2 { 3 Device appDevice = new Device();//得到声音设备 4 ... 阅读全文
posted @ 2007-04-12 10:06 南守拥 阅读(230) 评论(0) 推荐(0)
摘要:在做ScreenSaver的StartKit时,RSS源总报无效。看错误是 程服务器返回错误: (407) 需要代理身份验证才明白原来是公司上网用的是代理:怎么样给WebClient加上代理呢?代码如下: 下载RSS资源Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter... 阅读全文
posted @ 2007-04-09 17:31 南守拥 阅读(603) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/hide0511/archive/2006/10/24/538281.aspx 阅读全文
posted @ 2007-04-06 16:33 南守拥 阅读(200) 评论(0) 推荐(0)
摘要:http://www.digipen.edu/main/Webcast/Introduction_to_3-D_Video_Game_Developmenthttp://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/consyscourse/3D.aspx二个资源 http://www.thezbuffer.com/ 阅读全文
posted @ 2007-04-05 17:04 南守拥 阅读(232) 评论(0) 推荐(0)
摘要:the one is Blog: BlogCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections; 3 4using Castle.ActiveRecord; 5using C... 阅读全文
posted @ 2007-04-03 10:28 南守拥 阅读(554) 评论(1) 推荐(0)
摘要:配置文件: 实体类:using System;using Castle.ActiveRecord;using NHibernate.Expression; namespace CastleLearning.OneTable{ [ActiveRecord("[User]")] public class User : ActiveRecordBase { ... 阅读全文
posted @ 2007-04-02 12:20 南守拥 阅读(319) 评论(0) 推荐(0)