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 control
<?php
 
abstract class Controller
{
 
    protected function __construct()
    {
        $this->that = $this;
    }
by rgb   December 29, 2011 @ 4:02am
35 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
92 Views
no comments
 
C#
/* 
 * Escrito por Jone Polvora - jpolvora@gmail.com
 * Julho2011
 * Novidades: Convenção para resolver interfaces (IClasse, Classe)
 * Resolver por String
 * Resolver com parâmetros
 * Escopo de registro
 * Objetos registrados com WeakReference
 */
 
by Jone   August 01, 2011 @ 10:47pm
97 Views
no comments
 
''' <summary>
''' An Extension of the ControlCollection
''' </summary>
''' <param name="controls"></param>
''' <returns>An Enumerable collection of all of the controls in a ControlCollection</returns>
''' <remarks></remarks>
<Extension()> _
Public Function All(ByVal controls As ControlCollection) As IEnumerable(Of Control)
    Dim results As New List(Of Control)
    For Each Control As Control In controls
by Thom Lamb   June 13, 2011 @ 10:39am
127 Views
no comments
 
C#
public static Control FindControlUsingStack(Control root, string id)
{
   // Seed it.
   Stack<Control> stack = new Stack<Control>();
   stack.Push(root);
 
   while(stack.Count > 0)
   {
      Control current = stack.Pop();
      if (current.ID == id)
by Arjan   June 24, 2010 @ 4:06am
152 Views
no comments
 
C#
/// <summary>
/// Holds up the test execution for the given duration without blocking the UI thread.
/// </summary>
void UIPause(int sec)
{
    Storyboard PauseSB = new Storyboard() { Duration = new Duration(new TimeSpan(0, 0, sec)) };
    PauseSB.Completed += (sender, e) => { TestComplete(); };
    PauseSB.Begin();
}
454 Views
no comments
 
<Extension()> _
Public Function GetBindingInfo(ByVal DataLayoutControl As DataLayoutControl, _
                               Optional ByVal ExcludePropetries As String = "") As List(Of DataLayoutBindingInfo)
    Dim bh As New LayoutElementsBindingInfoHelper(DataLayoutControl)
    Dim info As LayoutElementsBindingInfo = bh.CreateDataLayoutElementsBindingInfo
    GetBindingInfo = (From x As LayoutElementBindingInfo In info.GetAllBindings _
                      Where (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludeNames)) _
                      And (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludePropetries)) _
                      Select New DataLayoutBindingInfo(x.DataInfo.Name, x.DataInfo.Caption, x.Visible, x.EditorType)).ToList
End Function
by Thom Lamb   May 19, 2010 @ 7:42am
288 Views
no comments
 
C#
private void button_Click(object sender, EventArgs e) 
{ 
    // pass in the containing panel 
    LoadControl<MyControls.MyControl>(panelContainer); 
} 
 
void LoadControl<T>(Panel panel) where T : Control, new() 
{ 
    T _Control = GetControl<T>(panel); 
    if (_Control == null) 
by Jerry Nixon   March 05, 2010 @ 8:17am
538 Views
no comments
 
Public Class ctlDragableSizable
 
    ' Locked when parent control handles the resizing
    Private blnIsResizeLocationLocked As Boolean = False
 
    Private intXMouseDownPosition As Integer
    Private intYMouseDownPosition As Integer
 
    Private blnSizableVertical As Boolean = False
    Private blnSizableHorizontal As Boolean = False
by Mitchell William Cooper   January 05, 2010 @ 7:57am
568 Views
no comments
 
C#
<system.web>
  <pages>
    <controls>
      <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
      <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>
  </pages>
</system.web>
by afsharm   December 24, 2009 @ 5:00am
388 Views
no comments
 
C#
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
 
// create a new work item linked to an existing item in version control
static void CreateLinkedWorkItem(String teamProject, String workItemType)
{
    using (var tfs = TeamFoundationServerFactory.GetServer(_ServerUri))
    {
        var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
 
by Jim Lamb   October 29, 2009 @ 8:01pm
397 Views
no comments
 
C#
using Microsoft.TeamFoundation.VersionControl.Client;
 
// query the version control repository for items matching a file specification
// set the folder for the root of your search
String rootFolder = "$/MyProject";
 
// construct the set of item specifications you want to search for
ItemSpec[] itemSpecs = new ItemSpec[] { 
    new ItemSpec(String.Format("{0}/*.sln", rootFolder), RecursionType.Full),
};
by Jim Lamb   October 29, 2009 @ 7:54pm
207 Views
no comments
 
C#
 
// Renders ANY control into HTML
public static string RenderControl(Control ctrl)
{
    StringBuilder sb = new StringBuilder();
    StringWriter tw = new StringWriter(sb);
    HtmlTextWriter hw = new HtmlTextWriter(tw);
 
    ctrl.RenderControl(hw);
    return sb.ToString();
by Groove Commerce   August 27, 2009 @ 11:32am
227 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using Westwind.Utilities;
using System.ServiceModel.Syndication;
using CodePasteBusiness;
using System.Text;
using System.Collections;
using System.IO;
by Rick Strahl   August 10, 2009 @ 4:44pm
1013 Views
no comments
 
C#
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MensajeGeneralError.ascx.cs"
    Inherits="Syllabus_PL.UserControls.WebUserControl1" %>
<table cellspacing="0" cellpadding="0" class="cf ve">
    <tbody>
        <tr>
            <td class="vj">
            </td>
            <td class="vi" />
            <td class="vk" />
        </tr>
by Claudia Hidalgo   August 10, 2009 @ 12:56pm
226 Views
no comments
 
C#
public static string Control<ControlType>(this HtmlHelper htmlHelper, string name, 
                                          ControlType control, object htmlAttributes) 
                                        where ControlType : BaseControl
{
    control.HtmlHelper = htmlHelper;
    control.UrlHelper = new UrlHelper(htmlHelper.ViewContext.RequestContext);
    control.Id = name;
    control.MergeAttributes(htmlAttributes);
    return control.Render();
}
by Rick Strahl   July 29, 2009 @ 7:46am
420 Views
no comments
 
<td>
<%= Html.DateField("ToDate",
   new DateControl
   {
       CssClass = "datefield",
       SelectedDate = Model.Parameters.ToDate,
       DateFormat = "mm/dd/yyyy"
   },
   new { style = "min-width: 150px;" } )
%></td>
by Rick Strahl   July 29, 2009 @ 6:43am
234 Views
1 comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Routing;
 
namespace CodePasteMvc.Controllers
{
by Rick Strahl   July 20, 2009 @ 3:34pm
660 Views
no comments
 
C#
public class ShowSnippetViewModel
{
   
 
    public ShowSnippetViewModel(SnippetController controller)
    {
        this.Controller = controller;
    }
   SnippetController Controller = null;
by Rick Strahl   July 18, 2009 @ 4:38pm
190 Views
no comments
 
C#
public string GetTagLinkList(string tags)
{
    if (string.IsNullOrEmpty(tags))
        return string.Empty;
 
    string[] tagStrings = tags.Split( new char[1] {','}, StringSplitOptions.RemoveEmptyEntries);
 
    StringBuilder html = new StringBuilder();
    foreach (string tagString in tagStrings)
    {
by Rick Strahl   July 18, 2009 @ 3:41pm
199 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