General Programming
|
String |
28 Jun 2011
Updated: 29 Jun 2011
Rating: 0.00/5
Votes: 0
Popularity: 0.00
Licence: CPOL
Views: 6,323
Bookmarked: 0
Downloaded: 0
The idea was good, but I think we could probably do something like below:public static string UsingStringJoin(IEnumerable sList, string separator){ return sList.Any() ? string.Join(separator, sList.ToArray()) : string.Empty;}public static string...
|
Programming Languages
|
C# |
12 Jun 2011
Updated: 12 Jun 2011
Rating: 5.00/5
Votes: 2
Popularity: 1.51
Licence: CPOL
Views: 29,313
Bookmarked: 6
Downloaded: 0
Caching uses with Proxy pattern in C#
|
|
20 Jun 2011
Updated: 21 Jun 2011
Rating: 4.60/5
Votes: 5
Popularity: 3.22
Licence: CPOL
Views: 30,304
Bookmarked: 11
Downloaded: 0
An abstract base class with abstract methods and a common method with implementation which will be used by the implementer classes of the abstract class.
|
|
26 Jun 2011
Updated: 26 Jun 2011
Rating: 4.71/5
Votes: 4
Popularity: 2.84
Licence: CPOL
Views: 42,052
Bookmarked: 8
Downloaded: 0
Some logical and arithmetic operations in C#
|
|
28 Jun 2011
Updated: 29 Jun 2011
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 9,500
Bookmarked: 0
Downloaded: 0
The code has been updated to improve the performance:public static bool DoSequenceOfOr(params Func[] sequenceOfBooleanValue){ foreach (Func item in sequenceOfBooleanValue) if (item()) return true; return false;}public static bool...
|
|
10 Jul 2011
Updated: 10 Jul 2011
Rating: 5.00/5
Votes: 3
Popularity: 2.39
Licence: CPOL
Views: 34,942
Bookmarked: 3
Downloaded: 0
Parse key/value of a Generic dictionary in C#.
|
|
29 Sep 2011
Updated: 30 Sep 2011
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 44,192
Bookmarked: 6
Downloaded: 0
Following might be another way to do the job:public static string ConvertDataTableToString(this DataTable dt){ StringBuilder stringBuilder = new StringBuilder(); dt.Rows.Cast().ToList().ForEach(dataRow => { ...
|
|
22 Sep 2011
Updated: 2 Oct 2011
Rating: 5.00/5
Votes: 2
Popularity: 1.51
Licence: CPOL
Views: 24,570
Bookmarked: 1
Downloaded: 0
The List class already has a method doing the same job as:public static void ForEach(this IList list, Action function)More about the ForEach method is available here. Here is the reflected ForEach method:public void ForEach(Action action){ if (action == null) { ...
|
|
8 Jun 2011
Updated: 8 Jun 2011
Rating: 4.63/5
Votes: 7
Popularity: 3.91
Licence: CPOL
Views: 45,550
Bookmarked: 5
Downloaded: 0
|
|
24 May 2011
Updated: 25 Jun 2011
Rating: 3.50/5
Votes: 2
Popularity: 1.05
Licence: CPOL
Views: 19,597
Bookmarked: 4
Downloaded: 0
A Generic Ternary Operator for value types and parameterless method
|
|
4 Jul 2011
Updated: 4 Jul 2011
Rating: 4.50/5
Votes: 2
Popularity: 1.35
Licence: CPOL
Views: 9,440
Bookmarked: 1
Downloaded: 0
Strategy of type selection in C#
|
|
4 Jul 2011
Updated: 5 Jul 2011
Rating: 1.00/5
Votes: 2
Popularity: 0.30
Licence: CPOL
Views: 42,036
Bookmarked: 4
Downloaded: 0
Few extension methods of IEnumerable in C#
|
|
1 Oct 2011
Updated: 2 Oct 2011
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 19,296
Bookmarked: 3
Downloaded: 0
Rename all the files from the given folder using C#. The code will go through all the files and rename with the same name but with formatted name for example by removing "-" or "_" etc with given characters..
|
|
23 Sep 2011
Updated: 2 Oct 2011
Rating: 5.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 7,231
Bookmarked: 4
Downloaded: 0
In addition, there are many articles posts that have been discussed about this, for example,Single Instance Application in C#[^]Single-Instance C# Application - for .NET 2.0[^]Stream Decorator, Single-Instance Apps[^]
|
|
4 Oct 2011
Updated: 4 Oct 2011
Rating: 4.33/5
Votes: 6
Popularity: 3.37
Licence: CPOL
Views: 54,095
Bookmarked: 2
Downloaded: 0
It could be done using Recursive Lambda Expression, for example,class Program{ static Func Factorial = x => x < 0 ? -1 : x == 1 || x == 0 ? 1 : x * Factorial(x - 1); static void Main(string[] args) { Console.WriteLine(Factorial(5)); }}(The code...
|
C# 4.0 |
22 Sep 2011
Updated: 22 Sep 2011
Rating: 4.43/5
Votes: 7
Popularity: 3.74
Licence: CPOL
Views: 15,541
Bookmarked: 2
Downloaded: 0
A generic text clear method for those ASP.NET controls which implement the ITextControl interface:private void Clear(ControlCollection controlCollection) where T : ITextControl{ if (controlCollection == null) return; ...
|
|
18 May 2011
Updated: 22 May 2011
Rating: 5.00/5
Votes: 3
Popularity: 2.39
Licence: CPOL
Views: 45,390
Bookmarked: 9
Downloaded: 0
|
|
30 May 2011
Updated: 7 Jun 2011
Rating: 3.00/5
Votes: 1
Popularity: 0.00
Licence: CPOL
Views: 12,470
Bookmarked: 1
Downloaded: 0
The ParseEnum method will not work where we use a version below .NET Framework 4.0 because of the TryParse method. So those who need to use it in below .NET Framework 4.0 or in .NET Framework 4.0, the following extension methods will be helpful:public static TEnum ParseEnum(this...
|
|
22 May 2011
Updated: 19 Jun 2011
Rating: 4.80/5
Votes: 4
Popularity: 2.89
Licence: CPOL
Views: 34,103
Bookmarked: 9
Downloaded: 0
Few extension methods of String concatenation in C#
|
|
25 Jul 2011
Updated: 25 Jul 2011
Rating: 0.00/5
Votes: 0
Popularity: 0.00
Licence: CPOL
Views: 6,731
Bookmarked: 0
Downloaded: 0
Another way,public static class ReverseStringExtension{ public static string Reverse(this string dataToRevese) { Func reverseFunc = (dataToFunc) => { StringBuilder reverseBuilder = new StringBuilder(); for (int index =...
|
Visual Basic |
14 Sep 2011
Updated: 14 Sep 2011
Rating: 4.75/5
Votes: 5
Popularity: 3.32
Licence: CPOL
Views: 9,831
Bookmarked: 2
Downloaded: 0
namespace IpAddresses{ using System; using System.Collections.Generic; using System.Linq; using System.Net; class Program { static void Main(string[] args) { GetIPAddresses().ForEach(ip => Console.WriteLine(ip)); } ...
|
Web Development
|
ASP.NET |
13 May 2011
Updated: 14 Jun 2011
Rating: 4.13/5
Votes: 7
Popularity: 3.49
Licence: CPOL
Views: 36,043
Bookmarked: 10
Downloaded: 0
How to execute ASP.NET method from control's event handler of a web user control.
|
|
23 Sep 2011
Updated: 9 Oct 2011
Rating: 4.95/5
Votes: 13
Popularity: 5.52
Licence: CPOL
Views: 74,519
Bookmarked: 21
Downloaded: 0
How to send ASP.NET formatted exception details via email
|