Click here to Skip to main content
16,019,768 members
This competition has ended

Best C# article of May 2011

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.
10 May 2011D. Christian Ohle
C# scripts using DynamicMethod
Please Sign up or sign in to vote.
15 May 2011Ondrej_Uzovic
A simple example showing how to implement a service listening to TCP, HTTP and Named Pipe at the same time.
Please Sign up or sign in to vote.
30 May 2011Ian Good
A possibly simpler version of this is to create an extension method for strings:public static class MyExtensions{ public static TEnum ParseEnum(this string value, bool ignoreCase = false) where TEnum : struct { TEnum tenumResult; ...
Please Sign up or sign in to vote.
19 May 2011Aron Weiler
Like the title says... a simple (very simple) page transition control for WPF
Please Sign up or sign in to vote.
27 May 2011dzCepheus
You can limit the scope of 'p' inside your function:private void Whatever() { DoStuffHere(); // 'p' is not in scope. { var p = this.StatusProgressBar; // 'p' is in scope. p.IsIndeterminate = false; p.[etc] } // 'p' is not in...
Please Sign up or sign in to vote.
16 May 2011Kanasz Robert
In this tip I will show, how to scroll two listbox objects together
Please Sign up or sign in to vote.
18 May 2011Colin Eberhardt
This blog post describes the implementation of a metro ’tilt’ effect for Windows Phone 7 which causes element to respond to user interactions by tilting in 3D.
Please Sign up or sign in to vote.
17 May 2011Colin Eberhardt
This blog post describes a Windows Phone 7 NavigationList control, a list control designed for navigation pages. The NavigationList renders twice as fast as a ListBox and has a slightly simpler API.
Please Sign up or sign in to vote.
1 May 2011Ernest Poletaev
A Localized WPF Application template for easily localizing a WPF application
Please Sign up or sign in to vote.
7 May 2011MBigglesworth79
Event Handling
Please Sign up or sign in to vote.
11 May 2011Andrew Rissing
Three improvement ideas:-Add check to ensure the enum is a [Flags] enum.-Make the method generic and static with the enum type generic. I don't know how common it would be to have the type already on hand. It makes it simpler to use.-Iterate over all of the values and bit-wise or them...
Please Sign up or sign in to vote.
15 May 2011ambarishtv
dynamic keyword - Represents an object whose operations will be resolved at runtime
Please Sign up or sign in to vote.
17 May 2011Kunal Chowdhury «IN»
Are you aware of the Line Stacking Strategy of Silverlight TextBlock control? If not, this post will help you to understand it and after that you will be able to use it whenever required.
Please Sign up or sign in to vote.
22 May 2011Mohammad A Rahman 2 alternatives  
Please Sign up or sign in to vote.
4 May 2011Philip Laureano
Intercepting Console.WriteLine and Other Third-Party Method Calls with LinFu.AOP 2.0
Please Sign up or sign in to vote.
10 May 2011#realJSOP 6 alternatives  
See if an integer value is a valid value for the given "flags" enumerator
Please Sign up or sign in to vote.
22 May 2011Jeremy Hutchinson
Or you can use T4 to generate a static class wrapper around the service. Then your call can look like this:SvcWrapper.Login(username, password);The full explanation and sample code is located here[^].
Please Sign up or sign in to vote.
20 May 2011Koder Hack
The ContentTicker control is a generic control that can be used to slide content.
Please Sign up or sign in to vote.
25 May 2011MBigglesworth79
The DynamicDataReader provides a means of retrieving data from a database in a way that involves less code and increases code readability.
Please Sign up or sign in to vote.
27 May 2011jgauffin
This post is all about LSP.
Please Sign up or sign in to vote.
4 May 2011NeverJustHere
I hate to be overly critical, but variable names of flag1 and flag2 are poor choices. Use a name that tells the reader what it actually represents (e.g FoundData). Perhaps better naming options would help you see that flag2 will never be anything other than True, and is completely unnecessary....
Please Sign up or sign in to vote.
4 May 2011Philip Laureano
How to create types that can change at runtime
Please Sign up or sign in to vote.
7 May 2011zQuangHoangz
I think it has error, for example:A user is:string userId = "OriginalGriff"; string password = "NotMyPassword";And other user is:string userId = "Original"; string password = "GriffNotMyPassword";Problem to store two user.My idea is:private static...
Please Sign up or sign in to vote.
10 May 2011Christoph Keller
A simple element with big lists
Please Sign up or sign in to vote.
11 May 2011Luc Pattyn
This is an alternative to "See If a Flags Enum is Valid".
Please Sign up or sign in to vote.
12 May 2011DrABELL
Hello Steven,As FYI: recently I have published on CodeProject a short article (tip) on rather efficient implementation of GCD/LCM based on Euclid algorithm. They use iteration instead of recursion, because re-cursive algorithms in general and in this particular case are relatively...
Please Sign up or sign in to vote.
12 May 2011rudigrobler
When your application gets tombstoned, you get an opportunity to save some state about your application. What should be saved, where to save it, and when?
Please Sign up or sign in to vote.
18 May 2011Colin Eberhardt
In this blog post, I look at how to implement the fly-out fly-in effect seen in native Windows Phone 7 applications. This effect is seen in the native mail application; when you click on a message, the title flies out of the list then flies back in as the title of the message page.
Please Sign up or sign in to vote.
18 May 2011Colin Eberhardt
How to implement the animated 'peel' effect seen when native Windows Phone 7 applications exit
Please Sign up or sign in to vote.
17 May 2011Colin Eberhardt
This blog post presents an attached behaviour that gracefully slides the contents of a list into view when used in conjunction with a Pivot control, emulating the Windows Phone 7 email application.
Please Sign up or sign in to vote.
24 May 2011Aron Weiler
Performance tests between multiple "multi-key" Dictionary implementations
Please Sign up or sign in to vote.
27 May 2011ambilykk
ASP.NET MVC3 Controller with Entity Framework CodeFirst
Please Sign up or sign in to vote.
31 May 2011MBigglesworth79
How to create a dynamic version of another staple component of the ADO.NET framework, namely the DataSet.
Please Sign up or sign in to vote.
2 May 2011Martin Jarvis
Base26 Number Encoding/Generate Excel Columns
Please Sign up or sign in to vote.
4 May 2011Philip Laureano
LinFu.DynamicObject is flexible enough that it can let you build object instances at runtime and then 'strongly' duck type those object instances to any interface that matches the intended duck type.
Please Sign up or sign in to vote.
8 May 2011philm_be
Hello,You loop through all the rows, even when you know that the column will be visible (i.e., when the first non-empty cell is found), resulting in time loss and lots of unneeded variable assigments.A second remark is that a hidden column will never be shown later, even if some data is...
Please Sign up or sign in to vote.
12 May 2011ozkary
The WebClient class can be extended to support cookies by overriding the GetWebRequest method and implementing a CookieContainer.
13 May 2011Resco Developer Tools
The article presents Resco MobileForms Toolkit, Android Edition. Besides the brief characteristics of the included components special attention is devoted to the writing of LOB applications using master-detail concept.
Please Sign up or sign in to vote.
16 May 2011YvesDaoust
// A faster solutionreturn (value & mask) == 0;// Where mask == ~ (None | One | Eight)// This constant can be precomputed at compile-time or run-time (like in Alternate 1)
Please Sign up or sign in to vote.
17 May 2011FDW
What about a more complete approach?Define a few caches:private static GenericAlias.Dictionary aoCompositeValues = new GenericAlias.Dictionary();private static GenericAlias.Dictionary aoArrayOfValues = new GenericAlias.Dictionary
Please Sign up or sign in to vote.
17 May 2011Richard Deeming
You can use System.Linq.Expressions to avoid converting the Enum value to an integer type.Here's a solution inspired by the MiscUtil project[^]:using System;using System.Collections.Generic;using System.Linq;using System.Linq.Expressions; public static class...
Please Sign up or sign in to vote.
20 May 2011Aron Weiler
A standard in-memory generic .NET queue that, when the configurable overflow limit is reached, will start using MSMQ as a backend to mitigate the issues with memory usage
Please Sign up or sign in to vote.
20 May 2011ozkary
A useful tip when designing your WCF Service operations.
Please Sign up or sign in to vote.
31 May 2011Yogesh M Joshi
Following project enables users to get Tag suggestions for the uploaded Documents in SharePoint 2010 libraries. Also it helps in bulk tagging in case of migration of large content
Please Sign up or sign in to vote.
24 May 2011PeteBarber
Evolution of C# enumerators
Please Sign up or sign in to vote.
22 May 2011Ondrej_Uzovic
A simple example showing how to implement the communication where the client application can start to communicate before the service application is running.
Please Sign up or sign in to vote.
30 May 2011Beavis Killer
Details on how to use OneClick publishing in VS2010 to build and publish across domains using FTP or FTP with SSL.
Please Sign up or sign in to vote.
15 Jun 2011MBigglesworth79
How to use anonymous methods and lambdas to make our code more terse by reducing the amount of code we need to write.
Please Sign up or sign in to vote.
16 Apr 2012Sergey Alexandrovich Kryukov
No more long switch statements!

Current Participants

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

Software Developer (Senior) Paddedwall Software
United States United States
I've been paid as a programmer since 1982 with experience in Pascal, and C++ (both self-taught), and began writing Windows programs in 1991 using Visual C++ and MFC. In the 2nd half of 2007, I started writing C# Windows Forms and ASP.Net applications, and have since done WPF, Silverlight, WCF, web services, and Windows services.

My weakest point is that my moments of clarity are too brief to hold a meaningful conversation that requires more than 30 seconds to complete. Thankfully, grunts of agreement are all that is required to conduct most discussions without committing to any particular belief system.
Technical Lead
India India

Kunal Chowdhury is a former Microsoft "Windows Platform Development" MVP (Most Valuable Professional, 2010 - 2018), a Codeproject Mentor, Speaker in various Microsoft events, Author, passionate Blogger and a Senior Technical Lead by profession.

He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows app development. He posts his findings, articles, tutorials in his technical blog (www.kunal-chowdhury.com) and CodeProject.


Books authored:


Connect with Kunal on:




Software Developer
India India



Hi I' Ambarish from India. I've three and half year of experience in application
development solutions.
Educational Qualification MCA -  from KristuJyoti College of management and technology (MG
University)

B.Sc (Physics) - from NSS College, Changanacherry (MG University)
Skill Set C#,winforms,asp.net,MVC 3, Java,Design Patterns,VB, Android,JQuery Mobile,SQL,MySqlUML.


Architect TCS
India India
I have over 10 years of experience working on Microsoft Technologies. I am carrying the passion on Microsoft technologies specifically on web technologies such as ASP.Net, HTML5, jQuery and Ajax. My interests also include TFS, Azure, Windows 8, Visual Studio 2010. Technology adoption and learning is my key strength and technology sharing is my passion.

Microsoft MVP: Connected Service Developer
Architect
United States United States
Since I've begun my profession as a software developer, I've learned one important fact - change is inevitable. Requirements change, code changes, and life changes.

So..If you're not moving forward, you're moving backwards.
Architect
United States United States
Check out my technical blog here: The Fyslexic Duck. You can find most of what I've put on CodeProject there, plus some additional technical articles.
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer
Switzerland Switzerland
I'm a software developer with ASP.NET experience since 2007

Projects:
=========
See my projects list here: http://dotnetcorner.ch/Home/Projects

=========
More about me: http://dotnetcorner.ch
My Blog: http://dotnetcorner.ch/Home/Blog
Architect Scott Logic
United Kingdom United Kingdom
I am CTO at ShinobiControls, a team of iOS developers who are carefully crafting iOS charts, grids and controls for making your applications awesome.

I am a Technical Architect for Visiblox which have developed the world's fastest WPF / Silverlight and WP7 charts.

I am also a Technical Evangelist at Scott Logic, a provider of bespoke financial software and consultancy for the retail and investment banking, stockbroking, asset management and hedge fund communities.

Visit my blog - Colin Eberhardt's Adventures in .NET.

Follow me on Twitter - @ColinEberhardt

-
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Engineer
United States United States
Dr. Alexander Bell (aka DrABell), a seasoned full-stack DevOps and Data Engineer holds PhD in Electrical and Computer Engineering, authored 37 inventions and published 100+ technical articles, including those popular at CodeProject totaling 4M+ views. Alex pioneered AI/NLP, Cloud development, .NET/Java technology stacks, advanced SQL extensions, HTML5/CSS3 and other important Web technologies; developed multiple award-winning Web/Win apps submitted to App Innovation Contests (AIC 2012/2013). Currently focused on Microsoft Azure Cloud and GitHub Copilot AI-enabled DevOps.

  1. Quiz Engine powered by Azure Cloud (Dev Challenge article)
  2. 'enRoute': Real-time NY City Bus Tracking Web App (IoT on Azure)
  3. Azure web app: Engineering Calculator VOLTMATTER
  4. Azure: NYC real-time bus tracking app
  5. HTML5/CSS3 graphic enhancement: buttons, inputs
  6. Aggregate Product function extends SQL
  7. HTML5 Tables Formatting: Alternate Rows, Color Gradients, Shadows
  8. YouTube™ API for ASP.NET
Web Developer
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) i-BLADES
Thailand Thailand
I'm Android and Full Stack Software Engineer. 28 years in software industry, lots of finished projects. I’m never afraid of learning something new and you can see it by amount of skills in my resume.

I'm working remotely since 2009, self-motivated and self-organized.

There are no impossible projects. I have experience with Android, iOS, Web, Desktop, Embedded applications, VR, AR, XR, Computer vision, Neural networks, Games, IoT, you name it.
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
FDW
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior) Undead Labs
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
United States United States
I’m a Software Engineer at Microsoft working on the Azure Portal. Before that I spent about 20 years developed various business applications at a number of different companies. I have a passion for writing clean, scalable code and sharing what I’ve learned with others.

I also help run the Casco Bay .Net User Group
Founder 1TCompany AB
Sweden Sweden
Architect Marwin Cassovia Soft
Slovakia Slovakia
My name is Robert Kanasz and I have been working with ASP.NET, WinForms and C# for several years.
MCSD - Web Applications
MCSE - Data Platform
MCPD - ASP.NET Developer 3.5
- Web Developer 4
MCITP - Database Administrator 2008
- Database Developer 2008
MCSA - SQL Server 2012
MCTS - .NET Framework 3.5, ASP.NET Applications
- SQL Server 2008, Database Development
- SQL Server 2008, Implementation and Maintenance
- .NET Framework 4, Data Access
- .NET Framework 4, Service Communication Applications
- .NET Framework 4, Web Applications
MS - Programming in HTML5 with JavaScript and CSS3 Specialist

Open source projects: DBScripter - Library for scripting SQL Server database objects


Please, do not forget vote
Software Developer TRG Tech
Pakistan Pakistan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior)
Belgium Belgium
I am an engineer with a background in electronics, software and mathematics.

