Click here to Skip to main content
14,271,759 members

Best C# article of February 2012

This competition has ended

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.

13 Feb 2012
StevenLJackson1
How you can structure your solution and project files in Visual Studio to make updating your assemblies' version number much easier
21 May 2012
Zimin Max Yang
Dynamic table mapping for LINQ-to-SQL, suitable for data horizontal partitioning (Shard).
9 Mar 2012
Barry Lapthorn
A XAML-only font combobox.
8 Aug 2012
Tyler 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.
22 Feb 2012
Anoop 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
4 Feb 2012
Huisheng Chen
Using reflection to dynamically verify if an assembly is in debug or release compilation
7 Feb 2012
ErnestoNet
User Control with scrolling and zooming done in C++/CLI
13 Feb 2012
kishore 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.
10 Aug 2012
Ali Javani
A Windows service that blocks any unwanted services
22 May 2012
Henrik 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.
2 Feb 2012
Dean Oliver
How we can harness the power of MEF and extend it by way of generics.
22 Feb 2012
jeff00seattle
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).
3 Feb 2012
Dr. Sai
Pixel Manipulation in Silverlight
10 Aug 2012
dreamgarden
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.).
4 Feb 2012
giulicard
You can also derive the user-defined node class from IComparable then add to it the CompareTo method.
18 Feb 2012
GregEllis
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;
20 Feb 2012
ZC123456
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...
24 Feb 2012
Raymund Macaalay
Export multiple DataSets to multiple Excel sheets dynamically formatted according to the record's data type
28 Feb 2012
Paulo Zemek
This article presents classes to build new types at run-time without requiring users to understand IL instructions.
23 Feb 2012
rzvdaniel
Small utility to keep localized resources synchronized
30 Apr 2013
Jyothikarthik_N
The woes of a maintenance developer.
2 Feb 2012
Ido Flatow
Creating customized standard endpoints in WCF 4
14 Feb 2012
Paladin2000
A small archiving utility
17 Feb 2012
josh.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) =...
5 Aug 2012
Neeraj Kaushik1980
Retrieve MarketPrice from FixServer using QuickFix (FIX)
8 Aug 2012
Nicolas Humann
Include static JS / CSS / image files from IsolatedStorage in the WebBrowser control
2 Aug 2012
Ilya Builuk
The article describes how to bring the Aspect-Oriented programming practices to the WP7 platform
24 Feb 2012
Giorgi Dalakishvili
This is the first part of a series about writing an expression evaluator in C#.
1 Feb 2012
Dean 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()) { ...
1 Feb 2012
Huisheng 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 =...
8 Feb 2012
Pascal Ganaye
Reproducing the SQL RAND() function in C#
3 Feb 2012
jim 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[^]
3 Feb 2012
Petr Ivankov
Audio support for grandiose projects
3 Feb 2012
SoftwareMonkeys
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...
9 Feb 2012
Winstan
MVC3 webgrid does not return rows collection, here is a tip to get several objects selected
11 Feb 2012
Bruno 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.
16 Feb 2012
Ryan Samiee
Open MVC PLUS ENTITY FRAMEWORK + XML DB FOR WebLight Components for MVC.NET 3.0
16 Feb 2012
Andreas 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?
18 Feb 2012
Sajid Asghar
How to insert Data in SQL server via SqlDataSource in ASP.NET
16 Feb 2012
Dr. Sai
This article demonstrates how to code the Carousel animation effect in Silverlight
17 Feb 2012
cigwork
Outlines the construction of a simple data dictionary utility for MS-SQL using extended properties.
19 Feb 2012
qenn
Gravatar Avatars in C# for .NET
21 Feb 2012
Andreas 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) +...
21 Feb 2012
Sarvesh Kumar Gupta
Export to Excel from GridView in C#
27 Feb 2012
Rishikesh_Singh
1 alternative  
Filtering records from List similar to Sql IN Operator using LINQ
27 Feb 2012
Sebastian 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.
27 Feb 2012
Ondrej_Uzovic
Simple example showing the communication between Silverlight client and Java application.
3 Feb 2012
Member 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...
10 Feb 2012
clbyrne
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...
20 Feb 2012
PIEBALDconsult
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.

Ali Javani
Software Developer (Senior) ALFA
Iran (Islamic Republic of) Iran (Islamic Republic of)
loving and living as a programmer
Andreas Gieriet
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).
Anoop Pillai
Architect
India India
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#
Barry Lapthorn
United Kingdom United Kingdom
Jack of all trades.
Bruno Tabbia
Software Developer
Switzerland Switzerland
c#, Silverlight, C++, c, VBA, SQL, Oracle
cigwork
United Kingdom United Kingdom
Nothing interesting to report.
clbyrne
Software Developer Florida Department of Education
United States United States
No Biography provided
Dean Oliver
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.
Dr. Sai
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.
dreamgarden
United States United States
I am an Electrical Engineer. I play with stuff (hardware, software, graphics, documentation).
ErnestoNet
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.
Giorgi Dalakishvili
Software Developer
Georgia Georgia
No Biography provided
giulicard
San Marino San Marino
No Biography provided
GregEllis
United States United States
No Biography provided
Henrik Jonsson
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.
Huisheng Chen
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.
Ido Flatow
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.
Ilya Builuk
Software Developer (Senior) Nokia
Germany Germany
Interested in design/development of framework functionality using the best patterns and practices.
jeff00seattle
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!
jim lahey
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
josh.rendon
United States United States
No Biography provided
Jyothikarthik_N
Technical Lead
United States United States
Engineer.
kishore Gaddam
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
Member 147785
Russian Federation Russian Federation
No Biography provided
Neeraj Kaushik1980
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
Nicolas Humann
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.
Ondrej_Uzovic
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.
Paladin2000
United States United States
No Biography provided
Pascal Ganaye
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.
Paulo Zemek
Software Developer (Senior) Niantic
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).
Petr Ivankov
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
PIEBALDconsult
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

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

"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
qenn
Engineer
United States United States
No Biography provided
Raymund Macaalay
Technical Lead
New Zealand New Zealand
http://nz.linkedin.com/in/macaalay
http://macaalay.com/
Rishikesh_Singh
Technical Lead Microlise
India India
No Biography provided
Ryan Samiee
Belgium Belgium
No Biography provided
rzvdaniel
Software Developer
Romania Romania
I have been a software developer for a while and still find this an interesting job.
Sajid Asghar
United States United States
No Biography provided
Sarvesh Kumar Gupta
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.
Sebastian Solnica
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
SoftwareMonkeys
Australia Australia
Founder of www.softwaremonkeys.net
StevenLJackson1
Architect
United States United States
No Biography provided
Tyler Forsythe
Software Developer (Senior)
United States United States
No Biography provided
Winstan
Kenya Kenya
No Biography provided
ZC123456
United States United States
No Biography provided
Zimin Max Yang
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