IW1QLH
Ham radio ed altro ancora...
Advertisement
Home arrow Articles
Thursday, 20 November 2008
Main Menu
Home
Project - Software
Projects - Hardware
Articles
Meteo italia
Il mio lavoro
Links
SSTV Web Ring
Contatti
Cerca
Libri
Log book
Download
Forum
HRD Label Download
Last stable version
Development release
Latest files
Sep.25
66
FileTable Manager 3.0 alpha
Jul.11
440
FileHRD Label 2.0
Jul.11
418
FileTable Manager 2.5.14
Jun.27
96
FileMeteosat & Italian Weather Module 3.2.0 - Drupal 6.x
Jun.27
29
FileMeteosat & Italian Weather Module 3.2.0 - Drupal 5.x
Most Downloaded
Jul.13
2777
File iconTable Manager 1.0.3-exp
May.09
2179
File iconTable Manager 1 in 14 step
May.09
2013
File iconDigital hit counter 1.0
Jun.21
1447
File iconTable manager 2 - Formatting fields
May.18
1373
File iconTable Manager mambot/plugin 1.0.0
Init a constant array PDF Print E-mail
ASPX.CS C# - How to init an array and a List (Collection in DELPHI)

// struct is like Record in DELPHI
public struct CountryCode
{
    public string Country;
    public int Code;

    public CountryCode(string ACountry, int ACode)
    {
       Country = ACountry;
       Code = ACode;
    }
}

// init and fill the array
static readonly
CountryCode[] CountriesArray =  new CountryCode[]
        {
            new CountryCode("USA", 1),
            new
CountryCode("CANADA", 1),
            new
CountryCode("EGYPT", 20),
            new
CountryCode("GREECE", 30),
            new CountryCode("ITALY", 39)
        };

// init List with a pre-existing array
static readonly List<CountryCode> CountriesList1 = new List<CountryCode>(CountriesArray);

// init List directly
static readonly List<CountryCode> CountriesList2 = new List<CountryCode>(
            new
CountryCode[]
        {
            new CountryCode("USA", 1),
            new
CountryCode("CANADA", 1),
            new
CountryCode("EGYPT", 20),
            new
CountryCode("GREECE", 30),
            new CountryCode("ITALY", 39)
        });
Last Updated ( Thursday, 04 October 2007 )
Next >
Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one
TopHost

Tophost Hosting

 
Tophost Hosting
Copyright 2000 - 2005 Miro International Pty Ltd. All rights reserved.
Mambo is Free Software released under the GNU/GPL License.
Design by Mamboteam.com | Powered by Mambobanner.de