摘要: 假设我们有如下的代码 public class SecurityServiceProxy { public string Encrypt(string input) { try { return new SecurityServiceClient... 阅读全文
posted @ 2011-01-07 17:05 昝昝 阅读(566) 评论(0) 推荐(1)
摘要: 首先假设我们有如下的一个扩展方法: public static void LockExec<T>(this T obj, Action<T> action) where T : class { lock (obj) { action(obj); } }我们用这个扩展方法写下了如下的代码: static void TestInsert(bool canInsert, string insertValue) { ... 阅读全文
posted @ 2011-01-07 16:15 昝昝 阅读(509) 评论(0) 推荐(0)
摘要: 问题1: public void AsycStartDispatcher(Dispatcher dispatcher) { var thread = new Thread( (input) => { var dispatch = input as Dispatcher; if (dispatch != nul... 阅读全文
posted @ 2011-01-07 13:19 昝昝 阅读(1635) 评论(0) 推荐(0)