public static void DeleteTarget(string targetName) { TargetContainer tc = GetTargetContainer(); if (Exists(targetName)) { foreach (Target target in tc.GetTargets()) { if (target.GetName() == targetName) { tc.GetTargets().Remove(target); WriteToHistory(tc); break; } } } }
//Deletes the previous Target with the same name if it exists and then adds the Target to the History //This way the TargetText will be updated in case it changed and the most recently scanned Target is always at the end of the List public static void AddTarget(Target mTarget) { DeleteTarget(mTarget.GetName()); TargetContainer tc = GetTargetContainer(); tc.GetTargets().Add(mTarget); WriteToHistory(tc); }