Format:
Recent snippets for: tarasn
public class Email : IHideObjectMembers { private SmtpClient _client; public MailMessage Message { get; set; } private Email() { Message = new MailMessage() { IsBodyHtml = true }; _client = new SmtpClient(); }
137 Views
no comments
public class PerformanceTester { public TimeSpan TotalTime { get; private set; } public TimeSpan AverageTime { get; private set; } public TimeSpan MinTime { get; private set; } public TimeSpan MaxTime { get; private set; } public Action Action { get; set; } public PerformanceTester(Action action) {
219 Views
no comments
/* Usage string test1 = StripTags("<p>George</p><b>W</b><i>Bush</i>", new string[]{"i","b"}); string test2 = StripTags("<p>George <img src='someimage.png' onmouseover='someFunction()'>W <i>Bush</i></p>", new string[]{"p"}); string test3 = StripTags("<a href='http://www.dijksterhuis.org'>Martijn <b>Dijksterhuis</b></a>", new string[]{"a"}); */
219 Views
no comments
// usage: // var constructor = GetConstructor<Foo>(); // IFoo foo = constructor(); private static Func<T> GetConstructor<T>() where T : class, new() { ConstructorInfo constructorInfo = typeof(T).GetConstructor(new Type[0]); return Expression.Lambda<Func<T>>(Expression.New(constructorInfo)) .Compile();
406 Views
no comments
/// <summary> /// Return empty enumerator when passed enumerator equals to null /// </summary> /// <param name="source">The source.</param> /// <returns></returns> public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> source) { return source ?? Enumerable.Empty<T>(); }
167 Views
no comments
<Node> <ID>123</ID> <Name>ABC</Name> </Node> <Node1> <ID>124</ID> <Name>DEF</Name> </Node1>
228 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using Microsoft.Practices.Unity; using Microsoft.Practices.Unity.InterceptionExtension; using System.Collections; namespace ConsoleApplicationUnityIntercep
515 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
