public bool RemoveProcessByName(string name) { FixedProcess tmp = null; foreach (FixedProcess fp in allProcesses) { if (fp.ProcessName.Equals(name)) { tmp = fp; break; } } if (tmp == null) { return(false); } allProcesses.Remove(tmp); memoryInfo[tmp.Position] = true; return(true); }
public bool AddNewProcess(FixedProcess fp) { if (fp.Size > Block) { return(false); } if (Available <= 0) { return(false); } for (int i = 0; i < Count; i++) { if (memoryInfo[i]) { memoryInfo[i] = false; fp.Position = i; allProcesses.Add(fp); break; } } return(true); }