Welcome To Snipplr


Everyone's Recent C# Snippets Tagged c



« Prev 1 2 3
If you are using c++/cli or UnmanagedExports, this is a useful way to share enum int values between c++ and c# code/DLLs without worrying about duplicated code going out of date.
0 1137 posted 9 years ago by xXxPizzaBreakfastxXx
.net 3.0+, To create stability in your code, you must check all inputs into a method to make sure they are valid . Often people overlook this step because of laziness, or because they aren't convinced that exceptions and assertions are actually in pl...
0 696 posted 12 years ago by bryanlyman
This snippet is "extension method" for IDataReader. You can use this snippet below ; I assume you have datareader like that SqlDataReader dataReader = command.ExecuteReader(); if (dataReader.IsColumnExists("columnName")) { //do something...
0 1036 posted 13 years ago by emregulcan
This method can execute XML-RPC call and return response. Can be useful for working with XML-RPC API's like Snipplr.com XML-RPC API and other
4 1380 posted 13 years ago by dzr_gregory
A base class for very simple value converters in WPF, Windows Phone 7 and Silverlight.
1 520 posted 13 years ago by jacob4u2
Add this code to your App.xaml.cs inside your App class to enable a static property that will give you the current theme at runtime.
0 615 posted 13 years ago by jacob4u2
1 879 posted 13 years ago by jermeyz
2 954 posted 13 years ago by cabrel
Enables to convert types using generics. Simple and clean.
2 604 posted 13 years ago by wallybh
Class to shorten text. For example for an article where people can click read more to read the whole article.
1 585 posted 13 years ago by Fogh
1 2423 posted 13 years ago by gilbitron
2 635 posted 13 years ago by jiewmeng
1 682 posted 13 years ago by jmcd
1 605 posted 13 years ago by emmanuelbuah
1 2505 posted 13 years ago by acosonic
Well, there is many faulty C# timestamp handling codes. Here is a proper one, use UtcNow instead Now if you need UTC timestamp...
1 832 posted 13 years ago by acosonic
1 714 posted 13 years ago by mpcircuitry
3 1514 posted 13 years ago by ax4413
0 642 posted 13 years ago by mracoker
This is a simple Linq query against a list of Star Wars characters.
1 556 posted 13 years ago by stewshack
.net 2.0+ Generic classes make code size much smaller and casting objects (boxing) a cinch. However, currently there are some unsupported IDE options when trying to cast objects to and from generic objects that use mixed object types (inherited from...
0 748 posted 14 years ago by bryanlyman
You can get all countries list by this method. Also you can find some details for countries like; - original name, - three letter ISO region name, - three letter WINDOWS region name, - currency symbol etc..
1 791 posted 14 years ago by emregulcan
Value converters allow ease of converting code-behind values to dependency property values
0 593 posted 14 years ago by davidsi
« Prev 1 2 3