Okay so I hope the title makes sense but I'll explain a litte more indepth. Right now i have an object that consists of multiple forms of data (strings, int, and a boolean array). The object array looks like this (sorry for all the clutter I had it looking nice, then accidently hit back and don't want to retype it all)
namespace WorkScheduleApp_V2_2v3
{
//==================================================================================================================
public class Employee
{
bool active;
string ID;
string name;
string DOB;
int age;
string position;
bool [] shiftType;
//-----------------------------------------------------------------------------------------------------------------
public Employee (bool active, string ID, string name, string DOB, int age, string position, bool [] shiftType)
{
this.active = active;
this.ID = ID;
this.name = name;
this.DOB = DOB;
this.age = age;
this.position = position;
this.shiftType = shiftType;
}
//-----------------------------------------------------------------------------------------------------------------
public void inActive (bool input) //if they are active or on leave
{
active = input;
}
//-----------------------------------------------------------------------------------------------------------------
public void inID (string input) //the employee's ID (out last 4 SS digits)
{
ID = input;
}
//-----------------------------------------------------------------------------------------------------------------
public void inName (string input) //the employee's name
{
name = input;
}
//-----------------------------------------------------------------------------------------------------------------
public void inDOB (string input) //the employee's DOB
{
DOB = input;
}
//-----------------------------------------------------------------------------------------------------------------
public void inAge (int input) //the employee's age
{
age = input;
}
//-----------------------------------------------------------------------------------------------------------------
public void inPos (string input) //the employee's position
{
position = input;
}
//-----------------------------------------------------------------------------------------------------------------
public void inShiftTypes (bool [] input) //imports the whole shiftType array for the employee's shift types
{
shiftType = input;
}
//-----------------------------------------------------------------------------------------------------------------
public void inShiftType_Spec (bool input, int i) //imports just 1 part of the shiftType array
{
shiftType [i] = input;
}
//-----------------------------------------------------------------------------------------------------------------
public bool isActive ()
{
return active;
}
//-----------------------------------------------------------------------------------------------------------------
public string isID ()
{
return ID;
}
//-----------------------------------------------------------------------------------------------------------------
public string isName ()
{
return name;
}
//-----------------------------------------------------------------------------------------------------------------
public string isDOB ()
{
return DOB;
}
//-----------------------------------------------------------------------------------------------------------------
public int isAge ()
{
return age;
}
//-----------------------------------------------------------------------------------------------------------------
public string isPos ()
{
return position;
}
//-----------------------------------------------------------------------------------------------------------------
public bool [] isShiftTypes ()
{
return shiftType;
}
//-----------------------------------------------------------------------------------------------------------------
public bool isShiftTypes_Spec (int i)
{
return shiftType [i];
}
//-----------------------------------------------------------------------------------------------------------------
}
//==================================================================================================================
}
Anyway as you can see this object contains a boolean array as I stated before. Well what I would like to know is if there is a way to resize this array?
I know how to resize most arrays with the line
Array.Resize(ref array, size);
But that won't work for this. I was think of calling isShiftType() and assigning the array in the object to another array, the calling inShiftType where I would pass in a null (this I assume would clear out old array in the object) and then call inShiftType again passing in the newly resized array (that I stored with inShiftType() and then used the Array.Resize() command).
There is two issues with this though, one is I am not sure if this will even work, and two this seems like very bad coding (very messy and not needed).
Any help would be greatly appreciated, again sorry if this seems a little messy and rushed, as I said before I was almost done typing and accidently had the page go back on me (plus I am rushed for time)