Click here to Skip to main content
15,895,871 members
Home / Discussions / C#
   

C#

 
QuestionQuestion regarding a timeout in tcpClient Pin
Green Fuze19-Oct-07 0:36
Green Fuze19-Oct-07 0:36 
AnswerRe: Question regarding a timeout in tcpClient Pin
leppie19-Oct-07 4:53
leppie19-Oct-07 4:53 
QuestionJoypad! Pin
pokabot19-Oct-07 0:32
pokabot19-Oct-07 0:32 
AnswerRe: Joypad! Pin
martin_hughes19-Oct-07 0:42
martin_hughes19-Oct-07 0:42 
GeneralRe: Joypad! Pin
pokabot20-Oct-07 8:04
pokabot20-Oct-07 8:04 
Questiondeclaring user defined class arrays Pin
jikubhai19-Oct-07 0:29
jikubhai19-Oct-07 0:29 
AnswerRe: declaring user defined class arrays Pin
DavidNohejl19-Oct-07 1:25
DavidNohejl19-Oct-07 1:25 
AnswerRe: declaring user defined class arrays Pin
DaveyM6919-Oct-07 1:37
professionalDaveyM6919-Oct-07 1:37 
The easiest way is using the System.Collections.Generic namespace, it automatically gives you most of the methods you need (Add etc...) and you can create any others you need.

i.e.
using System.Collections.Generic;

namespace TestNamespace
{
    class Authentication
    {
        public void method1()
        {
        }
    }

    class AuthenticationCollection
    {
        private List<Authentication> _Items;
        public List<Authentication> Items
        {
            get
            {
                return _Items;
            }
            set
            {
                _Items = value;
            }
        }
        public AuthenticationCollection()
        {
            _Items = new List<Authentication>();
        }
    }
}


To call method1, simply use the index of the Item in the collection when instanciated and filled.

using System.Windows.Forms;
using TestNamespace;

namespace MyApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Load += new System.EventHandler(Form1_Load);
        }

        void Form1_Load(object sender, System.EventArgs e)
        {
            Authentication myAuth1 = new Authentication();
            Authentication myAuth2 = new Authentication();
            AuthenticationCollection myCollection = new AuthenticationCollection();
            myCollection.Items.Add(myAuth1);
            myCollection.Items.Add(myAuth2);
            myCollection.Items[0].method1();
        }
    }
}


Dave
QuestionThis is my first post Pin
Challavijju19-Oct-07 0:26
Challavijju19-Oct-07 0:26 
AnswerRe: This is my first post Pin
Abhijit Jana19-Oct-07 1:35
professionalAbhijit Jana19-Oct-07 1:35 
QuestionProblem accessing Exchange server from windows vista [modified] Pin
Suj_7819-Oct-07 0:21
Suj_7819-Oct-07 0:21 
QuestionDelegates Pin
kabutar19-Oct-07 0:04
kabutar19-Oct-07 0:04 
AnswerRe: Delegates Pin
leppie19-Oct-07 4:55
leppie19-Oct-07 4:55 
QuestionShould we use 'ref' keyword while passing objects also... Pin
Spunky Coder19-Oct-07 0:04
Spunky Coder19-Oct-07 0:04 
AnswerRe: Should we use 'ref' keyword while passing objects also... Pin
DavidNohejl19-Oct-07 0:33
DavidNohejl19-Oct-07 0:33 
GeneralRe: Should we use 'ref' keyword while passing objects also... Pin
Spunky Coder19-Oct-07 0:46
Spunky Coder19-Oct-07 0:46 
GeneralRe: Should we use 'ref' keyword while passing objects also... Pin
DavidNohejl19-Oct-07 1:00
DavidNohejl19-Oct-07 1:00 
GeneralRe: Should we use 'ref' keyword while passing objects also... Pin
Spunky Coder19-Oct-07 1:04
Spunky Coder19-Oct-07 1:04 
GeneralRe: Should we use 'ref' keyword while passing objects also... Pin
DavidNohejl19-Oct-07 1:32
DavidNohejl19-Oct-07 1:32 
AnswerRe: Should we use 'ref' keyword while passing objects also... Pin
Stefan Troschuetz19-Oct-07 0:38
Stefan Troschuetz19-Oct-07 0:38 
AnswerRe: Should we use 'ref' keyword while passing objects also... Pin
laserbaronen19-Oct-07 0:41
laserbaronen19-Oct-07 0:41 
AnswerRe: Should we use 'ref' keyword while passing objects also... Pin
Spunky Coder19-Oct-07 1:01
Spunky Coder19-Oct-07 1:01 
Questionset CurrentRow in a DataGridView Pin
jmaalouly18-Oct-07 23:29
jmaalouly18-Oct-07 23:29 
AnswerRe: set CurrentRow in a DataGridView Pin
leppie19-Oct-07 5:05
leppie19-Oct-07 5:05 
QuestionToolStripMenuItems from SQL Pin
hobbsieoz18-Oct-07 23:18
hobbsieoz18-Oct-07 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.