Click here to Skip to main content
14,982,479 members
This competition has ended

Best C# article of July 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.
9 Jul 2011
Paulo Zemek
The easiest singleton pattern is the one you used to the lock object itself.Creating any variable as static readonly and initializing it directly (or via a static constructor) will already make it singleton.Also, considering that "lock" clears all the caches, you don't need to declare the...
Please Sign up or sign in to vote.
25 Jul 2011
Praveen Kullu
An Attribute changer which can change attributes of files and folders
Please Sign up or sign in to vote.
26 Jul 2011
Arjan van Dijk
Developing a small generic re-usable model using the highly flexible DC technology resulting in a fully functional mini-application
Please Sign up or sign in to vote.
8 Jul 2011
Clifford Nelson
A special class is needed to support binding a set of flags to a View.
Please Sign up or sign in to vote.
20 Jul 2011
Gil Fink
The post shows how to use the Geocode API in order to make an address lookup for a given location.
Please Sign up or sign in to vote.
12 Jul 2011
RaisKazi
Walkthrough of Asp.Net Core Ajax
Please Sign up or sign in to vote.
3 Dec 2013
Vangos Pterneas
How to create a WPF application performimg skeleton tracking.
Please Sign up or sign in to vote.
4 Jul 2011
Nelson Kosta Souto
How to use key pressing on a form
Please Sign up or sign in to vote.
16 Jul 2011
tsdragon
Application[“P...
Please Sign up or sign in to vote.
20 Jul 2011
cmschick
Thanks for sharing. I have a similar utility with additional capabilities that some of you might find useful.using Microsoft.VisualBasic;using System;using System.Collections;using System.Collections.Generic;using System.Data;using System.Diagnostics;using...
Please Sign up or sign in to vote.
6 Jul 2011
Brian C Hart
This tip shows how to add support for New Horizontal Tab Group and New Vertical Tab Group commands to the Window menu of an application using the DockPanel Suite by Weifen Luo, and some other minor improvements to help decided if at least one of your windows is docked to the side of the main form an
Please Sign up or sign in to vote.
10 Jul 2011
Mohammad A Rahman
Parse key/value of a Generic dictionary in C#.
Please Sign up or sign in to vote.
27 Jul 2011
Ivan Krivyakov
BackgroundWorker and UI threads
Please Sign up or sign in to vote.
21 Jul 2011
Ramanujam Shankar
Remove the triangle and star symbol from the row header in a DataGridView.
Please Sign up or sign in to vote.
23 Jul 2011
#realJSOP
I wouldn't create a class for this. I'd make it an extension method, and then do this:public static class String Extensions{ public static string Reverse(this string value) { value = // do your reverse code here; return value; }}// Usage:string x...
Please Sign up or sign in to vote.
4 Jul 2011
DrABELL
AsFYI: In addition to my previous comments, here is the link to an excellent article published by Aron Weiler on CodeProject addressing the same issue of Multi-Key Dictionary Object: C# Multi-key Generic Dictionary[^]
Please Sign up or sign in to vote.
5 Jul 2011
#realJSOP
I do it this way:0) Create a base page class, and store the current page's url (you can do this any number of ways, so I'll leave it to your imagination):public class MyBasepage : System.Web.UI.Page{ public string CurrentUrl { get; set; } }1) Store the page's Url to a...
Please Sign up or sign in to vote.
7 Jul 2011
#realJSOP
.Net 4 has the enum.HasFlag() method, which kinda obsoletes this tip. :)
Please Sign up or sign in to vote.
12 Jul 2011
johannesnestler
I think your function is no (theoretical) replacement for the is operator.The is operator takes an object (left) and a type (right) as arguments, not two objects.The is operator considers inheritance. Look at this (executable) example:using System;namespace IsOperatorCheck{ ...
Please Sign up or sign in to vote.
15 Jul 2011
Simon Bridge
Full code listing for a very simple but effective Colour-Combo (Color for those in America)
Please Sign up or sign in to vote.
19 Jul 2011
Colin Eberhardt
How to create a conversation view, mimicking the SMS messaging interface within Windows Phone 7
Please Sign up or sign in to vote.
22 Jul 2011
Brij
Generics and Constraints over Generics
Please Sign up or sign in to vote.
21 Jul 2011
Gediminas Geigalas
Teleric MVC Grid ActionLink Column
Please Sign up or sign in to vote.
27 Jul 2011
garymcleanhall
Towards better unit testing organization
Please Sign up or sign in to vote.
27 Jul 2011
PeteBarber
Unit Testing C# Custom Attributes with NUnit
Please Sign up or sign in to vote.
27 Jul 2011
PeteBarber
Unit Testing C# Custom Attributes with NUnit
Please Sign up or sign in to vote.
27 Jul 2011
Qwertie
I want a conditional dot operator
Please Sign up or sign in to vote.
29 Jul 2011
gsvolt
Draing a two-color line in Silverlight.
Please Sign up or sign in to vote.
1 Jul 2011
Mahadesh Mahalingappa
In Part 2 of Dynamic Loading of objects, I have created a custom Dependency Injection Framework
Please Sign up or sign in to vote.
3 Jul 2011
Dr.Walt Fair, PE
You can also use the method in the following article to insert any sort of binary file in your project resources and retrieve it. Create a blank Jet database[^]
Please Sign up or sign in to vote.
10 Jul 2011
GAMerritt
Getting a DllImport of kernel32's GetFullPathName to work (C#).
Please Sign up or sign in to vote.
10 Jul 2011
Chris Randle
I've always used var because ReSharper suggested it by default. However, like most people, I only did this when I didn't understand the conotations of ReSharper's suggestion. Now I disable this suggestion in the plug-in, and in actual fact, I prefer to use the fully qualified name on at least...
Please Sign up or sign in to vote.
15 Jul 2011
Manoj Kumar Kota
Fetch Data from Google Analytics Service
Please Sign up or sign in to vote.
17 Jul 2011
Philippe Mori
LINQPad is an interesting tool to try queries.LINQPad[^]Perfect tool to try out some alternatives for complex queries. As we can see generated queries and elapsed time, it help a lot to help having fast queries for complex requests.
Please Sign up or sign in to vote.
18 Jul 2011
AspDotNetDev
If you are the type that likes to debug production code, you can use SQL Profiler to find queries generated by your LINQ statements. This is a technique I recently used because it was so simple and did not require me to recompile anything.Note that StefanHam already posted this alternate...
Please Sign up or sign in to vote.
20 Jul 2011
Gil Fink
What Model Binders are in ASP.NET MVC and how you can use them in your MVC applications.
Please Sign up or sign in to vote.
21 Jul 2011
Raymund Macaalay
How to get the default record type of a user for event creation in Salesforce
Please Sign up or sign in to vote.
23 Jul 2011
Prerak Patel
What is new in this age old method? We can use LINQ too.Dim inputString As String = "Reverse me"Dim input() As Char = inputString.ToCharArrayDim result As String = New String((From i As Integer In Enumerable.Range(1, input.Length) _ Select...
Please Sign up or sign in to vote.
24 Jul 2011
GAMerritt
A C# method for finding ratio Q/R approximating real numbers.
Please Sign up or sign in to vote.
25 Jul 2011
PeteBarber
A simple generic way to test Custom Attributes with NUnit.
Please Sign up or sign in to vote.
25 Jul 2011
garymcleanhall
Skyhooks are undesirable, how to replace them in your code.
Please Sign up or sign in to vote.
26 Jul 2011
#realJSOP
One way to effectively zero the columns any DataRow object.
Please Sign up or sign in to vote.
29 Jul 2011
Bob Sandberg
How would you do this, if objects included inside one of the serialized objects was an abstract class? E.g.:abstract class Base{ public int x;}class A : Base{ public int y;}class B : A{ public int z;}class SomeOtherClass{ public string...
Please Sign up or sign in to vote.
1 Jul 2011
zenwalker1985
This article explains a refactored code snippet on passing parameters for a stored proecedure via SP schema rather than hard coding the column/param names.
Please Sign up or sign in to vote.
4 Jul 2011
charles henington
[Serializable]...
Please Sign up or sign in to vote.
9 Jul 2011
charles henington
Sending Email with Custom Control
Please Sign up or sign in to vote.
8 Jul 2011
Amey1202
In WPF, just set the ToolPanelView property of CrystalReportViewer to None. That is enough.
Please Sign up or sign in to vote.
12 Jul 2011
Paul Schwartzberg
Formatting XML in a string for visual presentation.
Please Sign up or sign in to vote.
16 Jul 2011
Waleed Eissa
How to turn URLs into hyperlinks in ASP.NET and truncate long URLs in the link text
Please Sign up or sign in to vote.
18 Jul 2011
SergeyT2
The codepublic static IEnumerable IfMatchWith(this IEnumerable myList, string itemToMatch){ foreach (var item in myList.Where(item => item == itemToMatch)) yield return item;}could be rewritten as:public static IEnumerable IfMatchWith(this...

Current Participants

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

#realJSOP
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.
Amey1202
United States United States
No Biography provided
Arjan van Dijk
Software Developer (Senior) Distel Software B.V.
Netherlands Netherlands
Senior Developer and Technical Director at Distel Software B.V.(www.distel.nl)

About 15 years of IT experience in several languages (c++, c#, vb.net) specializing in framework oriented development
(using DC, DO and XAF/XPO) based on C# where the focus is on functional modeling and creating re-usable building blocks.
AspDotNetDev
Web Developer
United States United States

  • Managing Your JavaScript Library in ASP.NET (if you work with ASP.net and you don't read that, you are dead to me).
  • Graduated summa cum laude with a BS in Computer Science.
  • Wrote some articles and some tips.
  • DDR ("New high score? What does that mean? Did I break it?"), ping pong, and volleyball enthusiast.
  • Software I have donated to (you should too):
Bob Sandberg
Web Developer
United States United States
No Biography provided
Brian C Hart
Software Developer (Senior) xyLOGIX, LLC
United States United States
No Biography provided
Brij
Software Developer (Senior)
India India
Brij is a 3-times Microsoft MVP in ASP.NET/IIS Category and a passionate .NET developer. More than 6 years of experience in IT field, currently serving a MNC as a Tech Lead/Architect.

He is a very passionate .NET developer and have expertise over Web technologies like ASP.NET 2.0/3.5/4.0, jQuery, JSON, Javascript, IIS and related technologies. He is also a Exchange Server (EWS) Specialist. He has great experience in design patterns and N-Tier Architecture.

He is also certified as Microsoft Certified Technologies Specialist-ASP.NET and Microsoft Certified Technologies Specialist-WCF in .NET 4.0. He has also received several awards at various forums and his various articles got listed as "Article of the day" at ASP.NET Microsoft Official Website www.asp.net.

He has done MCA from NIT Durgapur and completed his graduation from Lucknow University.

Learning new technologies and sharing knowledge excites him most. Blogging, solving problems at various forums, helping people, keeps him busy entire day.


Visit his Blog: Code Wala

Area of Expertise :
C#, ASP.NET 2.0,3.5,4.0, AJAX, JQuery, JSON, XML, XSLT, ADO.Net, WCF, Active Directory, Exchange Server 2007 (EWS), Java script, Web Services ,Win services, DotnetNuke, WSS 3.0,Sharepoint Designer, SQL Server 2000/2005/2008
charles henington
United States United States
I do not claim to be wrong! I just rarely ever write.
Chris Randle
Software Developer (Senior) Crantech Solutions Ltd
England England
C# software developer who works predominantly with web technologies. Interested in business process improvement, psychology of user interfaces - specifically within content management systems, and the use of technology to advance our daily lives.
Clifford Nelson
Software Developer (Senior) Clifford Nelson Consulting
United States United States
Has been working as a C# developer on contract for the last several years, including 3 years at Microsoft. Previously worked with Visual Basic and Microsoft Access VBA, and have developed code for Word, Excel and Outlook. Started working with WPF in 2007 when part of the Microsoft WPF team. For the last eight years has been working primarily as a senior WPF/C# and Silverlight/C# developer. Currently working as WPF developer with BioNano Genomics in San Diego, CA redesigning their UI for their camera system. he can be reached at qck1@hotmail.com.
cmschick
United States United States
No Biography provided
Colin Eberhardt
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

-
Dr.Walt Fair, PE
Engineer Comport Computing
United States United States
No Biography provided
DrABELL
Software Developer (Senior)
United States United States
Dr. Alexander Bell is a seasoned full-stack Software Engineer (Win/Web/Mobile). He holds PhD in Electrical and Computer Engineering, authored 37 inventions and published 300+ technical articles. Currently focused on multiple Android/Mobile development projects and Big Data' Machine Learning, AI, IoT. Alex participated in App Innovation Contests (AIC 2102/2013) with multiple winning submissions. Sample portfolio apps and publications:

  1. Publications by A. Bell
  2. Educational Web Portal
  3. Engineering Calculator VOLTA
  4. Aggregate Product function extends SQL
  5. Use SQL to generate large data sequence
  6. HTML5/CSS3 graphic enhancement: buttons, inputs
  7. Advanced CSS3 Styling of HTML5 SELECT Element
  8. enRoute: Real-time NY City Bus Tracking Web App
  9. YouTube™ API for ASP.NET
  10. HTML5 Tables Formatting: Alternate Rows, Color Gradients, Shadows
GAMerritt
United States United States
Writer, designer, inventor, musician, observer, and critic with many years of experience in each of these areas. I can do without the approval of "experts" because I believe candid statements and penetrating analysis bring greater rewards than a "pat on the back". And if I have something to say when you're not listening, I tell someone else about it.
garymcleanhall
Software Developer (Senior) Nephila Capital Ltd.
Bermuda Bermuda
An experienced .NET developer, currently working for Nephila Capital Ltd. in Bermuda. Author of "Pro WPF and Silverlight MVVM".
Gediminas Geigalas
Software Developer (Senior)
Lithuania Lithuania
No Biography provided
Gil Fink
Technical Lead sparXys
Israel Israel
Gil Fink is a web development expert and ASP.Net/IIS Microsoft MVP. He is the founder and owner of sparXys. He is currently consulting for various enterprises and companies, where he helps to develop Web and RIA-based solutions. He conducts lectures and workshops for individuals and enterprises who want to specialize in infrastructure and web development. He is also co-author of several Microsoft Official Courses (MOCs) and training kits, co-author of "Pro Single Page Application Development" book (Apress) and the founder of Front-End.IL Meetup. You can read his publications at his website: http://www.gilfink.net
gsvolt
Software Developer
United States United States
I am a software developer with a wide range of interests. Early in my career I started with Microsoft based technologies, did some Java, and am now again helping organizations with Microsoft based solutions.

My main goal in joining codeproject would be to post useful code that otherwise would not be available in Microsoft's documentation.
Ivan Krivyakov
Technical Lead Thomson Reuters
United States United States
Ivan is a hands-on software architect/technical lead working for Thomson Reuters in the New York City area. At present I am mostly building complex multi-threaded WPF application for the financial sector, but I am also interested in cloud computing, web development, mobile development, etc.

Please visit my web site: www.ikriv.com.
johannesnestler
Austria Austria
No Biography provided
No Biography provided
Manoj Kumar Kota
Software Developer
Australia Australia
10+ years of experience in IT industry as Application developer and solution architect.
Nelson Kosta Souto
Engineer
Portugal Portugal
My name is Nelson Souto, I develop software for fun and profit since 1992.
Paul Schwartzberg
Software Developer (Senior) Systemize Informatik GmbH
Denmark Denmark
Software Developer / Contractor
Paulo Zemek
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).
PeteBarber
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.
Philippe Mori
Software Developer (Senior)
Canada Canada
Programmer at Maid LABS from 2003 (www.maidlabs.com)

Programmer-Analyst at Viasat Geo Technoligies from 1995 to 2002 (www.viasat-geo.com).

I have studied at École Polytechnique de Montréal in computer engineering.
Praveen Kullu
Software Developer HP Microsystems
India India
No Biography provided
Prerak Patel
Software Developer
India India
Working since 2006 on VBA, VB6, VB.Net, C#, ASP.Net, MSSQL




  • Courage is not the absence of fear, but rather the judgement that something is more important than fear.
  • The fear of suffering is worse than the suffering itself.
  • People need not fear the unknown if they are capable of achieving what they need and want.
  • Every blessing ignored becomes a curse.
  • Sometimes what's in your head isn't as crazy as you think.
  • We never really grow up, we only learn how to act in public.
  • You can make very bad teams with very good individuals.
  • Admitting mistakes means you have a sense of responsibility in your actions and that shows you are more matured than almost anyone. -Nithin

Qwertie
Software Developer None
Canada Canada
Since I started programming when I was 11, I wrote the SNES emulator "SNEqr", the FastNav mapping component, the Enhanced C# programming language (in progress), the parser generator LLLPG, and LES, a syntax to help you start building programming languages, DSLs or build systems.

My overall focus is on the Language of your choice (Loyc) initiative, which is about investigating ways to improve interoperability between programming languages and putting more power in the hands of developers. I'm also seeking employment.
RaisKazi
Technical Lead
United States United States
Full Stack Technology Professional

Hands-on experience with -
. Asp.Net, MVC, C#, Ajax
. JavaScript, Jquery, AngularJS
. Xamarin
. SharePoint
. VBScript

Tested flavors of -
. Java, Perl, Python, NodeJS, Android, IOS(little bit)
Ramanujam Shankar
Web Developer Mahindra Logisoft Business Solution Limited, Chenn
India India
No Biography provided
Raymund Macaalay
Technical Lead
New Zealand New Zealand
http://nz.linkedin.com/in/macaalay
http://macaalay.com/
SergeyT2
Software Developer
Russian Federation Russian Federation
No Biography provided
Simon Bridge
Software Developer (Senior) Decipha
Australia Australia
Wrote his first computer game in Microsoft Basic, on a Dragon 32 at age 7. It wasn't very good.
Has been working as a consultant and developer for the last 15 years,
Discovered C# shortly after it was created, and hasn't looked back.
Feels weird talking about himself in the third person.
tsdragon
Web Developer
United States United States
No Biography provided
Vangos Pterneas
CEO LightBuzz
United States United States
Vangos Pterneas is a Microsoft Most Valuable Professional in the Kinect technology. He helps companies from all over the world grow their revenue by creating profitable software products. Vangos is the founder of LightBuzz Inc. and author of two technical books.
Waleed Eissa
Software Developer (Senior) Contractor
Egypt Egypt
My name is Waleed Eissa and I'm a software developer from Cairo, Egypt. I spent 7 years developing software for the banking industry, but has changed focus in recent years to Web development. I specialize in Microsoft technologies, esp. ASP.NET and C#, and am passionate about everything web. My main interests are user experience design (UX), performance tuning and scalability.

Website: http://www.waleedeissa.com
Blog: http://waldev.blogspot.com
zenwalker1985
Software Developer (Senior) Siemens
India India
A .net developer since 4+ years, wild, curious and adventurous nerd.

Loves Trekking/Hiking, animals and nature.

A FOSS/Linux maniac by default Wink | ;)

An MVP aspirant and loves blogging -> https://adventurouszen.wordpress.com/
You must sign in to participate in this contest.
This contest has ended.
1 Jul - 31 Jul 2011