inaccessible due to protection level HELP?!

B

BlueOysterCult

Hello
I can't get around the error "inaccessible due to its protection
level" - it points at a line that I am using .Sort() and
BinarySearch() - but the real problem lies in another part of the
code below(because the error says College.Persons_ThePersons....):

///
/// Summary description for Persons.
///
public class Persons
{
private ArrayList _ThePersons;

public Persons()
{
_ThePersons = new ArrayList();
}

public Persons(params Person [] arr)
{
// initialize the instance field _ThePersons
_ThePersons = new ArrayList();

// Add the person reference to the array list.
for (int i=0; i)
{
_ThePersons.Add(arr);
}
}



// Indexer
public Person this [int index]
{
get
{
if (index >= 0 && index <= Count-1)
return (Person)_ThePersons[index];
else
return null;
}

set
{
if (index < 0)
{} //do nothing?
else if (index > 0 && index < Count-1)
_ThePersons[index] = value;
else
_ThePersons.Add(value);

}

}


//Properties
public int Count // Read-Only Property
{
get
{
return _ThePersons.Count;
}
}


public ArrayList ThePerson
{
get
{
return _ThePersons;
}
}


}


I believe some of its nested and that's why? Anyway, can someone see
something? I have been looing at it for a long time now and am not
seeing anything(really...)

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top