/** * Moves the item with index down (if index >= 0 and index < count-1) * */ public void moveItemDown(int index) { if (index >= 0 && index < temperatureProfilesList.Count() - 1) { TemperatureProfileFunction itemA = temperatureProfilesList[index]; temperatureProfilesList[index] = temperatureProfilesList[index + 1]; temperatureProfilesList[index + 1] = itemA; OnUpdatedList(); } }
/** * Adds a profile to the current list of profiles based on the index matching the availableProfiles() method * */ public void addProfileFunction(int index, double cA, double cB, double cC, double deltaTime) { List <TemperatureProfileFunction> availProf = availableProfiles(); if (checkIndex(index, availProf)) { //make new object with the given profile and parameters TemperatureProfileFunction prof = availProf.ElementAt(index); prof.coeffA = cA; prof.coeffB = cB; prof.coeffC = cC; prof.setDeltaTime(deltaTime); //add the allowed profile to the list temperatureProfilesList.Add(prof); //fire event that the list has changed OnUpdatedList(); } }