Click here to Skip to main content
15,881,882 members
Everything / Programming Languages / C# 4.0

C# 4.0

C#4.0

Great Reads

by Igor Ladnik
Wrapper to facilitate usage of TCP sockets
by Sacha Barber
It would probably be like Cinch, an MVVM framework for WPF.
by Roman Kiss
This article describes a design, implementation and usage of the Custom Routing Manager for managing messages via Routing Service built-in .Net 4 Technology.
by Adam David Hill
All the juicy tricks and scandalous shortcuts which helped us ship our competition game on time

Latest Articles

by Elmue
An easy to use 3D control which can be integrated into an application in a few minutes
by NikStar
Using OutgoingMessageProperties and OperationContextScope to implement authorization by http header for WCF client that communicates with non WCF-based web services.
by Siddhartha S.
WPF smart client demo of nitty gritty of MVVM for a real life LOB application
by Shivprasad koirala
Understanding two terminologies - reflection and dynamic keyword

All Articles

Sort by Score

C# 4.0 

21 Jan 2013 by Srinivasu Pemma
This tip provides an easy way of dealing with different types of data sources for LINQ Group By taken from my blog http://www.srinetinfo.com/2012/12/linq-group-by.html
14 Dec 2014 by MarkLTX
Automatically implement INotifyPropertyChanged for every property in Entity Framework 6.0 entity classes
4 Aug 2013 by Faisal(mfrony)
Understand the use of covariance in .NET 4.0
27 Nov 2013 by user6790
Autocomplete feature of jQuery in a MVC 3 application.
16 Jan 2014 by Tom Glick Philadelphia, US
POC to demonstrate passing of collections of complex objects to ASP.NET Web API Controllers.
23 Mar 2010 by AspDotNetDev
This version works regardless of parameters:public void AnyMethod(int parameter){ MethodInvoker wrapper = new MethodInvoker(delegate() { // Do your thing here! }); if (this.InvokeRequired) this.Invoke(wrapper); else wrapper();}Note also...
5 Dec 2012 by tumbledDown2earth
Using dynamic or ExpandoObject is a breeze to dynamic data WebAPIs, but when serializing to XML, it can cause a brain damage sometimes :)
15 Nov 2014 by Member 3531622
Create a Rules Engine in less than 50 lines of code which is extremely powerful, extensible and adaptable
15 Jan 2015 by Super Lloyd
All the tools to calculate Distance to Bezier curve, find the root of Polynomial, do Complex math
13 Jun 2011 by Luc Pattyn
This is an alternative to "L33t Tr4nsl4t0r (Leet Translator)".
22 Jul 2013 by Paw Jershauge
Want your own movie database??? Download IMDB in 20 minutes.
30 Nov 2015 by Mohammad Dayyan, VahidJafari
A library for creating .Net Serializable Expressions to send via WCF services
24 Jan 2015 by shijo joseph
A file backup manager with simple user interface and all the essential functionalities.
16 Feb 2010 by Pranay Rana
Following is code by which you get time in (HH:SS:MM) formate by passing second as argument public string getFormattedTimeFromSecond(double second) { TimeSpan t = TimeSpan.FromSeconds(second); string formatedTime = string.Format("{0:D2}H:{1:D2}M:{2:D2}S", ...
30 May 2011 by Ian 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; ...
18 Sep 2011 by Monjurul Habib
How to add namespaces for Razor pages
19 Oct 2010 by Ziv Nitzan
There is also a Visual Studio extention called CodeMaid that has a lot of cleaning options http://bit.ly/diMTaR
12 Apr 2011 by Kamran Behzad
You inspired me to contribute the DateTime extensions methods that I use in my programs. (But use at your own risk!). Thank you./// /// Date and Time Manager class./// public static class DateMan{ /// /// Returns the age in years for the given DOB...
16 Mar 2012 by UberGeoff
This tip explains how to display a jQuery modal pop-up message using server side events.
13 Nov 2012 by maximaximum
The article describes how to draw a grid of vertical and horizontal lines in WPF.
1 Jul 2019 by Lance Roberts
A tray utility for monitoring log files and popping up error messages
14 Apr 2014 by Maninder Singh Puhi
Appropriate query to fetch required no of results from DB instead of getting all at on time for binding controls like Gridview, listview etc
28 Sep 2014 by Vahid_N
It's easy to forget not disposing object contexts, which leads to memory leaks and also leaves too many related connection objects not disposed as well.
19 Mar 2015 by Hrvoje Batrnek
Easy and seamless caching implementation of any virtual method in any class
28 Apr 2015 by Hassan Alrehamy
JSON Deserialization in depth concept and Dictionary mapping. Special Thanks to Dr. Coral Walker
28 Dec 2015 by Dhruti90
MVC functionalities with web service with simple integration
6 Sep 2010 by DaveyM69
How to convert a generic List of derived types to a generic list of base types.
5 Jun 2011 by JV9999
Not really, because what if your finally block would contain more lines of code than the single line you have in your example? That would make it already much harder to read.Secondly, you are misusing the Dispose method. You shouldn't invoke anything in it, especially not the Action, you...
7 Jun 2011 by Kim Togo
Code to change text to Leet
20 Nov 2011 by Bernhard Hiller
That's far too obscure.All you need to do is store a reference to the TabPage instance which was removed from the TabPages collection of the TabControl. You may use the form where the TabControl is placed for that purpose.You could also create your own TabControl which has an extra property...
27 Apr 2012 by Tony Dubey
This code demonstrate pros and cons of PLINQ as compared to LINQ
5 Jun 2014 by Erik Vullings
Generate a PowerPoint presentation, consisting of slides with a title and an image, without requiring Microsoft Office
13 Nov 2015 by OrlandoCurioso
An EF base DbContext that provides detailed information on current and totalized changes
28 May 2016 by Michael B. Erickson
Control the changes to structured data exposes by your .NET objects
17 Jun 2011 by VallarasuS
Here is how you can achieve Gradients used in Office 2010 Buttons with a glow at the bottom.
4 Apr 2012 by sluaghtered
Script Runner that can run multiple SQL script files on MS-SQL.
7 Jun 2012 by AndrewSmith
Creating a custom base job class for quartz scheduler development
11 Oct 2012 by Peter Carrasco
A quick introduction to data annotations in C#
23 Dec 2012 by Oleksandr Kulchytskyi
This tip explains how to increase performance in serialization by using MessagePack
24 Jan 2013 by Oleksandr Kulchytskyi
More advanced singleton implementation.
26 May 2013 by Jan_Zimmermann
A log4Net appender with a selfHosting SignalR server.
14 Feb 2014 by BenScharbach
How-To Convert a String Collection to a Multi-Enum item using TryParse
5 Jun 2014 by B. Clay Shannon
A C# snippet that converts Spanish text into a phonetic representation of how to pronounce it (in Mexican Spanish, not Spaniard Spanish) for speakers of American English
17 Jun 2014 by Mahdi Ataollahi
Implementing Microsoft.AspNet.SignalR 2 and Microsoft.AspNet.SignalR.Client 2 in Silverlight
28 Jul 2014 by sajjad kardani moghadam
Octa Tree is a 3D space partitioning algorithm
13 Mar 2015 by Aman Thakur
The tip explains how to make recurring payments using the Stored Credit Cards in the Paypal Vault.
23 Jun 2015 by MarcusCole6833
A simple program to make an HTML page from an XML file
22 Aug 2010 by Dieter Deysel
Combining custom attributes, reflection and generics to maximize the use of enum in a system.
15 May 2011 by ambarishtv
dynamic keyword - Represents an object whose operations will be resolved at runtime
22 May 2011 by Mohammad A Rahman
23 Jul 2011 by #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...
13 Jan 2012 by C Yang
Program to Switch Screen Setting In One Click
18 Jan 2012 by johannesnestler
Very good tip. I just want to mention an alternative - you can just change your project output type to a console application. (You can undo it later if only needed for debugging). So if you started with a Windows Forms project in Visual Studio: Go to project properties/application/ and in the...
25 May 2012 by Tauseef M
This tool is used for Encryption of Database in SQL Server 2008 Enterprise Edition
7 Jun 2012 by AmitGajjar
An efficient extended search API to search from a text file.
2 Aug 2012 by Himanshu Thawait
WCF With No config file needed – all setting in code only, No IIS – Self hosted, consume by channel factory
25 Sep 2012 by Pablo Oropin
This article aims to explains how to implement functions to deliver data via HTTP POST or HTTP GET in ASP.NET to an specified link.
6 Dec 2012 by xibao
Code to produce holidays for NYC Stock Exchange.
9 May 2013 by Abhay@Accenture
16 May 2013 by ortund
Allow purchases via PayPal on your website
23 Jun 2013 by Aaron Amberman
Defer algorithms to run once within a given time span
28 Jul 2013 by Raja.Krishnasamy
Attached the test data with method for regression testing by declaring ref type in attribute
6 Mar 2014 by Adel Refaat
A SharePoint WebPart that hosts Razor files (.cshtml, .vbhtml)
14 Apr 2014 by Arjun Singh Faguda
How to call cross domain Webserver(asmx) service from jquery and bind the Json result with Jqgrid
4 Aug 2014 by Matus Kovacik
Single class encapsulating UDP IP multicasting functionality and exposing it via observer pattern.
7 Aug 2014 by Gold$Coin
This tip will help you to create a collection from a DataSet
9 Mar 2015 by Chinh Vo Wili
This tip describes how to use Selenium WebDriver extension for jQuery of RaYell and customize waiting element loading
26 Mar 2016 by Sumit Samediya
Here we will learn how to remove default background color of ListBox item on selection in Windows Universal App
22 Aug 2010 by Moim Hossain
Doing like following for few years now :public void AnyMethod(int parameter){ var wrapper = new Action(()=> { // Do your thing here! }); if (this.InvokeRequired) this.Invoke(wrapper); else wrapper();}
5 Jan 2011 by Anupama Roy
Read clob from Oracle
22 Jun 2011 by Andrew Rissing
A simple trick to remove the delay of Thread.Sleep for unit testing.
4 Jul 2011 by 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[^]
16 Mar 2012 by Carlos Conceição
This article how you can use TextToCalcExpression to generate Linq Expressions in runtime
11 Jun 2012 by taha bahraminezhad Jooneghani
A custom validation control for FileUpload controls that validate like required validator, and have two more methods for extensions and file size!
5 Jun 2012 by Andreas Gieriet
This is an alternative for "Sorting Strings based on the position of the block letter"
15 Jun 2012 by #realJSOP
One way to get around the "invalid character" error
28 Jun 2012 by ROHIT SHAW
It shows how to display a badge notification in Windows 8 metro app
30 Sep 2013 by N_tro_P
Simplify your MVVM Properties
25 Jul 2012 by #realJSOP
Evaluating epressions in an ad-hoc condition.
13 Apr 2013 by InbarBarkai
Create and use a multiple value slider
23 Jan 2013 by Rajamohan Dhanushkodi
Custom DataGrid than can group data, display row details, and filter data.
19 May 2013 by Yossi Yaari
A solution for monitoring Events called during test.
19 May 2013 by Yossi Yaari
A basic yet generic state machine implementation
25 Sep 2013 by ModMa
Real and fully functional connection Database Provider and DatabaseTraceListener for SQLite!
16 Jan 2014 by Codes Of Shadows
Header Style Combo Box Drop Down Filter Button
4 Mar 2014 by pckola
Accessing userProxy, userProxyFull From AD Light Weight Directory Services
6 May 2014 by Daniel Lieberwirth (BrainInBlack)
This describes a simple way to create interactive, bitmap based, buttons for WinForm applications.
14 May 2014 by atlaste
How to fix hiding controls in the Visual Studio user control designer
31 May 2014 by Evgeny Pereguda
This is simple implementation of fast forward 1D DCT-II on MSIL which is generated at runtime.
21 Jun 2014 by Andrei Keino
The tip describes a way to create C# enhanced enumerations that can contain class objects.
3 Jul 2014 by yousafzai amazai
ref and out parameters in C#
26 Oct 2014 by Bimaln
Describe about the SOAP message in WCF with example.
4 Jan 2015 by Thorvaldur Arnarson
Abstract class inheritance inversion where in the base class calls the inheriting class.
6 Mar 2015 by Ankur .K. Vishwakarma
Calling server-side code from client-side using JavaScript and TextBox's onblur event
12 May 2015 by HUONG Minh-Luong
This tip is a tutorial that explains how to use PresentationRequestor Nuget package.
6 Jan 2011 by Alex Furmanski
You should watch out for cases where the return value could be null otherwise you'll get an exception, and your call to ToString is redundant.OracleClob clob = Params[3].Value as OracleClob;if (clob.IsNull) errorCode = null;else errorCode = clob.Value;