Format:
Recent snippets matching tags of list
using System; using System.Windows; using System.Windows.Controls; using System.Windows.Interactivity; using System.Windows.Threading; namespace Behaviors { /// <summary> /// On ListBoxes using CanContentScroll=True (virtualized), WPF layout changes will make the scrollviewer reset to zero.
42 Views
no comments
List<Product> products = new List<Product>(); products.Sort(delegate(Product p1, Product p2) { return p1.ProductName.CompareTo(p2.ProductName); });
43 Views
no comments
public static IList<T> ToList<T>(this System.Data.SqlClient.SqlDataReader dr) where T : new() { Type type = typeof(T); if(System.Web.HttpContext.Current.Cache[type.Name + "_properties"] == null) { System.Web.HttpContext.Current.Cache.Insert(type.Name + "_properties", type.GetProperties().ToList()); } IList<PropertyInfo> properties = (IList<PropertyInfo>)System.Web.HttpContext.Current.Cache[type.Name + "_properties"]; IList<T> result = new List<T>(); while(dr.Read())
82 Views
no comments
/* Implementing BFS using adjacency list Author: Rahul P Language: ANSI-c */ #include <stdio.h> #include <stdlib.h> #define INFINITY 999999 #define WHITE 0
34 Views
no comments
<asp:ListView ID="ListView_Example" runat="server" > <LayoutTemplate> <ul> <asp:PlaceHolder ID="PlaceHolder_Example" runat="server" /> </ul> </LayoutTemplate> <ItemTemplate> <li> <a href="<%=Eval("ExampleLink")%>"><%=Eval("ExampleName")%></a><%=Eval("ExampleSeparator")%> </li>
70 Views
no comments
DropDownList.SelectedIndex = DropDownList.Items.IndexOf(DropDownList.Items.FindByValue("Value"));
80 Views
no comments
/* * Дек (свързан списък) * * @author Михаил Николов * @version 1.0 * @date 4.06.2011 * */ #include <iostream>
80 Views
no comments
/* * Опашка (свързан списък) * * @author Михаил Николов * @version 1.0 * @date 4.06.2011 * */ #include <iostream>
70 Views
no comments
/// <summary> /// Serialize anything /// </summary> /// <param name="serializeMe"></param> /// <returns></returns> public static string Serialize<T>(T serializeMe) { var serializer = new XmlSerializer(serializeMe.GetType()); var ms = new MemoryStream(); serializer.Serialize(ms, serializeMe);
97 Views
no comments
/// <summary> /// An entry that can be either a single ip or a range /// </summary> public class IpEntry { public string StartRange { get; set; } public string EndRange { get; set; } public bool IsRange
196 Views
2 comments
// cria uma string com n caracteres
function IncStr( Str: String; Qtd: Integer ): String;
var v_Str: String;
begin
v_Str := Str;
While Length( SysUtils.Trim( Str ) ) < Qtd do
Str := v_Str+ SysUtils.Trim(Str);
// Retorno da Funcao.
Result := Str;
end;
167 Views
no comments
var
list: TStringList;
begin
list := TStringList;
try
list.Add( 'Testando' );
ListBox1.Items.Assign( list );
finally
list.free;
end;
204 Views
no comments
Como faço para listar os tipos enumerados de força mais fácil e dinâmica num ComboBox? Essa foi a pergunta de uma grande amigo meu hoje. Confesso que não tinha muita idéia de como fazer. Imagine a situação: type TMeuTipo = (Tipo1, Tipo2, Tipo3, Tipo4, Tipo5); Como fazer isso aparecer em um ComboBox? Bem, podemos transformar isso em Strings e então adicioná-lo ao Combo, mais ou menos assim:
287 Views
no comments
// Define a list by enclosing the item type in brackets [int] // and initialize its value. Scores : [int] = [ 92, 100, 85, 62, 81, 100 ]; // Option A // require the stream type to be specified on a property PassingScores : int* {
235 Views
no comments
// Select all ItemList.Items.Cast<ListItem>().All(a => a.Selected = true); // Select correct value in Dropdownlist dropDownList.SelectedIndex = dropDownList.Items.IndexOf( dropDownList.Items.FindByValue(BusinessCollection.ID.ToString())); radioButtonList.SelectedIndex = radioButtonList.Items.IndexOf(
197 Views
no comments
// =================================================================== // Author: Matt Kruse <matt@mattkruse.com> // WWW: http://www.mattkruse.com/ // // NOTICE: You may use this code for any purpose, commercial or // private, without any further permission from the author. You may // remove this notice from your final code if you wish, however it is // appreciated by the author if at least my web site address is kept. // // You may *NOT* re-distribute this code in any way except through its
330 Views
no comments
/********************/ /* ListaCirculara.h */ /********************/ #ifndef LISTA_CIRCULARA #define LISTA_CIRCULARA struct nod { nod *next;
146 Views
no comments
/**************************/ /* ListaDubluInlantuita.h */ /**************************/ #ifndef LISTA_DUBLA #define LISTA_DUBLA struct nod { nod *llink;
139 Views
no comments
/***************************/ /* ListaSimpluInlantuita.h */ /***************************/ #ifndef LISTA_SIMPLA #define LISTA_SIMPLA struct nod { int val;
148 Views
no comments
/// <summary> /// Sorts the list box in descending order /// </summary> /// <param name="pList">the list to sort</param> /// <param name="pByValue">Sort the list by values or text</param> private void SortListBox(ref ListBox pList, bool pByValue) { var lListItems = new System.Collections.SortedList(); //add listbox items to SortedList
1489 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
