CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of C#
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Dynamic;
using System.Reflection;
 
namespace Westwind.Utilities
{
    /// <summary>
    /// Class that provides extensible properties and methods. This
by Rick Strahl   Tuesday @ 5:48pm
Tags: C#, Expando, MixIn
210 Views
1 comments
 
C#
protected void Page_Load(object sender, EventArgs e)
{
    if (HttpContext.Current.Request.IsAuthenticated)
    {
        ResetFormsAuthenticationTicket();
    }
    else
    {
        Response.Redirect("~/logout.aspx");
    }
by Kent   January 22, 2012 @ 7:26pm
15 Views
no comments
 
C#
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
 
namespace System.Text {
    public static class StringTransformer {
        static readonly string linkFormat = "<a href=\"{0}\" title=\"{0}\" target=\"{2}\" class=\"{3}\">{1}</a>";
 
        /// <summary>
by SandRock   January 20, 2012 @ 11:21am
Tags: C#, url, html, link
25 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Web;
 
/// <summary>
/// Summary description for OrderByHelper
/// </summary>
by jaredmroberts   January 12, 2012 @ 4:49pm
20 Views
no comments
 
C#
// FlowDesign C#, classic EBC
// 4.1.2012, Christof Konstantinopoulos
// Diagram : https://cacoo.com/diagrams/Vy5LOUn5NfhTARzj
 
// File : Program.cs
 
namespace FlowDesign_KlassischesEBC
{
    class Program
    { 
by Christof Konstantinopoulos   January 04, 2012 @ 6:59am
Tags: EBC, C#
37 Views
1 comments
 
C#
using System;
using System.Text;
 
namespace MwSt_cSharp
{
    class Program
    {
        static Platine MainBoard = null;
 
        static void Main(string[] args)
by Christof Konstantinopoulos   December 31, 2011 @ 12:06pm
27 Views
no comments
 
C#
namespace Westwind.Utilities.Data
{
    /// <summary>
    /// This class provides an easy way to turn a DataRow 
    /// into a Dynamic object that supports direct property
    /// access to the DataRow fields.
    /// 
    /// The class also automatically fixes up DbNull values
    /// (null into .NET and DbNUll to DataRow)
    /// </summary>
by Rick Strahl   December 27, 2011 @ 3:56pm
188 Views
no comments
 
C#
namespace DataFieldMappingConsoleSample
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.SqlClient;
    using System.Linq;
 
    class Program
    {
27 Views
no comments
 
C#
namespace DataFieldMappingConsoleSample
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Diagnostics;
    using System.Linq;
    using System.Reflection;
 
    [AttributeUsage(AttributeTargets.Property)]
20 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
 
namespace Westwind.Web.Services
{
    /// <summary>
    /// Implements the Gravatar API for retrieving a Gravatar image to display
by Rick Strahl   December 15, 2011 @ 4:08pm
Tags: Gravatar, C#, .NET
216 Views
2 comments
 
C#
Rectangle m_Rectangle;
TranslateTransform m_Transform;
Microsoft.Devices.Sensors.Accelerometer m_Accelerometer;
 
public MainPage()
{
    InitializeComponent();
    Loaded += MainPage_Loaded;
    Unloaded += (s, e) => { m_Accelerometer.Stop(); };
}
by Jerry Nixon   December 13, 2011 @ 11:03am
114 Views
no comments
 
C#
static void Main(string[] args)
{
    Console.WriteLine(PhoneNumber("12345678901234"));
    Console.WriteLine(PhoneNumber("1234567890123"));
    Console.WriteLine(PhoneNumber("123456789012"));
    Console.WriteLine(PhoneNumber("12345678901"));
    Console.WriteLine(PhoneNumber("1234567890"));
    Console.WriteLine(PhoneNumber("123456789"));
    Console.WriteLine(PhoneNumber("12345678"));
    Console.WriteLine(PhoneNumber("1234567"));
by Jerry Nixon   December 06, 2011 @ 8:10am
Tags: C#, Format
70 Views
no comments
 
C#
public abstract class ViewModelBase : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;
    protected void RaisePropertyChanged(string property)
    {
        if (PropertyChanged == null)
            return;
        PropertyChanged(this,
            new PropertyChangedEventArgs(property));
        PropertyChanged(this,
by Jerry Nixon   November 08, 2011 @ 10:39am
Tags: MVVM, C#
97 Views
no comments
 
C#
public static IEnumerable<Orders> ExcludeOrderTypes(this IEnumerable<Orders> orders, int[] orderTypeIdsToExclude)
{
 
    if ((orders == null || orders.Count == 0)) {
        return new List<Orders>();
    }
 
    if ((orderTypeIdsToExclude == null)) {
        return orders;
    }
by Cat   October 30, 2011 @ 11:07pm
Tags: C#, LINQ, Exclude
32 Views
no comments
 
C#
// Format names as one comma delimited string
var names  = string.Join(", ", (from p in people select d.Name).ToArray());
by Cat   October 30, 2011 @ 3:31pm
Tags: C#, LINQ
47 Views
no comments
 
C#
public MainPage()
{
    InitializeComponent();
 
    var _List = new List<InputScopeNameValue>();
    for (int i = 0; i < 100; i++)
        _List.Add((InputScopeNameValue)i);
    listBox1.ItemsSource = _List;
}
by Jerry Nixon   October 25, 2011 @ 12:54pm
Tags: WP, C#
55 Views
1 comments
 
C#
using System;
 
namespace ConsoleApplication1
{
    public delegate int  Procesar( int x , int y);
 
    public class Calculo
    {
        public int Sumar ( int x, int y )
        {
by racsonp   October 14, 2011 @ 11:41pm
Tags: CSharp, C#, dotNet
46 Views
no comments
 
C#
/// <summary>
/// Creates a Connection string from Conf.xml
/// </summary>
/// <param name="isEntityConnection">
/// The is Entity Connection.
/// </param>
/// <param name="serverName">
/// The server Name.
/// </param>
/// <param name="databaseName">
by Sigurður Bjarnason   October 10, 2011 @ 8:53am
48 Views
no comments
 
C#
public static class UnityContainerExtensions
{
    public static void AssertMappingsAreValid(this IUnityContainer container)
    {            
        foreach (var registration in container.Registrations)
        {
            container.Resolve(registration.RegisteredType, registration.Name);
        }
    }
}
by Byteflux   October 04, 2011 @ 10:36pm
90 Views
no comments
 
C#
   public static UserPrincipal GetUserAdInfo(string domainName, string loginName)
   {
       PrincipalContext ctx = new PrincipalContext(ContextType.Domain, domainName);
 
       UserPrincipal user = UserPrincipal.FindByIdentity(ctx, loginName); 
 
       if(user != null) 
       {
           return user;
       }
by jaredmroberts   September 30, 2011 @ 4:24pm
68 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate