Skip to content

Commit 285d45b

Browse files
committed
Interop progress
1 parent 11e5363 commit 285d45b

20 files changed

+736
-0
lines changed

Communication/Communication.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<ClInclude Include="..\include\ThreadGuard.h" />
3232
<ClInclude Include="..\include\Trace.h" />
3333
<ClInclude Include="CommunicationFactory.h" />
34+
<ClInclude Include="CommunicationFactoryApi.h" />
3435
<ClInclude Include="Message.h" />
3536
<ClInclude Include="MessageListener.h" />
3637
<ClInclude Include="Serializer.h" />
@@ -42,6 +43,7 @@
4243
</ItemGroup>
4344
<ItemGroup>
4445
<ClCompile Include="CommunicationFactory.cpp" />
46+
<ClCompile Include="CommunicationFactoryApi.cpp" />
4547
<ClCompile Include="Message.cpp" />
4648
<ClCompile Include="MessageListener.cpp" />
4749
<ClCompile Include="MessageSender.cpp" />

Communication/Communication.vcxproj.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@
9090
<ClInclude Include="..\include\ThreadGuard.h">
9191
<Filter>Header Files</Filter>
9292
</ClInclude>
93+
<ClInclude Include="CommunicationFactoryApi.h">
94+
<Filter>Header Files</Filter>
95+
</ClInclude>
9396
</ItemGroup>
9497
<ItemGroup>
9598
<ClCompile Include="Message.cpp">
@@ -122,5 +125,8 @@
122125
<ClCompile Include="ThreadGuard.cpp">
123126
<Filter>Source Files</Filter>
124127
</ClCompile>
128+
<ClCompile Include="CommunicationFactoryApi.cpp">
129+
<Filter>Source Files</Filter>
130+
</ClCompile>
125131
</ItemGroup>
126132
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "CommunicationFactoryApi.h"
2+
3+
#include "ICommunicationFactory.h"
4+
5+
ICommunicationFactory* CreateCommunicationFactory()
6+
{
7+
return CreateFactory().release();
8+
}
9+
10+
IConnectionListener* CreateWinSockConnectionListener(ICommunicationFactory* factory, int port)
11+
{
12+
return factory->CreateWinSockConnectionListener(port).release();
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
#include "ICommunicationFactory.h"
3+
4+
extern "C"
5+
{
6+
__declspec(dllexport)
7+
ICommunicationFactory* CreateCommunicationFactory();
8+
9+
__declspec(dllexport)
10+
IConnectionListener* CreateWinSockConnectionListener(ICommunicationFactory* factory, int port);
11+
}

RatManagerUI/Form1.Designer.cs

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RatManagerUI/Form1.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Server.Interop;
2+
3+
namespace RatManagerUI
4+
{
5+
public partial class Form1 : Form
6+
{
7+
public Form1()
8+
{
9+
InitializeComponent();
10+
}
11+
12+
private async void button1_Click(object sender, EventArgs e)
13+
{
14+
var ratManager = new RatManager(4545);
15+
await Task.Delay(1000);
16+
var clientCount = ratManager.GetClientCount();
17+
Console.WriteLine();
18+
}
19+
}
20+
}

RatManagerUI/Form1.resx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<root>
2+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
3+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
4+
<xsd:element name="root" msdata:IsDataSet="true">
5+
<xsd:complexType>
6+
<xsd:choice maxOccurs="unbounded">
7+
<xsd:element name="metadata">
8+
<xsd:complexType>
9+
<xsd:sequence>
10+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
11+
</xsd:sequence>
12+
<xsd:attribute name="name" use="required" type="xsd:string" />
13+
<xsd:attribute name="type" type="xsd:string" />
14+
<xsd:attribute name="mimetype" type="xsd:string" />
15+
<xsd:attribute ref="xml:space" />
16+
</xsd:complexType>
17+
</xsd:element>
18+
<xsd:element name="assembly">
19+
<xsd:complexType>
20+
<xsd:attribute name="alias" type="xsd:string" />
21+
<xsd:attribute name="name" type="xsd:string" />
22+
</xsd:complexType>
23+
</xsd:element>
24+
<xsd:element name="data">
25+
<xsd:complexType>
26+
<xsd:sequence>
27+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
28+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
29+
</xsd:sequence>
30+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
31+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
32+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
33+
<xsd:attribute ref="xml:space" />
34+
</xsd:complexType>
35+
</xsd:element>
36+
<xsd:element name="resheader">
37+
<xsd:complexType>
38+
<xsd:sequence>
39+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
40+
</xsd:sequence>
41+
<xsd:attribute name="name" type="xsd:string" use="required" />
42+
</xsd:complexType>
43+
</xsd:element>
44+
</xsd:choice>
45+
</xsd:complexType>
46+
</xsd:element>
47+
</xsd:schema>
48+
<resheader name="resmimetype">
49+
<value>text/microsoft-resx</value>
50+
</resheader>
51+
<resheader name="version">
52+
<value>2.0</value>
53+
</resheader>
54+
<resheader name="reader">
55+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
56+
</resheader>
57+
<resheader name="writer">
58+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
59+
</resheader>
60+
</root>

RatManagerUI/Program.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace RatManagerUI
2+
{
3+
internal static class Program
4+
{
5+
/// <summary>
6+
/// The main entry point for the application.
7+
/// </summary>
8+
[STAThread]
9+
static void Main()
10+
{
11+
// To customize application configuration such as set high DPI settings or default font,
12+
// see https://aka.ms/applicationconfiguration.
13+
ApplicationConfiguration.Initialize();
14+
Application.Run(new Form1());
15+
}
16+
}
17+
}

RatManagerUI/Properties/Resources.Designer.cs

Lines changed: 103 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)