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