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 Dictionary
C#
public void IterateMethod(Dictionary<string, object>() items)
{
    // or var
    foreach (KeyValuePair<string, object> item in items)
    {
        // do something with item
    }
}
by Cat   November 11, 2010 @ 2:19am
104 Views
no comments
 
C#
var customEditControls = new Dictionary<GridColumn, RepositoryItem>()
{
    {colCountry, reposCountry},
    {colCountry_Code, reposCountryCode},
    {colState, reposState},
    {colState_Code, reposStateCode},
    {colBuilding_Scheme, reposBuldingScheme},
    {colBuilding_Class, reposBuildingClass},
    {colOccupancy_Scheme, reposOccupancyScheme},
    {colOccupancy_Code, reposOccupancyCode}
by Cat   October 01, 2010 @ 1:52am
136 Views
no comments
 
C#
enum ReportTypes 
{
   Country, CountryState, CountryStateZone, CountryStatePostCode, CountryZone, CountryStateCounty
}
 
var reportTypes = new Dictionary<int, string> () 
    { 
        {(int)ReportType.Country, "By Country"},
        {(int)ReportType.CountryState, "By Country, State"},
        {(int)ReportType.CountryStateZone, "By Country, State, Zone"},
by Cat   June 01, 2010 @ 4:55am
425 Views
no comments
 
C#
[XmlRoot("dictionary")]
public class XmlSerializableDictionary<TKey, TValue>
   : Dictionary<TKey, TValue>, IXmlSerializable {
 
   #region Constructors
   public XmlSerializableDictionary() : base() { }
 
   public XmlSerializableDictionary(IDictionary<TKey, TValue> dictionary) : base(dictionary) { }
 
   public XmlSerializableDictionary(IEqualityComparer<TKey> comparer) : base(comparer) { }
by Athens Springer   December 17, 2009 @ 10:34pm
319 Views
no comments
 
C#
[Serializable, ComVisible(false), DebuggerTypeProxy(typeof(Mscorlib_DictionaryDebugView<,>)), DebuggerDisplay("Count = {Count}")]
public class Dictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, ISerializable, IDeserializationCallback
{
    // Fields
    private object _syncRoot;
    private int[] buckets;
    private IEqualityComparer<TKey> comparer;
    private const string ComparerName = "Comparer";
    private int count;
    private Entry<TKey, TValue>[] entries;
by Athens Springer   October 29, 2009 @ 12:45pm
Tags: C#, Dictionary
498 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