I know from the title you would say it's a duplicate, but...
So, I have created my class and made some objects (of class Masina
) in MainWindow
class constructor:
public class MainWindow
{ // example
private Masina[] _masina = new Masina[10];
_masina[0].Load(1, 'x'); // works
SomeFunction(_masina);
}
When I use this class functions in Constructor it works fine, but when I try to use some function and pass this argue like this:
public static void SomeFunction(Masina[] masina)
{
for (int i = 0; i < 10; i++)
try
{
masina[i].Load(i, 'x');
}
catch
{
}
}
then SomeFunction takes this argue as not referenced. ref
don't work for me!
Can anyone help me to solve ?