Click here to Skip to main content
15,868,102 members
This competition has ended

Best C# article of February 2012

Contribute to CodeProject and you'll automatically be in the running for a monthly prize!

Each month at CodeProject we gather together the best of the articles submitted the previous month and ask our readers to choose the best of the best. Entry is automatic - just submit you articke and we'll do the rest.

Check out the submission guidelines for information on posting articles.

Current Entries

Articles that match the contest criteria are automatically entered. The top 50 entries are shown.

Please Sign up or sign in to vote.
13 Feb 2012StevenLJackson1
How you can structure your solution and project files in Visual Studio to make updating your assemblies' version number much easier
Please Sign up or sign in to vote.
9 Mar 2012Barry Lapthorn
A XAML-only font combobox.
Please Sign up or sign in to vote.
21 May 2012Zimin Max Yang
Dynamic table mapping for LINQ-to-SQL, suitable for data horizontal partitioning (Shard).
Please Sign up or sign in to vote.
8 Aug 2012Tyler Forsythe
IceCream1945 is a demonstration of XNA and the IceCream 2D library in a 2D top-down scrolling shooter similar to 1942 for the NES.
Please Sign up or sign in to vote.
21 Feb 2012Anoop Pillai
In this post, we'll explore how to generate code from a simple XML model, with in Visual Studio - For a lot of scenarios
Please Sign up or sign in to vote.
4 Feb 2012Huisheng Chen
Using reflection to dynamically verify if an assembly is in debug or release compilation
Please Sign up or sign in to vote.
12 Feb 2012kishore Gaddam
MultiBinding allows us to bind a binding target property to a list of source properties and then apply logic to produce a value with the given inputs.
Please Sign up or sign in to vote.
7 Feb 2012ErnestoNet
User Control with scrolling and zooming done in C++/CLI
Please Sign up or sign in to vote.
10 Aug 2012Ali Javani
A Windows service that blocks any unwanted services
Please Sign up or sign in to vote.
22 May 2012Henrik Jonsson
An extended Static markup extension implementation for Silverlight 5 and WPF supporting invoking static methods with arguments, and a Silverlight Type markup extension implementation.
Please Sign up or sign in to vote.
2 Feb 2012Dean Oliver
How we can harness the power of MEF and extend it by way of generics.
Please Sign up or sign in to vote.
21 Feb 2012jeff00seattle
WebSlideProjector is a ASP.NET 3.5 Web Application that manages a fullscreen background slideshow (presented by supersized! jQuery library) with handling of anonymous user Projector Setup and login-administered Slide Carousel loading (using IZWebFileManager ASP.NET File Manager library).
Please Sign up or sign in to vote.
3 Feb 2012Dr. Sai
Pixel Manipulation in Silverlight
Please Sign up or sign in to vote.
10 Aug 2012dreamgarden
SoapBox Core uses WPF's MEF to provide a base application framework that is easy to extend. This is a simple example that includes elements of a basic application (toolbar, statusbar, document area, etc.).
Please Sign up or sign in to vote.
4 Feb 2012giulicard
You can also derive the user-defined node class from IComparable then add to it the CompareTo method.
Please Sign up or sign in to vote.
18 Feb 2012GregEllis
You can do it with some XORs:int a = 25, b = 7;a = a ^ b;b = b ^ a;a = a ^ b;Or the same thing with some shorthand to make the code even harder to read:a ^= b;b ^= a;a ^= b;
Please Sign up or sign in to vote.
20 Feb 2012ZC123456
As a developer who has spent a fair amount of time tweaking code for performance optimization, I'm having some issues with this article.First of all, who has generally accepted 10M iterations to test the performance? Unless your native code happens to be calling a function thousands or...
Please Sign up or sign in to vote.
24 Feb 2012Raymund Macaalay
Export multiple DataSets to multiple Excel sheets dynamically formatted according to the record's data type
Please Sign up or sign in to vote.
28 Feb 2012Paulo Zemek
This article presents classes to build new types at run-time without requiring users to understand IL instructions.
Please Sign up or sign in to vote.
23 Feb 2012rzvdaniel
Small utility to keep localized resources synchronized
Please Sign up or sign in to vote.
30 Apr 2013Jyothikarthik_N
The woes of a maintenance developer.
Please Sign up or sign in to vote.
2 Feb 2012Ido Flatow
Creating customized standard endpoints in WCF 4
Please Sign up or sign in to vote.
14 Feb 2012Paladin2000
A small archiving utility
Please Sign up or sign in to vote.
17 Feb 2012josh.rendon
That conclusion is definitely wrong. Your equation expanded equals: b = (a+b) - (a-b) = a+b - a + b = 2*bFor your example a=20, b=10b = (20+10) - (20-10) = (30) - (10) = 20b = 20 + 10 - 20 + 10 = 20A counter example to disprove this: a=75, b=88b = (75+88) - (75-88) =...
Please Sign up or sign in to vote.
5 Aug 2012Neeraj Kaushik1980
Retrieve MarketPrice from FixServer using QuickFix (FIX)
Please Sign up or sign in to vote.
8 Aug 2012Nicolas Humann
Include static JS / CSS / image files from IsolatedStorage in the WebBrowser control
Please Sign up or sign in to vote.
2 Aug 2012Ilya Builuk
The article describes how to bring the Aspect-Oriented programming practices to the WP7 platform
Please Sign up or sign in to vote.
24 Feb 2012Giorgi Dalakishvili
This is the first part of a series about writing an expression evaluator in C#.
Please Sign up or sign in to vote.
1 Feb 2012Dean Oliver
My alternative is to rather use a tried and tested compression api. It's simpler to use and you don't have to spend time developing helper methods to zip and unzip files.http://dotnetzip.codeplex.com/[^]Create a zip file using (ZipFile zip = new ZipFile()) { ...
Please Sign up or sign in to vote.
1 Feb 2012Huisheng Chen
Have a look this one, I just wrote: Accurate way to tell if an assembly is compiled in debug or release mode in c#[^] public static bool IsInDebugMode(string FileName) { var assembly = System.Reflection.Assembly.LoadFile(FileName); var attributes =...
Please Sign up or sign in to vote.
8 Feb 2012Pascal Ganaye
Reproducing the SQL RAND() function in C#
Please Sign up or sign in to vote.
3 Feb 2012jim lahey
While it's a good idea to provide more readable enum values, I'm not keen on this solution because it uses hard-coded values and isn't localizable.Please see my alternative tip on using extension methods and resource files to bind localized strings to enum values:Enum Display Extension[^]
Please Sign up or sign in to vote.
3 Feb 2012Petr Ivankov
Audio support for grandiose projects
Please Sign up or sign in to vote.
3 Feb 2012SoftwareMonkeys
While I think alternative 3 could be quite useful I often have access to the assembly name and not the actual file name.For example the assembly name might be:Company.ProductWhereas the file name might be:Company.Product.dllThere are times when I'll fully qualify a class such...
Please Sign up or sign in to vote.
9 Feb 2012Winstan
MVC3 webgrid does not return rows collection, here is a tip to get several objects selected
Please Sign up or sign in to vote.
11 Feb 2012Bruno Tabbia
The basic binary operations (AND, OR, XOR, NOT, ShiftLeft, ShiftRight) applied to byte arrays, made faster thanks to the use of parallelism combined with the use of pointers.
Please Sign up or sign in to vote.
16 Feb 2012Ryan Samiee
Open MVC PLUS ENTITY FRAMEWORK + XML DB FOR WebLight Components for MVC.NET 3.0
Please Sign up or sign in to vote.
15 Feb 2012Andreas Gieriet
I think the following Regex and HtmlDecode would do:string html = ...;string textonly = HttpUtility.HtmlDecode( Regex.Replace(html, @"|", ""));Any HTML construct that would not be stripped off properly by this?
Please Sign up or sign in to vote.
18 Feb 2012Sajid Asghar
How to insert Data in SQL server via SqlDataSource in ASP.NET
Please Sign up or sign in to vote.
16 Feb 2012Dr. Sai
This article demonstrates how to code the Carousel animation effect in Silverlight
Please Sign up or sign in to vote.
17 Feb 2012cigwork
Outlines the construction of a simple data dictionary utility for MS-SQL using extended properties.
Please Sign up or sign in to vote.
19 Feb 2012qenn
Gravatar Avatars in C# for .NET
Please Sign up or sign in to vote.
20 Feb 2012Andreas Gieriet
How about transforming first into a Regex and then letting the Regex do the work? E.g.:public static Regex GetRegex(string wildcard){ string pattern = Regex.Replace(wildcard, @"([^?*]+)?([?*])?", m => Regex.Escape(m.Groups[1].Value) +...
Please Sign up or sign in to vote.
21 Feb 2012Sarvesh Kumar Gupta
Export to Excel from GridView in C#
Please Sign up or sign in to vote.
27 Feb 2012Rishikesh_Singh 1 alternative  
Filtering records from List similar to Sql IN Operator using LINQ
Please Sign up or sign in to vote.
27 Feb 2012Sebastian Solnica
I wrote a simple extension for the MDbg debugger that adds a watch-trace (wt) command to its shell, allowing you to display and customize the method call trees. In this post, I’m going to show you how this extension was built and how it can be used.
Please Sign up or sign in to vote.
27 Feb 2012Ondrej_Uzovic
Simple example showing the communication between Silverlight client and Java application.
Please Sign up or sign in to vote.
3 Feb 2012Member 147785
Hello!Here is a small article - Show progress on long-running operations, which describes approach to keep the UI responsive, starting long-running operations in separate thread. This approach is native and without any 3d-party libraries and even without BackgroundWorker.For example, the...
Please Sign up or sign in to vote.
10 Feb 2012clbyrne
I did something similar with a PageToken class, but I put it in the Master Page so that I could implement it on any page that uses the Master Page. In our code we wrapped the session variables in their own class called Session variables.We needed a little more functionality for complex pages...
Please Sign up or sign in to vote.
20 Feb 2012PIEBALDconsult
This is much simpler: fewer new strings created, no recursion. And it allows the caller to specify how to do a string comparison.public static boolWildcardMatch( this string Subject, string Pattern, System.StringComparison...

Current Participants

Those with articles that match the contest criteria are automatically entered.

Software Developer (Senior) ALFA
Iran (Islamic Republic of) Iran (Islamic Republic of)
loving and living as a programmer
Founder eXternSoft GmbH
Switzerland Switzerland
I feel comfortable on a variety of systems (UNIX, Windows, cross-compiled embedded systems, etc.) in a variety of languages, environments, and tools.
I have a particular affinity to computer language analysis, testing, as well as quality management.

More information about what I do for a living can be found at my LinkedIn Profile and on my company's web page (German only).
Architect
India India
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#
United Kingdom United Kingdom
Jack of all trades.
Software Developer (Senior)
Switzerland Switzerland
C#, SQL (and in the past also: C++, C, VBA)
United Kingdom United Kingdom
Nothing interesting to report.
Software Developer Florida Department of Education
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer BBD Johannesburg
South Africa South Africa
Bsc (Hons) Business Information Systems.
MCTS: Web Applications Development with Microsoft .NET Framework 4
MCTS: Windows Communication Foundation Development with Microsoft .NET Framework 4
MCTS: Accessing Data with Microsoft .NET Framework 4
Microsoft Certified Professional Developer Certification.
Web Developer
India India
I have a PhD in pure mathematics from HCU. I have been programming in Microsoft technologies for more than a decade. My interests are C#, WPF Silverlight, MFC, COM.
United States United States
I am an Electrical Engineer. I play with stuff (hardware, software, graphics, documentation).
Software Developer
Argentina Argentina
System developer from Argentina.

Programmed in VB 5,6,.NET, C#, Java, PL-SQL, Transac-SQL, C, C++ and even some "calculator" language.

Love to build small, useful applications.
Usually building big and complicated apps based on solid, reliable components.

Hobbies: reading, photography, chess, paddle, running.
Software Developer
Georgia Georgia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Consultant
San Marino San Marino
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer
Sweden Sweden
Henrik Jonsson is a Microsoft Professional Certified Windows Developer (MCPD) that currently works as an IT consultant in Västerås, Sweden.

Henrik has worked in several small and large software development projects in various roles such as architect, developer, CM and tester.

He regularly reads The Code Project articles to keep updated about .NET development and get new ideas. He has contributed with articles presenting some useful libraries for Undo/Redo, Dynamic Linq Sorting and a Silverlight 5 MultiBinding solution.
Product Manager www.xnlab.com
Australia Australia
I was born in the south of China, started to write GWBASIC code since 1993 when I was 13 years old, with professional .net(c#) and vb, founder of www.xnlab.com

Now I am living in Sydney, Australia.
Architect Sela Group
Israel Israel
Web developer since 1997. I'm a senior architect at Sela Group in Israel. I'm a consultant, trainer (Microsoft MCT), and a speaker in conferences worldwide.
My main fields are WCF, ASP.NET, Windows Azure, IIS, Entity Framework, and Silverlight.
Software Developer (Senior) Nokia
Germany Germany
Interested in design/development of framework functionality using the best patterns and practices.
Software Developer (Senior)
United States United States
I enjoy and take seriously the craft of programming, and I improve upon my skills daily. Start day: coffee is always a good idea!
Software Developer (Senior)
United Kingdom United Kingdom
First batch file in 1987

Messed around with the Bullfrog C++ Libraries for Syndicate in 1994

Web Developer since 2000

.net Developer since 2001

MCTS: Microsoft® .NET Framework 2.0 - Web-based Client Development

MCTS: Web Applications Development with Microsoft .NET Framework 4
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Technical Lead
United States United States
Engineer.
CEO Astrani Technology Solutions
United States United States
Kishore Babu Gaddam is a Senior Technology Consultant, Technology Evangelist turned Technology Entrepreneur and a regular speaker at national conferences, regional code camps and local user groups with over 14 years of experience in software product development. His experience includes building & managing award-winning software development teams, managing customer relationships, marketing and launching new software products & services. Kishore launched his technology career almost 15 years ago with a Robotics software development startup and has served in multiple roles since including developer, innovation leader, consultant, technology executive and business owner.

A technology specialist in C++, C#, XAML and Azure, he successfully published two applications to Windows store http://bit.ly/WinStoreApp and http://bit.ly/FlagsApp.

Kishore is the author of the popular Microsoft Technologies blog at http://www.kishore1021.wordpress.com/ and his work on Portable Class Library project in Visual Studio 2012– .NET 4.5 was featured on Channel 9 at http://bit.ly/msdnchannel9. Kishore enjoys helping people understand technical concepts that may initially seem complex and perform lot of Research & Development on emerging technologies to help solve some of the toughest customer issues. Kishore spends a lot of time teaching and mentoring developers to learn new technologies and to be better developers. He is a speaker at various code camps around Washington DC area, mainly at Microsoft Technology Center for NOVA code camp (http://bit.ly/novacc12), CMAP Code Camp Fall 2012 (http://bit.ly/novacc12), etc. The majority of his software development experience has centered on Microsoft technologies including MFC, COM, COM+, WCF, WPF, winRT, HTML5, RestAPI and SQL Server. You can follow Kishore on Twitter at www.twitter.com/kishore1021. He can be reached on email at researcherkishore@outlook.com
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Architect Saxo Bank A/S
Denmark Denmark
• Solution Architect /Principle Lead Developer with 12 years of IT experience with more emphasize on Capital Domain and Investment banking domain.
• Strong experience in Continuous Integration, Delivery and DevOps solutions.
• Strong experience in drafting solutions, stakeholder communications and risk management.
• Proved strong coding and designing skills with agile approaches (TDD, XP framework, Pair Programming).
• Delivered many projects with involvement from inception to delivery phase.
• Strong experience in high performance, multithreaded, low latency applications.
• Ability to communicate with the business and technical stake holders effectively.
• Have extensive experience in Capital Market Domain: Front Office & BackOffice (Algorithm Trading tools, messaging framework, Enterprise bus, integration of FIX APIs and many trading APIs).
• Functional knowledge of Portfolio/Wealth Management, Equities, Fixed Income, Derivatives, Forex.
• Practical knowledge of building and practicing agile delivery methodologies (SCRUM, TDD, Kanban).

Technical Skills

• Architectural: Solution Design, Architectural Presentations (Logical, Component, Physical, UML diagrams)
• Languages: C#, C++
• Server Technologies: WCF, Web API,
• Middle Ware: ActiveMQ, RabbitMQ, Enterprise Service Bus
• UI Technologies: Winforms and WPF
• Web Technologies: Asp.Net Mvc, KnockOutJS, JQuery, Advance Java Scripts Concepts
• Databases: Sql Server 2008 +, MySQL
• Tools/Frameworks: TFS, SVN, NUnit, Rhino Mocks, Unity, NAnt, QuickFix/n, Nhibernate, LINQ, JIRA,

Functional Skills

• Wealth Management System, Trade Life Cycle, Trading Components and their integrations
• Working knowledge of Stocks, Bonds, CFDs,Forex, Futures and Options
• Pricing Systems, Market Data Management,
• BackOffice Processes : Settlement Processes, Netting, Tax, Commissions, Corporate Actions Handling,
• Reporting Solutions : OLTP and OLAP Data model designing
• FIX Engine implementation and integration
Technical Lead
France France
Specialized in .net technologies for many years, I am a technology fan in both asp.net and wpf/silverlight, using c# and .NET 4.
Architect
Slovakia Slovakia
My programming path started in 1987 when I got my first computer Sharp MZ-800.
It came with 8 bit CPU Z80, 64Kb RAM and the tape recorder. It was a great machine. I think I still have it somewhere.
I was fascinated and I started to write first programs. Eventually I became developer and software architect. I like innovations and clean nice solutions.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior)
France France
I am a French programmer.
These days I spend most of my time with the .NET framework, JavaScript and html.
Software Developer (Senior) Microsoft
United States United States
I started to program computers when I was 11 years old, as a hobbyist, programming in AMOS Basic and Blitz Basic for Amiga.
At 12 I had my first try with assembler, but it was too difficult at the time. Then, in the same year, I learned C and, after learning C, I was finally able to learn assembler (for Motorola 680x0).
Not sure, but probably between 12 and 13, I started to learn C++. I always programmed "in an object oriented way", but using function pointers instead of virtual methods.

At 15 I started to learn Pascal at school and to use Delphi. At 16 I started my first internship (using Delphi). At 18 I started to work professionally using C++ and since then I've developed my programming skills as a professional developer in C++ and C#, generally creating libraries that help other developers do their work easier, faster and with less errors.

Want more info or simply want to contact me?
Take a look at: http://paulozemek.azurewebsites.net/
Or e-mail me at: paulozemek@outlook.com

Codeproject MVP 2012, 2015 & 2016
Microsoft MVP 2013-2014 (in October 2014 I started working at Microsoft, so I can't be a Microsoft MVP anymore).
Architect
Russian Federation Russian Federation
Ph. D. Petr Ivankov worked as scientific researcher at Russian Mission Control Centre since 1978 up to 2000. Now he is engaged by Aviation training simulators http://dinamika-avia.com/ . His additional interests are:

1) Noncommutative geometry

http://front.math.ucdavis.edu/author/P.Ivankov

2) Literary work (Russian only)

http://zhurnal.lib.ru/editors/3/3d_m/

3) Scientific articles
http://arxiv.org/find/all/1/au:+Ivankov_Petr/0/1/0/all/0/1
Software Developer (Senior)
United States United States
BSCS 1992 Wentworth Institute of Technology

Originally from the Boston (MA) area. Lived in SoCal for a while. Now in the Phoenix (AZ) area.

OpenVMS enthusiast, ISO 8601 evangelist, photographer, opinionated SOB, acknowledged pedant and contrarian

---------------

"I would be looking for better tekkies, too. Yours are broken." -- Paul Pedant

"Using fewer technologies is better than using more." -- Rico Mariani

"Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?’" -- Steve McConnell

"Every time you write a comment, you should grimace and feel the failure of your ability of expression." -- Unknown

"If you need help knowing what to think, let me know and I'll tell you." -- Jeffrey Snover [MSFT]

"Typing is no substitute for thinking." -- R.W. Hamming

"I find it appalling that you can become a programmer with less training than it takes to become a plumber." -- Bjarne Stroustrup

ZagNut’s Law: Arrogance is inversely proportional to ability.

"Well blow me sideways with a plastic marionette. I've just learned something new - and if I could award you a 100 for that post I would. Way to go you keyboard lovegod you." -- Pete O'Hanlon

"linq'ish" sounds like "inept" in German -- Andreas Gieriet

"Things would be different if I ran the zoo." -- Dr. Seuss

"Wrong is evil, and it must be defeated." –- Jeff Ello

"A good designer must rely on experience, on precise, logical thinking, and on pedantic exactness." -- Nigel Shaw

“It’s always easier to do it the hard way.” -- Blackhart

“If Unix wasn’t so bad that you can’t give it away, Bill Gates would never have succeeded in selling Windows.” -- Blackhart

"Use vertical and horizontal whitespace generously. Generally, all binary operators except '.' and '->' should be separated from their operands by blanks."

"Omit needless local variables." -- Strunk... had he taught programming
Engineer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Technical Lead
New Zealand New Zealand
http://nz.linkedin.com/in/macaalay
http://macaalay.com/
Technical Lead Microlise
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Belgium Belgium
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer
Romania Romania
I have been a software developer for a while and still find this an interesting job.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior) Edge Business Solution
India India
Working in Edge Business Solution as a Senior Software Developer. I have more than 7 years exp. in Microsoft Technologies. I have exp. in ASP.Net, C#, SQL 2000/2005/2008 R2, Javascript, Ajax, JQuery, MVC, LINQ etc.
Software Developer (Senior)
Poland Poland
Interested in tracing, debugging and performance tuning of the .NET applications.

My twitter: @lowleveldesign
My website: http://www.lowleveldesign.org
SoftwareMonkeys
Australia Australia
Founder of www.softwaremonkeys.net
Architect
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Kenya Kenya
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior) 3PLearning
Australia Australia
Lead Developer, MMO Game Company
Testor, Microsoft
You must sign in to participate in this contest.
This contest has ended.
1 Feb - 29 Feb 2012