How do I init more than 1 variable in C#?
class file_list_output
{
public file_list_output(ListView v, const int max) => veiw = v => max_ext_allowed = max;
}
cant quite figure it out
How do I init more than 1 variable in C#?
class file_list_output
{
public file_list_output(ListView v, const int max) => veiw = v => max_ext_allowed = max;
}
cant quite figure it out
You need to do it like this:
So your class has two properties:
public int Max_ext_allowed {get; private set;}
public ListView View {get; private set;}
//To do an expression bodied constructor
//The fat arrow => is replacing the typical { }
//And the next portion (View, Max_ext_allowed) is saying these are the properties being initialized
//Finally the last portion (v, max) is the set of values to set the properties to
public file_list_input(ListView v, int max) => (View, Max_ext_allowed) = (v, max);