Skip to content

Commit

Permalink
New example & test
Browse files Browse the repository at this point in the history
Bump version to 2.1
  • Loading branch information
xmegz committed Aug 28, 2023
1 parent c69d608 commit 19d2f51
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 26 deletions.
6 changes: 3 additions & 3 deletions MndpTray/MndpService.Core/MndpService.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Data\key.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<Version>2.0.0</Version>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<FileVersion>2.1.0.0</FileVersion>
<Version>2.1.0</Version>
<PackageLicenseUrl />
<RepositoryUrl>https://github.com/xmegz/MndpTray</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
6 changes: 3 additions & 3 deletions MndpTray/MndpTray.Core/MndpTray.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Data\key.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<Version>2.0.0</Version>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<FileVersion>2.1.0.0</FileVersion>
<Version>2.1.0</Version>
<PackageLicenseUrl />
<RepositoryUrl>https://github.com/xmegz/MndpTray</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
8 changes: 4 additions & 4 deletions MndpTray/MndpTray.Protocol.Test/MndpTray.Protocol.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<TargetFramework>net60</TargetFramework>
<OutputType>Exe</OutputType>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<Version>2.0.0</Version>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<FileVersion>2.1.0.0</FileVersion>
<Version>2.1.0</Version>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
6 changes: 3 additions & 3 deletions MndpTray/MndpTray.Protocol/MndpTray.Protocol.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<Version>2.0.0</Version>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<FileVersion>2.1.0.0</FileVersion>
<Version>2.1.0</Version>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
Expand Down
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,40 @@ Standalone package for intergation and testing
* Try it on .Net Fiddle: [https://dotnetfiddle.net/vMF42n/](https://dotnetfiddle.net/vMF42n/)

```C#
using System;
using System.Threading;

namespace MndpTray.Protocol.Test
{
public class Program
{
private static readonly Timer Timer = new Timer(Timer_Callback, null, Timeout.Infinite, Timeout.Infinite);
using System;
using System.Threading;

public static void Main(string[] args)
/// <summary>
/// Startup Class.
/// </summary>
public static class Program
{
/// <summary>
/// Startup Method.
/// </summary>
public static void Main()
{
MndpListener.Instance.Start();
MndpListener.Instance.OnDeviceDiscovered += Instance_OnDeviceDiscovered;
MndpSender.Instance.Start(MndpHostInfo.Instance);
Timer.Change(0, 5000);

Console.WriteLine("--- Start ---");
while (!Console.KeyAvailable) { Thread.Sleep(100); }
Console.WriteLine("Press any key to stop");

while (!Console.KeyAvailable)
Thread.Sleep(100);

Console.WriteLine("--- Stop ---");

Timer.Change(Timeout.Infinite, Timeout.Infinite);
MndpListener.Instance.Stop();
MndpSender.Instance.Stop();
}

private static void Timer_Callback(object state)
private static void Instance_OnDeviceDiscovered(object sender, MndpListener.DeviceDiscoveredEventArgs e)
{
foreach (var i in MndpListener.Instance.GetMessages()) Console.WriteLine(i.Value.ToString());
Console.WriteLine("--- Message List End ---");
Console.WriteLine(e.Message.ToString());
}
}
}
Expand Down

0 comments on commit 19d2f51

Please sign in to comment.