I develop technical software, both for embedded systems and for desktop equipment. This includes operating systems, communication software, local networks, image processing, machine control, automation, etc.

I have been using all kinds of microcontrollers and microprocessors (Intel 4004/8080/8051/80386/Pentium, Motorola 680x/680x0/ColdFire/PowerPC, Microchip PIC, Altera NIOS, and many more), lots of programming languages (all relevant assemblers, Fortran, Basic, C, Java, C#, and many more), and different operating systems (both proprietary and commercial).

For desktop applications and general development tools I have been using both UNIX systems and Mac/MacOS for many years, but I have switched to x86-based PCs with Windows, Visual Studio and the .NET Framework several years ago.

I specialize in:
- cross-platform development (making software that runs on diverse hardware/OS combinations)
- instruction set simulation
- improving software performance, i.e. making sure the software runs the job at hand in as short a time as possible on the given hardware. This entails algorithm selection, implementation design, accurate measurements, code optimisation, and sometimes implementing virtual machines, applying SIMD technology (such as MMX/SSE), and more.
Software Developer (Senior) Freestyle Interactive Ltd
United Kingdom United Kingdom
I'm a lead developer for Freestyle Interactive Ltd where we create many wonderful websites built on Microsofts ASP.Net and Ektron CMS.

I've been developing .Net applications (both Windows and Web) since 2002.
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer
Australia Australia
New Zealand New Zealand
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
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.
Architect OG-BITechnologies
United States United States
Software engineer, author & speaker who enjoys mentoring, learning, speaking and sharing with others about software development technologies. Microsoft MVP.

My Blog
Team Leader
United Kingdom United Kingdom
My day job is mostly working in C++ with a bit of C#. I write a fair amount of command line based tools and really wish they could have a GUI front-end to them hence why I spend my spare time working with WPF.

I started a blog few years back but didn't do a lot with it. I've started describing some of the interesting programming things I come across on it. Please take a look.
Software Developer (Senior) Readify
Australia Australia
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.
Marketing Resco
Slovakia Slovakia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer CodeProject
United Kingdom United Kingdom
I started writing code when I was 8, with my trusty ZX Spectrum and a subscription to "Input" magazine. Spent many a happy hour in the school's computer labs with the BBC Micros and our two DOS PCs.

After a brief detour into the world of Maths, I found my way back into programming during my degree via free copies of Delphi and Visual C++ given away with computing magazines.

I went straight from my degree into my first programming job, at Trinet Ltd. Eleven years later, the company merged to become ArcomIT. Three years after that, our project manager left to set up Nevalee Business Solutions, and took me with him. Since then, we've taken on four more members of staff, and more work than you can shake a stick at. Smile | :)

Between writing custom code to integrate with Visma Business, developing web portals to streamline operations for a large multi-national customer, and maintaining RedAtlas, our general aviation airport management system, there's certainly never a dull day in the office!

Outside of work, I enjoy real ale and decent books, and when I get the chance I "tinkle the ivories" on my Technics organ.
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Architect
United States United States
Physics, physical and quantum optics, mathematics, computer science, control systems for manufacturing, diagnostics, testing, and research, theory of music, musical instruments… Contact me: https://www.SAKryukov.org
Software Developer AVAYA India Pvt Ltd.
India India
I have completed my B.E. Degree in IT form Aditya Engineering College, Beed. (Maharashtra) India.

I have completed Diploma In Advanced Computing (DAC) in Feb 07.

Now I am working for AVAYA India Pvt. LTD as software engineer.
Platform : C/C++, Solaris 10, AIX and Windows
CEO VISION fOr VISION
Belgium Belgium
I fell into applied algorithmics at the age of 16 or so. This eventually brought me to develop machine vision software as a professional. This is Dreamland for algorithm lovers.
Vietnam Vietnam
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
You must sign in to participate in this contest.
This contest has ended.
1 May - 31 May 2011