public void AddStartCondition(StartCondition Condition) { lock (lockObj) { StartCondition[] newValues = new StartCondition[startConditions.Length + 1]; for (int i = 0; i < startConditions.Length; i++) { newValues[i] = startConditions[i]; } newValues[newValues.Length - 1] = Condition; startConditions = newValues; } }
public void RemoveStartCondition(StartCondition Condition) { lock (lockObj) { StartCondition[] newValues = new StartCondition[startConditions.Length - 1]; int i = 0; for (; i < startConditions.Length && newValues[i] != Condition; i++) { newValues[i] = startConditions[i]; } for (; i < startConditions.Length; i++) { newValues[i] = startConditions[i + 1]; } startConditions = newValues; } }