diff --git a/tests/Shmuelie.WinRTServer.Sample.Server/Input.cs b/tests/Shmuelie.WinRTServer.Sample.Server/Input.cs deleted file mode 100644 index 7247b5d..0000000 --- a/tests/Shmuelie.WinRTServer.Sample.Server/Input.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Shmuelie.WinRTServer.Sample.Interfaces; - -namespace Shmuelie.WinRTServer.Sample; - -[Guid("4F59AF92-A98D-4A20-8C8D-1C076647A6B0")] -public sealed class Input : IInput -{ - public string Name { get; set; } - public string Description { get; set; } -} diff --git a/tests/Shmuelie.WinRTServer.Sample.Server/Program.cs b/tests/Shmuelie.WinRTServer.Sample.Server/Program.cs deleted file mode 100644 index ba9337b..0000000 --- a/tests/Shmuelie.WinRTServer.Sample.Server/Program.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Shmuelie.WinRTServer.Sample.Interfaces; - -namespace Shmuelie.WinRTServer.Sample.Server; - -public static class Program -{ - public async static Task Main(string[] args) - { - if (args.Contains("-COM")) - { - await using (ComServer server = new ComServer()) - { - server.RegisterClass(); - server.RegisterClass(); - server.RegisterClass(); - server.Start(); - await server.WaitForFirstObjectAsync(); - } - } - else if (args.Contains("-WINRT")) - { - await using (WinRtServer server = new WinRtServer()) - { - server.RegisterClass(); - server.RegisterClass(); - server.RegisterClass(); - server.Start(); - await server.WaitForFirstObjectAsync(); - } - } - } -} diff --git a/tests/Shmuelie.WinRTServer.Sample.Server/RemoteThing.cs b/tests/Shmuelie.WinRTServer.Sample.Server/RemoteThing.cs deleted file mode 100644 index f093eea..0000000 --- a/tests/Shmuelie.WinRTServer.Sample.Server/RemoteThing.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.WindowsRuntime; -using System.Threading; -using System.Threading.Tasks; -using Shmuelie.WinRTServer.Sample.Interfaces; -using Windows.Foundation; -using Windows.Storage.Streams; - -namespace Shmuelie.WinRTServer.Sample; - -[Guid("4F59AF92-A98D-4A20-8C8D-1C076647A6AE")] -public sealed class RemoteThing : IRemoteThing -{ - public int Rem(int a, int b) - { - return Math.DivRem(a, b, out var _); - } - - public async Task DelayAsync(int ticks, CancellationToken cancellationToken = default) - { - await Task.Delay(ticks, cancellationToken).ConfigureAwait(false); - } - - [DebuggerNonUserCode] - IAsyncAction IRemoteThing.DelayAsync(int ticks) - { - return AsyncInfo.Run(c => DelayAsync(ticks, c)); - } - - public async Task> GenerateListAsync(ListOptions options, IProgress progress = default, CancellationToken cancellationToken = default) - { - List list = []; - for (int i = 0; i < options.Count; i++) - { - cancellationToken.ThrowIfCancellationRequested(); - await Task.Delay(options.DelayTicks, cancellationToken).ConfigureAwait(false); - cancellationToken.ThrowIfCancellationRequested(); - list.Add(i * 2); - progress?.Report(new ListProgress() { Count = i, Total = options.Count, Last = i * 2}); - } - return list; - } - - [DebuggerNonUserCode] - IAsyncOperationWithProgress, ListProgress> IRemoteThing.GenerateListAsync(ListOptions options) - { - return AsyncInfo.Run, ListProgress>((c, p) => GenerateListAsync(options, p, c)); - } - - public async Task LoopAsync(int total, IProgress progress = default, CancellationToken cancellationToken = default) - { - for (int i = 0; i < total; i++) - { - cancellationToken.ThrowIfCancellationRequested(); - await Task.Delay(500, cancellationToken).ConfigureAwait(false); - cancellationToken.ThrowIfCancellationRequested(); - progress?.Report(new LoopProgress() { Count = i, Total = total }); - } - LoopCompleted?.Invoke(this, null); - } - - [DebuggerNonUserCode] - IAsyncActionWithProgress IRemoteThing.LoopAsync(int total) - { - return AsyncInfo.Run((c, p) => LoopAsync(total, p, c)); - } - - public event TypedEventHandler LoopCompleted; - - public DateTimeOffset NowUtc => DateTimeOffset.UtcNow; - - public Stream OpenFile(string path) - { - return File.OpenRead(path); - } - - [DebuggerNonUserCode] - IInputStream IRemoteThing.OpenFile(string path) - { - return OpenFile(path).AsInputStream(); - } - - public ITimes GetTimes(IInput input) - { - return new Times() - { - LocalNow = DateTimeOffset.Now, - UtcNow = DateTimeOffset.UtcNow, - NameAndDescription = input.Name + " " + input.Description - }; - } -} diff --git a/tests/Shmuelie.WinRTServer.Sample.Server/Shmuelie.WinRTServer.Sample.Server.csproj b/tests/Shmuelie.WinRTServer.Sample.Server/Shmuelie.WinRTServer.Sample.Server.csproj deleted file mode 100644 index e657fdb..0000000 --- a/tests/Shmuelie.WinRTServer.Sample.Server/Shmuelie.WinRTServer.Sample.Server.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - 10.0.22000.0 - 10.0.18362.0 - net462 - x64;x86 - disable - 6.2.13 - $(AssetTargetFallback);netstandard2.0 - - $(NoWarn);NU1702 - winexe - full - true - win-x64;$(RuntimeIdentifiers) - - - - - - - - - - net462 - %(Filename).%(Extension) - Windows - %(RootDir)%(Directory) - %(FullPath) - - - - diff --git a/tests/Shmuelie.WinRTServer.Sample.Server/Times.cs b/tests/Shmuelie.WinRTServer.Sample.Server/Times.cs deleted file mode 100644 index c476852..0000000 --- a/tests/Shmuelie.WinRTServer.Sample.Server/Times.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Shmuelie.WinRTServer.Sample.Interfaces; - -namespace Shmuelie.WinRTServer.Sample; - -[Guid("4F59AF92-A98D-4A20-8C8D-1C076647A6AF")] -public sealed class Times : ITimes -{ - public DateTimeOffset UtcNow { get; set; } - public DateTimeOffset LocalNow { get; set; } - public string NameAndDescription { get; set; } -}