private void Add_Click(object sender, RoutedEventArgs e)
 {
     using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
     {
         if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             var entry = new AnnotatedPathEntry(PathEntry.FromFilePath(dialog.SelectedPath));
             UserPath.Add(entry);
         }
     }
 }
Beispiel #2
0
        private void CheckPath(AnnotatedPathEntry path)
        {
            path.ClearIssues();
            if (!path.Path.Exists)
            {
                path.AddIssue("Does not exist");
                return;
            }

            listFiles(path.Path.ActualPath)
            .Select(file => new { file = file, hit = FirstDir(file) })
            .Where(fh => fh.hit.Directory.ToLower() != path.Path.ActualPath.ToLower())
            .Each(fh => path.AddIssue(string.Format("{0} shadowed by {1}", fh.file, fh.hit.FullPath)));
        }
Beispiel #3
0
        private void CheckPath(AnnotatedPathEntry path)
        {
            path.ClearIssues();
            try
            {
                if (!path.Path.Exists)
                {
                    path.AddIssue("Does not exist");
                    path.SeriousError = true;
                    return;
                }

                listFiles(path.Path.ActualPath)
                .Select(file => new { file = file, hit = FirstDir(file) })
                .Where(fh => fh.hit.Directory.ToLower() != path.Path.ActualPath.ToLower())
                .Each(fh => path.AddIssue(string.Format("{0} shadowed by {1}", fh.file, fh.hit.FullPath)));
            }
            catch (Exception ex)
            {
                Debug.Print("Error checking path: {0}", ex);
                path.SeriousError = true;
                path.AddIssue(string.Format("Error checking this path: {0}", ex.Message));
            }
        }
 private void Add_Click(object sender, RoutedEventArgs e)
 {
     using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
     {
         if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             var entry = new AnnotatedPathEntry(PathEntry.FromFilePath(dialog.SelectedPath));
             UserPath.Add(entry);
         }
     }
 }
        private void CheckPath(AnnotatedPathEntry path)
        {
            path.ClearIssues();
            if (!path.Path.Exists)
            {
                path.AddIssue("Does not exist");
                return;
            }

            listFiles(path.Path.ActualPath)
                .Select(file => new { file=file, hit=FirstDir(file)})
                .Where(fh => fh.hit.Directory.ToLower() != path.Path.ActualPath.ToLower())
                .Each(fh => path.AddIssue(string.Format("{0} shadowed by {1}", fh.file, fh.hit.FullPath)));
        }
        private void CheckPath(AnnotatedPathEntry path)
        {
            path.ClearIssues();
            try
            {
                if (!path.Path.Exists)
                {
                    path.AddIssue("Does not exist");
                    path.SeriousError = true;
                    return;
                }

                listFiles(path.Path.ActualPath)
                    .Select(file => new { file=file, hit=FirstDir(file)})
                    .Where(fh => fh.hit.Directory.ToLower() != path.Path.ActualPath.ToLower())
                    .Each(fh => path.AddIssue(string.Format("{0} shadowed by {1}", fh.file, fh.hit.FullPath)));
            }
            catch (Exception ex)
            {
                Debug.Print("Error checking path: {0}", ex);
                path.SeriousError = true;
                path.AddIssue(string.Format("Error checking this path: {0}", ex.Message));
            }
        }