Bruce Wayne 4 years ago
parent
commit
6f75c66af2

+ 3 - 0
NatTypeTester.ViewModels/FodyWeavers.xml

@@ -0,0 +1,3 @@
+<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
+  <ReactiveUI />
+</Weavers>

+ 2 - 6
NatTypeTester/ViewModels/MainWindowViewModel.cs → NatTypeTester.ViewModels/MainWindowViewModel.cs

@@ -1,6 +1,5 @@
 using DynamicData;
 using DynamicData.Binding;
-using NatTypeTester.Model;
 using ReactiveUI;
 using ReactiveUI.Fody.Helpers;
 using STUN.Client;
@@ -17,7 +16,6 @@ using System.Reactive;
 using System.Reactive.Linq;
 using System.Threading;
 using System.Threading.Tasks;
-using System.Windows;
 
 namespace NatTypeTester.ViewModels
 {
@@ -142,7 +140,6 @@ namespace NatTypeTester.ViewModels
 
 					Result3489 = client.Status;
 					await client.Query3489Async();
-					//TODO
 				}
 				else
 				{
@@ -151,7 +148,7 @@ namespace NatTypeTester.ViewModels
 			}
 			catch (Exception ex)
 			{
-				MessageBox.Show(ex.Message, nameof(NatTypeTester), MessageBoxButton.OK, MessageBoxImage.Error);
+				//TODO MessageBox.Show(ex.Message, nameof(NatTypeTester), MessageBoxButton.OK, MessageBoxImage.Error);
 			}
 		}
 
@@ -173,7 +170,6 @@ namespace NatTypeTester.ViewModels
 
 					Result5389 = client.Status;
 					await client.QueryAsync();
-					//TODO
 				}
 				else
 				{
@@ -182,7 +178,7 @@ namespace NatTypeTester.ViewModels
 			}
 			catch (Exception ex)
 			{
-				MessageBox.Show(ex.Message, nameof(NatTypeTester), MessageBoxButton.OK, MessageBoxImage.Error);
+				//TODO MessageBox.Show(ex.Message, nameof(NatTypeTester), MessageBoxButton.OK, MessageBoxImage.Error);
 			}
 		}
 	}

+ 17 - 0
NatTypeTester.ViewModels/NatTypeTester.ViewModels.csproj

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net48</TargetFramework>
+    <LangVersion>latest</LangVersion>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="ReactiveUI.Fody" Version="13.0.27" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\STUN\STUN.csproj" />
+  </ItemGroup>
+
+</Project>

+ 6 - 0
NatTypeTester.sln

@@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "STUN", "STUN\STUN.csproj",
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "UnitTest\UnitTest.csproj", "{AA8AF9BF-5CFB-4725-B42A-7B3B3890A279}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NatTypeTester.ViewModels", "NatTypeTester.ViewModels\NatTypeTester.ViewModels.csproj", "{D7626B0E-17B0-4743-888F-A32797442750}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -33,6 +35,10 @@ Global
 		{AA8AF9BF-5CFB-4725-B42A-7B3B3890A279}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{AA8AF9BF-5CFB-4725-B42A-7B3B3890A279}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{AA8AF9BF-5CFB-4725-B42A-7B3B3890A279}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D7626B0E-17B0-4743-888F-A32797442750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D7626B0E-17B0-4743-888F-A32797442750}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D7626B0E-17B0-4743-888F-A32797442750}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D7626B0E-17B0-4743-888F-A32797442750}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 0 - 1
NatTypeTester/FodyWeavers.xml

@@ -1,4 +1,3 @@
 <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
   <Costura />
-  <ReactiveUI />
 </Weavers>

+ 1 - 1
NatTypeTester/MainWindow.xaml

@@ -4,7 +4,7 @@
 	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 	xmlns:reactiveUi="http://reactiveui.net"
-	xmlns:viewModels="clr-namespace:NatTypeTester.ViewModels"
+    xmlns:viewModels="clr-namespace:NatTypeTester.ViewModels;assembly=NatTypeTester.ViewModels"
 	xmlns:ui="http://schemas.modernwpf.com/2019"
 	Title="NatTypeTester"
 	Width="500"

+ 1 - 1
NatTypeTester/NatTypeTester.csproj

@@ -30,7 +30,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <ProjectReference Include="..\STUN\STUN.csproj" />
+    <ProjectReference Include="..\NatTypeTester.ViewModels\NatTypeTester.ViewModels.csproj" />
   </ItemGroup>
 
 </Project>

+ 1 - 1
NatTypeTester/Model/StunServer.cs → STUN/Utils/StunServer.cs

@@ -3,7 +3,7 @@ using System.Linq;
 using System.Net;
 using System.Net.Sockets;
 
-namespace NatTypeTester.Model
+namespace STUN.Utils
 {
 	public class StunServer
 	{