Explorar o código

temp commit for RTC

arthur.wu %!s(int64=2) %!d(string=hai) anos
pai
achega
5d1ecb568c

+ 2 - 0
VRTC/RtcUtil.x64/Conductor.cpp

@@ -0,0 +1,2 @@
+#include "pch.h"
+#include "Conductor.h"

+ 5 - 0
VRTC/RtcUtil.x64/Conductor.h

@@ -0,0 +1,5 @@
+#pragma once
+class Conductor
+{
+};
+

+ 2 - 0
VRTC/RtcUtil.x64/RtcUtil.x64.vcxproj

@@ -155,11 +155,13 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="Conductor.h" />
     <ClInclude Include="framework.h" />
     <ClInclude Include="MediaDevices.h" />
     <ClInclude Include="pch.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="Conductor.cpp" />
     <ClCompile Include="dllmain.cpp" />
     <ClCompile Include="MediaDevices.cpp" />
     <ClCompile Include="pch.cpp">

+ 18 - 1
VRTC/VRTC.Common/VrtcServerMessage.cs

@@ -2,7 +2,7 @@
 using System.Text.Json.Serialization;
 
 namespace VRTC
-{   
+{
     public class VrtcServerMessage
     {
         /// <summary>
@@ -60,5 +60,22 @@ namespace VRTC
         {
             return JsonSerializer.Serialize(this);
         }
+
+        [Test]
+        public void ToJson_WhenCalled_ReturnsJsonString()
+        {
+            // Arrange
+            var testObject = new TestObject();
+
+            // Act
+            var result = testObject.ToJson();
+
+            // Assert
+            Assert.IsNotNull(result);
+            Assert.IsInstanceOfType(result, typeof(string));
+            Assert.IsTrue(result.StartsWith("{"));
+            Assert.IsTrue(result.EndsWith("}"));
+        }
+
     }
 }

+ 70 - 0
VRTC/VRTC.WpfClient/Device.cs

@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace VRTC.WpfClient
+{
+    //Create a device class for C#
+
+    public class Device
+    {
+
+
+        // This property is used to store the name of an object.
+        public string Name { get; set; }
+
+        /// <summary>
+        /// Gets or sets the model of the object.
+        /// </summary>
+        public string Model { get; set; }
+
+
+        /// <summary>
+        /// Property to get and set the Manufacturer of an object.
+        /// </summary>
+        public string Manufacturer { get; set; }
+        public string
+     OperatingSystem
+        { get; set; }
+        public string SerialNumber { get; set; }
+        public string Version { get; set; }
+
+        public Device(string name, string model,
+     string manufacturer, string operatingSystem, string serialNumber, string version)
+        {
+            Name = name;
+            Model = model;
+            Manufacturer = manufacturer
+    ;
+            OperatingSystem = operatingSystem;
+            SerialNumber = serialNumber;
+            Version = version;
+        }
+
+        string ToJson()
+        {
+            StringBuilder sb = new StringBuilder();
+            sb.Append("{");
+            sb.Append("\"Name\":\"" + Name + "\",");
+            sb.Append("\"Age\":\"" + Age + "\"");
+            sb.Append("}");
+            return sb.ToString();
+        }
+
+        Bug: The Age property is being added to the JSON string as a string, when it should be added as a number.
+
+
+public string ToJson()
+        {
+            return JsonConvert.SerializeObject(this);
+        }
+
+    }
+
+
+
+
+
+}

+ 4 - 0
VRTC/VRTC.WpfClient/VRTC.WpfClient.csproj

@@ -11,6 +11,10 @@
 	<OutputPath>..\bin\</OutputPath>
   </PropertyGroup>
 
+  <ItemGroup>
+    <PackageReference Include="OpenAI" Version="1.6.0" />
+  </ItemGroup>
+
 	<ItemGroup>
 	  <ProjectReference Include="..\RtcUtil\RtcUtil.csproj" />
 	  <ProjectReference Include="..\VRTC.Common\VRTC.Common.csproj" />