1 2 3 4
List<Document> documents = documentLayer.GetDocuments(username);
List<Document> filteredDocuments = new List<Document>();
...
C# Filterting a List<> w...
by mantis7.myopenid.com,
November 25, 2008 16:33,
2 refactorings, tagged with regular expression, C#, List, filter
1 2 3 4
/// <summary> /// Test to see if the type can be XML serialized /// </summary> ...
C# Check type is XML Serializable
by sbehnke.myopenid.com,
November 19, 2008 22:23,
2 refactorings
I need a fast method to che...
1 2 3 4
public static class DirectoryInfoExtensions { public static void CopyTo(this String Source, String Destination, Boolean Overwrite) ...
C# DirectoryInfo.CopyTo
Because the .NET Framework ...
1 2 3 4
public static class HtmlHelper { public static string StripHtmlComments(string html) { if (html == null) { ...
C# Strip Html Comments
Procedural style code to st...
1 2 3 4
public static class DependencySorter<T> { public static IEnumerable<T> Sort(Dictionary<T, IEnumerable<T>> dependencies) ...
C# Sorting by dependencies
This code sorts a collectio...
1 2 3
<?xml version="1.0" encoding="utf-8" ?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> ...
C# CSLA 3.5 property snippet
I'm sure I'm not the first ...
1 2 3
DateTime todayUTC = DateTime.Today.ToUniversalTime(); DateTime currentTimeUTC = todayUTC; ...
C# Generating a list of time v...
I need to generate a list o...
1 2 3
Declare @Index varchar(128) ...
C# Drop all Indexes in SQL Server
The below is some code I re...
1 2 3 4
public static void Capitalize() { TextInfo oTextInfo = CultureInfo.CurrentCulture.TextInfo; ...
C# Capitalize directory name w...
I wrote a method to capital...
1 2 3 4
public static string ToRelativeDate(DateTime input) { string suffix = "ago"; ...
C# Twitter-esque Relative Dates
Given an input date, this m...
1 2 3 4
private string getMD5String(string PlainText) { System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); ...
C# Cryptography with MD5
This is a simple example of...
1 2 3 4
using System.Security.Cryptography; public class CryptographyRSA() ...
C# Cryptography with RSA and B...
This is a simple example of...
1 2 3 4
namespace Utilities { using System; ...
C# StringExt.cs (String Extens...
Ok take it easy on me, I ju...
1 2 3 4
private static Regex _namedtags = new Regex (@"</?(?<tagname>\w+)[^>]*(\s|$|>)", RegexOptions.Singleline | RegexOptions.ExplicitCapture); ...
C# Balance HTML Tags
For the subset of HTML tags...
1 2 3
Declare @Name varchar(128) Declare @Cursor Cursor ...
C# Cache SQL Server Views
Question: Is there anyway t...
1 2 3 4
namespace DataSetTableAdapters { partial class MyTableAdapter { ...
C# TableAdapter and CommandTim...
by Auron,
July 02, 2008 10:19,
8 refactorings, tagged with tableadapter, commandtimeout, dataset, ado, C#, .net
As TableAdapters are are au...
1 2 3 4
public static List<T> MergeListCollections<T>(List<T> firstList, List<T> secondList) { List<T> mergedList = new List<T>(); ...
C# Merge generic lists
Toying with some utility me...
1 2 3 4
// ***** Encryption and Decryption ***** // byte[] Key(string sText) { ...
C# Encryption and Decryption
This is my first attempt at...
1 2 3 4
private static Regex _tags = new Regex("<[^>]*(>|$)", RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled); private static Regex _whitelist = new Regex(@" ^</?(a|b(lockquote)?|code|em|h(1|2|3)|i|li|ol|p(re)?|s(ub|up|trong|trike)?|ul)>$ ...
C# Sanitize HTML
Takes a provided HTML strin...
1 2 3 4
using System; using System.Collections.Generic; using System.Linq; ...
C# Pointers in C#
I am trying to work out how...
1 2 3 4
void CopySourceTables(List<TableNameResult> tables, int id) { // Execute the "Copy" Command on the Server for Each Table. ...
C# Common StProc Code
Hi guys, following my previ...
Have the below code which f...