New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching language of C#
C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
Today @ 2:40pm
Tags:
3 Views
no comments
 
C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
Today @ 2:22pm
Tags:
5 Views
no comments
 
C#
shapecollage
Today @ 1:43pm
Tags:
4 Views
no comments
 
C#
public class FullScreenCommand : ICommand
{
    public event EventHandler CanExecuteChanged;
 
    public bool CanExecute(object parameter)
    {
        bool isFullScreen = (bool.TryParse(parameter.ToString(), out isFullScreen)) ? isFullScreen : true;
 
        return Application.Current.Host.Content.IsFullScreen != isFullScreen;
    }
33 Views
no comments
 
C#
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
    if (this.listView1.SelectedItems.Count == 0)
    {
        this.pictureBoxRight.Image = null;
    }
    else
    {
        MyRow tag = (MyRow) this.listView1.SelectedItems[0].Tag;
        utils.load(Image.FromStream(new MemoryStream(tag.photo)), this.pictureBoxRight);
Today @ 8:42am
Tags:
6 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
Today @ 8:36am
Tags:
7 Views
no comments
 
C#
FormSearch search = new FormSearch();
            search.Owner = this;
            if (search.ShowDialog() == DialogResult.OK)
            {
                this.sqlSelectCommand1.Parameters.Clear();
                this.dataSetPhotosoc1Instance.Clear();
               
 
                if (search.radioButton1.Checked)
                {
Today @ 8:23am
Tags:
6 Views
no comments
 
C#
public interface IDummyFactory
{
    IDummyService CreateDummyService();
    TService CreateService<TService>();
    IHandler<TMessage> CreateHandler<TMessage>();
    object CreateService(Type pluginType);
}
Today @ 5:23am
Tags:
91 Views
no comments
 
C#
[DataContract]
public class UserBooleanDecision
{
  [DataMember]
  public bool? Decision { get; set; }
 
  [DataMember]
  public bool RequiresAnswer { get; set; }
}
by Mike Minutillo   Yesterday @ 11:20pm
Tags:
31 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Linq;
 
namespace HelpDesk.Models {
    public interface IGenericRepository {
        IQueryable<T> Get<T>() where T : class;
        void Insert<T>(T item) where T : class;
by davecowart   Yesterday @ 1:49pm
5 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
 
namespace DynamicObjectContracts
{
    public class Program
by Glenn Block   Yesterday @ 9:32am
Tags: Dynamic, MEF
176 Views
no comments
 
C#
public class ErrorModel : IEnumerable<string>
{
    public IEnumerator<string> GetEnumerator()
    {
        throw new NotImplementedException();
    }
 
    IEnumerator IEnumerable.GetEnumerator()
    {
        return GetEnumerator();
by Jeremy Brayton   Yesterday @ 9:01am
6 Views
no comments
 
C#
while(true)
{
    events.Publish(new ConsoleKeyPressedEvent
    {
        Info = Console.ReadKey();
    }
}
by Anthony Mastrean   Yesterday @ 8:05am
Tags:
6 Views
no comments
 
C#
int c = 0;
//sm
by    Yesterday @ 7:42am
Tags:
5 Views
no comments
 
C#
class GeomAssign
    {
        Texture2D _sprite;
        List<Geom> _geoms;
 
        public GeomAssign(Texture2D Sprite, ref List<Geom> Geoms)
        {
            _geoms = Geoms;
            _sprite = Sprite;
        }
Yesterday @ 7:22am
Tags:
10 Views
no comments
 
C#
new Country { Name = "Anguilla", Region = "The Americas" },
new Country { Name = "Antigua and Barbuda", Region = "The Americas" },
new Country { Name = "Argentina", Region = "The Americas" },
new Country { Name = "Aruba", Region = "The Americas" },
new Country { Name = "Bahamas", Region = "The Americas" },
new Country { Name = "Barbados", Region = "The Americas" },
new Country { Name = "Belize", Region = "The Americas" },
new Country { Name = "Bermuda", Region = "The Americas" },
new Country { Name = "Bolivia", Region = "The Americas" },
new Country { Name = "Brazil", Region = "The Americas" },
Yesterday @ 5:41am
Tags:
10 Views
no comments
 
C#
  [TestMethod]
        public void test56()
        {
            // Fixture setup
            // Exercise system
            // Verify outcome
by slamidtfyn   Yesterday @ 5:09am
Tags:
7 Views
no comments
 
C#
//Get the current title product
            int titleID = Convert.ToInt32(Request.QueryString["TitleID"]);
 
            Products title = db.Products.Where(t => t.ProductID == titleID).FirstOrDefault();
 
            //Get a SearchItem.cs for this title
            BLL.Search oSearch = new BLL.Search();
            BLL.SearchItem si = oSearch.BuildSearchItem(title);
 
            if (si.SeriesID == 0)
Yesterday @ 4:09am
Tags:
10 Views
no comments
 
C#
//---------------------------------------------------------------------
// <autogenerated>
//
//     Generated by Message Compiler (mc.exe)
//
//     Copyright (c) Microsoft Corporation. All Rights Reserved.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </autogenerated>
by naveensrinivasan   Tuesday @ 9:45pm
Tags: etw
10 Views
no comments
 
C#
using System;
using System.Runtime.Serialization;
using System.Threading;
using System.Diagnostics;
 
namespace SMSServer.Exceptions
{
    /// <summary>
    /// Custom exception class.
    /// </summary>
Tuesday @ 2:05pm
Tags:
6 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using log4net;
 
namespace SMSServer.Exceptions
{
    public class SMSException : Exception
Tuesday @ 1:15pm
Tags:
9 Views
no comments
 
C#
List<BLL.SearchItem> relatedProducts = new List<BLL.SearchItem>(4);
           BLL.Search oSearch = new BLL.Search();
           db.RelatatedProducts.Include("ProductsRelated").Where(rp => rp.ProductID == 8)
                                                             .OrderBy(rp => rp.Rank)
                                                             .Take(4)
                                                             .ToList()
                                                             .ForEach(rp => relatedProducts.Add(oSearch.BuildSearchItem(rp.ProductsRelated)));
Tuesday @ 8:36am
Tags:
9 Views
no comments
 
C#
List<BLL.SearchItem> relatedProducts = new List<BLL.SearchItem>(4);
BLL.Search oSearch = new BLL.Search();
db.RelatatedProducts.Include("Products").Where(rp => rp.ProductID == 8)
                                                  .OrderBy(rp => rp.Rank)
                                                  .Take(4)
                                                  .ToList()
                                                  .ForEach(rp => relatedProducts.Add(oSearch.BuildSearchItem(rp.Products)));
Tuesday @ 5:57am
Tags:
9 Views
no comments
 
C#
List<BLL.SearchItem> relatedProducts = new List<BLL.SearchItem>(4);
           BLL.Search oSearch = new BLL.Search();
           db.RelatatedProducts.Include("Products").Where(rp => rp.ProductID == 8)
                                                   .Take(4)
                                                   .ToList()
                                                   .ForEach(rp => relatedProducts.Add(oSearch.BuildSearchItem(rp.Products)));
Tuesday @ 5:33am
Tags:
8 Views
no comments
 
C#
 
using System.Collections.Generic;
using System.Collections.ObjectModel;
 
namespace Microsoft.Practices.Composite
{
    public static class CollectionExtensions
    {
        public static Collection<T> AddRange<T>(this Collection<T> collection, IEnumerable<T> items);
    }
Monday @ 1:01pm
Tags:
6 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