Format:
Recent snippets matching tags of Control
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)
23 Views
no comments
/// <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(); }
69 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
44 Views
no comments
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)
121 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Text.RegularExpressions; using System.Reflection; using Activity_Search.Code; namespace Activity_Search.Controllers
80 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
171 Views
no comments
<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>
108 Views
no comments
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));
133 Views
no comments
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), };
68 Views
no comments
// 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();
85 Views
no comments
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;
502 Views
no comments
<%@ 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>
75 Views
no comments
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(); }
181 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>
121 Views
1 comments
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 {
284 Views
no comments
public class ShowSnippetViewModel { public ShowSnippetViewModel(SnippetController controller) { this.Controller = controller; } SnippetController Controller = null;
80 Views
no comments
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) {
92 Views
no comments
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 {
109 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
