12 2008 档案

摘要:1: public bool Exists(Predicate predicate) 2: { 3: bool returnValue = false; 4: 5: Each(delegate(VALUE value) { returnValue |= predicate(value); }); 6:... 阅读全文
posted @ 2008-12-31 04:41 new 维生素C.net() 阅读(373) 评论(0) 推荐(0) 编辑
摘要:在Microsoft.Practices.ObjectBuilder2中的StagedStrategyChain类中只用的下面的方法来获取枚举里元素的个数: 1: private static int NumberOfEnumValues() 2: { 3: return typeof(TStageEnum).GetFields(BindingFlags.Public ... 阅读全文
posted @ 2008-12-28 16:43 new 维生素C.net() 阅读(1983) 评论(0) 推荐(0) 编辑
摘要:虽然复杂,但是考虑到业务逻辑的需要,这套Lock方案还是相当不错的: 1: CacheItem cacheItemBeforeLock = null; 2: bool lockWasSuccessful = false; 3: 4: do 5: { 6: lock (inMemoryCache.SyncRoot) 7: { 8: ... 阅读全文
posted @ 2008-12-17 01:20 new 维生素C.net() 阅读(382) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示