代码改变世界

How to release an unmanaged library loaded into managed .NET code

2012-02-20 10:39 by barbarossia, 171 阅读, 0 推荐, 收藏, 编辑
摘要:http://www.codeproject.com/Articles/258270/How-to-release-non-managed-library-loaded-into-manhttp://blogs.msdn.com/b/robgruen/archive/2004/11/12/256199.aspx 阅读全文

How many models of Asyncronous development in .NET?

2012-02-20 10:39 by barbarossia, 170 阅读, 0 推荐, 收藏, 编辑
摘要:There's at least 4, then - a regular callback (non-APM, non-EAP) is also not uncommonAPM - (BeginXXX EndXXX) Which you are using here, when the long running task completes,it calls back into your code in the EndXXX method EAP - Event based. In this model, when the long running task completes, an 阅读全文

C# Language Features, From C# 2.0 to 4.0

2012-02-10 10:46 by barbarossia, 180 阅读, 0 推荐, 收藏, 编辑
摘要:http://www.codeproject.com/Articles/327916/C-Language-Features-From-C-2-0-to-4-0 阅读全文

XSLT 2.0 in .NET

2012-02-10 10:34 by barbarossia, 216 阅读, 0 推荐, 收藏, 编辑
摘要:http://www.codeproject.com/Articles/304467/XSLT-2-0-in-NET 阅读全文

Generic Repository Pattern - Entity Framework, ASP.NET MVC and Unit Testing Triangle

2012-02-10 10:34 by barbarossia, 266 阅读, 0 推荐, 收藏, 编辑
摘要:This is good post for entity framework. The url is:http://www.tugberkugurlu.com/archive/generic-repository-pattern-entity-framework-asp-net-mvc-and-unit-testing-triangle 阅读全文

A PageList: A page control on WPF

2012-01-09 10:57 by barbarossia, 358 阅读, 0 推荐, 收藏, 编辑
摘要:I create a page control used to data access and display a page which own defined. It used the entityframework4.1 as data access and IQuerable<T> handle the page it's mechism.The code is: public class PagedList<T> : List<T> { public int StartIndex { get; private set; } public in 阅读全文

How to improve the ef4.1 where handle the large data

2012-01-09 10:57 by barbarossia, 185 阅读, 0 推荐, 收藏, 编辑
摘要:EF4.1 is the framework which can take advantage of the data proccess. But when it handle the large data, it is too slower to reaction.So the sample is how to improve the data proccess who use the ef4.1Insert code snip: using (var context = GetContext()) { context... 阅读全文

A simple method to calc the code processed time

2011-12-31 14:46 by barbarossia, 158 阅读, 0 推荐, 收藏, 编辑
摘要:the code is here: using (System.IO.StreamWriter sw = new System.IO.FileInfo("d:\\1.txt").AppendText()) { sw.WriteLine(DateTime.Now.ToString()); }And insert snip code to where needed calc the code. 阅读全文

Event design pattern

2011-12-27 10:19 by barbarossia, 184 阅读, 0 推荐, 收藏, 编辑
摘要:Events are the most commonly used form of callbacks (constructs that allow framework to call into user code). Other callback mechanisms include members taking delegates, virtual members, and interface-based plug-ins. Data from usability studies indicates that the majority of developers are more comf 阅读全文

The EF4.1 Sample

2011-12-19 10:20 by barbarossia, 174 阅读, 0 推荐, 收藏, 编辑
摘要:The Entity Framework 4.1 is a powful framework that used by entity to SQL. Here is a sample explain the many-to-many relationship.The relationship is user and role. The User_Role is the table that save the relationship between user and role.Some code snipes are : public void UpdateUser(User u... 阅读全文