Ray's playground

 

2011年2月21日

Item 32: Avoid ICloneable(Effective C#)

摘要: ICloneable does have its use, but it is the exception rather than rule. It’s significantthat the .NET Framework did not add an ICloneable<T> when itwas updated with generic support. You should never add support forICloneable to value types; use the assignment operation instead. Youshould 阅读全文

posted @ 2011-02-21 21:06 Ray Z 阅读(168) 评论(0) 推荐(0) 编辑

Item 31: Implement Ordering Relations with IComparable<T> and IComparer<T>(Effective C#)

摘要: IComparable and IComparer are the standard mechanisms for providingordering relations for your types. IComparable should be used for themost natural ordering. When you implement IComparable, you shouldoverload the comparison operators (<, >, <=, >=) consistently with ourIComparable order 阅读全文

posted @ 2011-02-21 20:55 Ray Z 阅读(176) 评论(0) 推荐(0) 编辑

Nib Files and NSWindowController(Chapter 12 of Cocoa Programming for Mac OS X)

摘要: PreferenceControllerCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1#import"PreferenceController.h"234@implementationPreferenceController56-(id)init7{8if(![superinitWithWindowNibName:@"Preferences"])9{10returnnil;11}1213returnself;14}1516-(void)w 阅读全文

posted @ 2011-02-21 17:25 Ray Z 阅读(258) 评论(0) 推荐(0) 编辑

导航