public void Set(string ip, string host) { var line = FindEntry(host); if (line != null) { if (line.IP != ip) { line.Update(ip, host); IsDirty = true; } } else { line = new HostsFileLine(ip, host); Lines.Add(line); IsDirty = true; } }