From 596011c9623329c75f3aee00fcaba07e0459ce0b Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 19 Dec 2024 12:10:37 +0100 Subject: [PATCH] timeline --- ProjectPlugins/CodexPlugin/CodexNode.cs | 16 +- SeeTimeline/App.xaml | 9 + SeeTimeline/App.xaml.cs | 14 ++ SeeTimeline/AssemblyInfo.cs | 10 + SeeTimeline/MainWindow.xaml | 29 +++ SeeTimeline/MainWindow.xaml.cs | 199 ++++++++++++++++++ SeeTimeline/SeeTimeline.csproj | 19 ++ SeeTimeline/SeeTimeline.csproj.user | 14 ++ .../DataTests/TwoClientTest.cs | 65 ++++-- Tests/DistTestCore/Configuration.cs | 2 +- cs-codex-dist-testing.sln | 7 + 11 files changed, 368 insertions(+), 16 deletions(-) create mode 100644 SeeTimeline/App.xaml create mode 100644 SeeTimeline/App.xaml.cs create mode 100644 SeeTimeline/AssemblyInfo.cs create mode 100644 SeeTimeline/MainWindow.xaml create mode 100644 SeeTimeline/MainWindow.xaml.cs create mode 100644 SeeTimeline/SeeTimeline.csproj create mode 100644 SeeTimeline/SeeTimeline.csproj.user diff --git a/ProjectPlugins/CodexPlugin/CodexNode.cs b/ProjectPlugins/CodexPlugin/CodexNode.cs index afb78f34..22d8f5c2 100644 --- a/ProjectPlugins/CodexPlugin/CodexNode.cs +++ b/ProjectPlugins/CodexPlugin/CodexNode.cs @@ -22,6 +22,8 @@ namespace CodexPlugin ContentId UploadFile(TrackedFile file, string contentType, string contentDisposition, Action onFailure); TrackedFile? DownloadContent(ContentId contentId, string fileLabel = ""); TrackedFile? DownloadContent(ContentId contentId, Action onFailure, string fileLabel = ""); + (TrackedFile?, TimeSpan) DownloadContentT(ContentId contentId, string fileLabel = ""); + (TrackedFile?, TimeSpan) DownloadContentT(ContentId contentId, Action onFailure, string fileLabel = ""); LocalDataset DownloadStreamless(ContentId cid); /// /// TODO: This will monitor the quota-used of the node until 'size' bytes are added. That's a very bad way @@ -189,10 +191,20 @@ namespace CodexPlugin public TrackedFile? DownloadContent(ContentId contentId, string fileLabel = "") { - return DownloadContent(contentId, DoNothing, fileLabel); + return DownloadContentT(contentId, fileLabel).Item1; } public TrackedFile? DownloadContent(ContentId contentId, Action onFailure, string fileLabel = "") + { + return DownloadContentT(contentId, onFailure, fileLabel).Item1; + } + + public (TrackedFile?, TimeSpan) DownloadContentT(ContentId contentId, string fileLabel = "") + { + return DownloadContentT(contentId, DoNothing, fileLabel); + } + + public (TrackedFile?, TimeSpan) DownloadContentT(ContentId contentId, Action onFailure, string fileLabel = "") { var file = tools.GetFileManager().CreateEmptyFile(fileLabel); hooks.OnFileDownloading(contentId); @@ -205,7 +217,7 @@ namespace CodexPlugin transferSpeeds.AddDownloadSample(size, measurement); hooks.OnFileDownloaded(size, contentId); - return file; + return (file, measurement); } public LocalDataset DownloadStreamless(ContentId cid) diff --git a/SeeTimeline/App.xaml b/SeeTimeline/App.xaml new file mode 100644 index 00000000..dc945260 --- /dev/null +++ b/SeeTimeline/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/SeeTimeline/App.xaml.cs b/SeeTimeline/App.xaml.cs new file mode 100644 index 00000000..71c26be6 --- /dev/null +++ b/SeeTimeline/App.xaml.cs @@ -0,0 +1,14 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace SeeTimeline +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } + +} diff --git a/SeeTimeline/AssemblyInfo.cs b/SeeTimeline/AssemblyInfo.cs new file mode 100644 index 00000000..b0ec8275 --- /dev/null +++ b/SeeTimeline/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/SeeTimeline/MainWindow.xaml b/SeeTimeline/MainWindow.xaml new file mode 100644 index 00000000..0ad10b02 --- /dev/null +++ b/SeeTimeline/MainWindow.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + +