← Customer Feedback for LINQPad Settings and activity 2 results found Add Export of Results Pane to Util as a method 7 votes Vote Vote Vote Vote We're glad you're herePlease sign in to leave feedback Signed in as (Sign out) Close Close 1 vote 2 votes 3 votes Remove votes You have left! (?) (thinking…) 1 comment · LINQPad Feature Suggestions · Delete… · Admin → How important is this to you? Not at all You must login first! Important You must login first! Critical You must login first! We're glad you're herePlease sign in to leave feedback Signed in as (Sign out) Close Close Brad shared this idea · Nov 22, 2019 Add option to sort the My Queries pane by date 3 votes Vote Vote Vote Vote We're glad you're herePlease sign in to leave feedback Signed in as (Sign out) Close Close 1 vote 2 votes 3 votes Remove votes You have left! (?) (thinking…) 1 comment · LINQPad Feature Suggestions · Delete… · Admin → How important is this to you? Not at all You must login first! Important You must login first! Critical You must login first! We're glad you're herePlease sign in to leave feedback Signed in as (Sign out) Close Close An error occurred while saving the comment Brad commented · Nov 22, 2019 · Edit… · Delete… 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; } } Save Submitting...
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; }
}