Exemple #1
0
 public AddPathDialog()
 {
     InitializeComponent();
     NewComputer = new disk_usage.PathRecord();
     notificationsCheck.Checked = NewComputer.Notifications;
     UpdateUserInterface();
     DialogResult = DialogResult.Cancel;
     NewComputer.DiskInfoUpdated += NewComputer_DiskInfoUpdated;
 }
Exemple #2
0
        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));
        }
Exemple #3
0
 public OperationResult AddPathToList(string path, string friendlyName = "")
 {
     return(AddPathToList(PathRecord.Create(path, friendlyName)));
 }