public partial class FormRestaurant : Form
public Tables[] AllTables = new Tables[4];
I create an array of type Tables which is a class that I made. If I try to reference this from a third class (Parties.cs) by doing:
public void AssignTable()
{
for (int i = 0; i < **FormRestaurant.AllTables**.Length; i++)
{
if (**FormRestaurant.AllTables[i]**.TableCapacity <= PartySize)
{
}
}
}
I am told that I need an object reference. How exactly do I do this?
I tried making the array static but it didn't seem to work. Also I get this error when I try to make the AllTables array public.
Error 1 Inconsistent accessibility: field type 'Restaurant_Spil.Tables[]' is less accessible than field 'Restaurant_Spil.FormRestaurant.AllTables'
Tablesclass is also publicly accessible.TablesClass public ?Restaurant_Spil.Tables[]? your instance variable?