Test projects are working.
This commit is contained in:
42
Vector3VisualizerSource/Vector3ObjectSource.cs
Normal file
42
Vector3VisualizerSource/Vector3ObjectSource.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Microsoft.VisualStudio.DebuggerVisualizers;
|
||||
using NamedPipes;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Vector3VisualizerSource;
|
||||
|
||||
public class Vector3ObjectSource : VisualizerObjectSource
|
||||
{
|
||||
private static NamedPipeClient? PipeClient { get; set; }
|
||||
private static void Send(Vector3Model vector3Model)
|
||||
{
|
||||
PipeClient ??= new NamedPipeClient("testPipe");
|
||||
PipeClient.SetMessageAsync($"Hello from {nameof(Vector3ObjectSource)}").GetAwaiter().GetResult();
|
||||
}
|
||||
public Vector3ObjectSource()
|
||||
{
|
||||
Debug.WriteLine("new Vector3ObjectSource");
|
||||
}
|
||||
public override void GetData(object target, Stream outgoingData)
|
||||
{
|
||||
Vector3Model vector3Model = new();
|
||||
switch (target)
|
||||
{
|
||||
case Vector3 vector3:
|
||||
vector3Model.Vector3 = vector3.ToString();
|
||||
break;
|
||||
case IEnumerable<Vector3> vector3List:
|
||||
vector3Model.Vector3 = vector3List.Last().ToString();
|
||||
break;
|
||||
case Quaternion quaternion:
|
||||
vector3Model.Quaternion = quaternion.ToString();
|
||||
break;
|
||||
}
|
||||
|
||||
Send(vector3Model);
|
||||
SerializeAsJson(outgoingData, vector3Model);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user