public AddPathDialog() { InitializeComponent(); NewComputer = new disk_usage.PathRecord(); notificationsCheck.Checked = NewComputer.Notifications; UpdateUserInterface(); DialogResult = DialogResult.Cancel; NewComputer.DiskInfoUpdated += NewComputer_DiskInfoUpdated; }
public OperationResult AddPathToList(PathRecord computer) { foreach (var existing in Paths) { if (existing.Path != computer.Path) { continue; } Debug.Print($"Path {computer.Path} cannot be added as it already exists with the label {existing.FriendlyName}."); return(OperationResult.Response(false, $"Path {computer.Path} cannot be added as it already exists with the label {existing.FriendlyName}.")); } Paths.Add(computer); return(OperationResult.Response(true)); }
public OperationResult AddPathToList(string path, string friendlyName = "") { return(AddPathToList(PathRecord.Create(path, friendlyName))); }