Skip to content

Settings and activity

2 results found

  1. 7 votes
    Vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    Brad shared this idea  · 
  2. 3 votes
    Vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Brad commented  · 

    I created a simple Linq query for this with hyperlinks to quickly open either the File Explorer or open the query in LinqPad. I hope this helps:

    void Main()
    {
    string location = Util.ReadLine("Directory To Search", @"C:\WORK\My Documents\LINQPad Queries\");

    IEnumerable<FileInfo> Files =
    new DirectoryInfo(location).EnumerateDirectories()
    .AsParallel()
    .SelectMany(di => di.EnumerateFiles("*.linq", SearchOption.AllDirectories));

    List<FileList> fileList = new List<UserQuery.FileList>();
    foreach (FileInfo file in Files)
    {
    FileList fl = new FileList();
    bool finished = false;
    do
    {
    try
    {
    //$"Processing {file}".Dump();
    fl.File_openInExplorer = new Hyperlinq(string.Format("\"file:///{0}\"", Path.GetDirectoryName(file.FullName).Replace("\\", "/")), file.Name.Replace(".linq", ""));
    fl.Location_openInLinqpad = new Hyperlinq(() => { Util.Cmd("\"C:\\Program Files\\LINQPad5\\LINQPad.exe\" \"" + file.FullName + "\""); }, file.FullName.Replace(location, "").Replace("\\", " - ").Replace(".linq", ""));
    fl.ModifiedDate = file.LastWriteTime;
    fl.LastAccessedDate = file.LastAccessTime;
    fl.CreatedDate = file.CreationTime;
    finished = true;
    }
    catch (IOException ioe)
    {
    ioe.Message.Dump();
    }
    } while (!finished);
    fileList.Add(fl);
    }
    fileList.OrderByDescending(l => l.ModifiedDate).Dump("Recently Updated Files");
    }

    class FileList
    {
    public Hyperlinq File_openInExplorer { get; set; }
    public Hyperlinq Location_openInLinqpad { get; set; }
    public DateTime ModifiedDate { get; set; }
    public DateTime LastAccessedDate { get; set; }
    public DateTime CreatedDate { get; set; }
    }