Skip to content

Commit 22b8744

Browse files
committed
Updated documentation
1 parent a4f5293 commit 22b8744

File tree

10 files changed

+566
-0
lines changed

10 files changed

+566
-0
lines changed

Demo.sln

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3. Messages", "Examples\Mes
2626
EndProject
2727
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4. Join Session", "Examples\Join_Session\4. Join Session.csproj", "{BBBDBE8D-EA8E-44CB-96C8-1F753747DA34}"
2828
EndProject
29+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "5. Send Event", "Examples\Send_Event\5. Send Event.csproj", "{B0170DEB-DB9F-46C1-A7F3-A449ECED2279}"
30+
EndProject
31+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "6. Update Object", "Examples\Update_Object\6. Update Object.csproj", "{94B62930-43CC-42B5-84E1-D791D05DB2FD}"
32+
EndProject
2933
Global
3034
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3135
Debug|Any CPU = Debug|Any CPU
@@ -88,6 +92,18 @@ Global
8892
{BBBDBE8D-EA8E-44CB-96C8-1F753747DA34}.Release|Any CPU.ActiveCfg = Release|x64
8993
{BBBDBE8D-EA8E-44CB-96C8-1F753747DA34}.Release|x64.ActiveCfg = Release|x64
9094
{BBBDBE8D-EA8E-44CB-96C8-1F753747DA34}.Release|x64.Build.0 = Release|x64
95+
{B0170DEB-DB9F-46C1-A7F3-A449ECED2279}.Debug|Any CPU.ActiveCfg = Debug|x64
96+
{B0170DEB-DB9F-46C1-A7F3-A449ECED2279}.Debug|x64.ActiveCfg = Debug|x64
97+
{B0170DEB-DB9F-46C1-A7F3-A449ECED2279}.Debug|x64.Build.0 = Debug|x64
98+
{B0170DEB-DB9F-46C1-A7F3-A449ECED2279}.Release|Any CPU.ActiveCfg = Release|x64
99+
{B0170DEB-DB9F-46C1-A7F3-A449ECED2279}.Release|x64.ActiveCfg = Release|x64
100+
{B0170DEB-DB9F-46C1-A7F3-A449ECED2279}.Release|x64.Build.0 = Release|x64
101+
{94B62930-43CC-42B5-84E1-D791D05DB2FD}.Debug|Any CPU.ActiveCfg = Debug|x64
102+
{94B62930-43CC-42B5-84E1-D791D05DB2FD}.Debug|x64.ActiveCfg = Debug|x64
103+
{94B62930-43CC-42B5-84E1-D791D05DB2FD}.Debug|x64.Build.0 = Debug|x64
104+
{94B62930-43CC-42B5-84E1-D791D05DB2FD}.Release|Any CPU.ActiveCfg = Release|x64
105+
{94B62930-43CC-42B5-84E1-D791D05DB2FD}.Release|x64.ActiveCfg = Release|x64
106+
{94B62930-43CC-42B5-84E1-D791D05DB2FD}.Release|x64.Build.0 = Release|x64
91107
EndGlobalSection
92108
GlobalSection(SolutionProperties) = preSolution
93109
HideSolutionNode = FALSE
@@ -102,6 +118,8 @@ Global
102118
{B1F5928A-F73D-45E4-B273-2C3124BC4CA7} = {6D024A4E-F795-4FE5-9932-07574DCE9E75}
103119
{F36760F2-B751-40FD-A396-6E5E8A42EC87} = {6D024A4E-F795-4FE5-9932-07574DCE9E75}
104120
{BBBDBE8D-EA8E-44CB-96C8-1F753747DA34} = {6D024A4E-F795-4FE5-9932-07574DCE9E75}
121+
{B0170DEB-DB9F-46C1-A7F3-A449ECED2279} = {6D024A4E-F795-4FE5-9932-07574DCE9E75}
122+
{94B62930-43CC-42B5-84E1-D791D05DB2FD} = {6D024A4E-F795-4FE5-9932-07574DCE9E75}
105123
EndGlobalSection
106124
GlobalSection(ExtensibilityGlobals) = postSolution
107125
SolutionGuid = {B96B0E72-1B38-4DCC-AB55-CF778AE9D003}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{B0170DEB-DB9F-46C1-A7F3-A449ECED2279}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>Send_Event</RootNamespace>
10+
<AssemblyName>Send_Event</AssemblyName>
11+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
<PublishUrl>publish\</PublishUrl>
16+
<Install>true</Install>
17+
<InstallFrom>Disk</InstallFrom>
18+
<UpdateEnabled>false</UpdateEnabled>
19+
<UpdateMode>Foreground</UpdateMode>
20+
<UpdateInterval>7</UpdateInterval>
21+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
22+
<UpdatePeriodically>false</UpdatePeriodically>
23+
<UpdateRequired>false</UpdateRequired>
24+
<MapFileExtensions>true</MapFileExtensions>
25+
<ApplicationRevision>0</ApplicationRevision>
26+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
27+
<IsWebBootstrapper>false</IsWebBootstrapper>
28+
<UseApplicationTrust>false</UseApplicationTrust>
29+
<BootstrapperEnabled>true</BootstrapperEnabled>
30+
</PropertyGroup>
31+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
32+
<DebugSymbols>true</DebugSymbols>
33+
<OutputPath>bin\x64\Debug\</OutputPath>
34+
<DefineConstants>TRACE;DEBUG;WIN64</DefineConstants>
35+
<DebugType>full</DebugType>
36+
<PlatformTarget>x64</PlatformTarget>
37+
<ErrorReport>prompt</ErrorReport>
38+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
39+
<Prefer32Bit>true</Prefer32Bit>
40+
</PropertyGroup>
41+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
42+
<OutputPath>bin\x64\Release\</OutputPath>
43+
<DefineConstants>TRACE;WIN64</DefineConstants>
44+
<Optimize>true</Optimize>
45+
<DebugType>pdbonly</DebugType>
46+
<PlatformTarget>x64</PlatformTarget>
47+
<ErrorReport>prompt</ErrorReport>
48+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
49+
<Prefer32Bit>true</Prefer32Bit>
50+
</PropertyGroup>
51+
<PropertyGroup>
52+
<StartupObject>Send_Event.Program</StartupObject>
53+
</PropertyGroup>
54+
<ItemGroup>
55+
<Reference Include="System" />
56+
<Reference Include="System.Core" />
57+
<Reference Include="System.Xml.Linq" />
58+
<Reference Include="System.Data.DataSetExtensions" />
59+
<Reference Include="Microsoft.CSharp" />
60+
<Reference Include="System.Data" />
61+
<Reference Include="System.Net.Http" />
62+
<Reference Include="System.Xml" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Compile Include="Program.cs" />
66+
<Compile Include="Properties\AssemblyInfo.cs" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<None Include="App.config" />
70+
</ItemGroup>
71+
<ItemGroup>
72+
<ProjectReference Include="..\..\GizmoSDK\GizmoBase\GizmoBase.csproj">
73+
<Project>{5c84642f-7db7-42b2-a3c9-d3f65d5610f1}</Project>
74+
<Name>GizmoBase</Name>
75+
</ProjectReference>
76+
<ProjectReference Include="..\..\GizmoSDK\GizmoDistribution\GizmoDistribution.csproj">
77+
<Project>{8252f26d-0fbb-4e15-84f8-3d145758ab55}</Project>
78+
<Name>GizmoDistribution</Name>
79+
</ProjectReference>
80+
</ItemGroup>
81+
<ItemGroup>
82+
<NativeReference Include="gzGizmoBaseLibraries, Version=1.0.0.0, Type=win32">
83+
<Name>gzGizmoBaseLibraries.manifest</Name>
84+
<HintPath>..\..\Assets\Plugins\x64\gzGizmoBaseLibraries.manifest</HintPath>
85+
</NativeReference>
86+
<NativeReference Include="gzGizmoDistributionLibraries, Version=1.0.0.0, Type=win32">
87+
<Name>gzGizmoDistributionLibraries.manifest</Name>
88+
<HintPath>..\..\Assets\Plugins\x64\gzGizmoDistributionLibraries.manifest</HintPath>
89+
</NativeReference>
90+
<NativeReference Include="gzGizmoRemoteDistributionLibraries, Version=1.0.0.0, Type=win32">
91+
<Name>gzGizmoRemoteDistributionLibraries.manifest</Name>
92+
<HintPath>..\..\Assets\Plugins\x64\gzGizmoRemoteDistributionLibraries.manifest</HintPath>
93+
</NativeReference>
94+
</ItemGroup>
95+
<ItemGroup>
96+
<BootstrapperPackage Include=".NETFramework,Version=v4.6">
97+
<Visible>False</Visible>
98+
<ProductName>Microsoft .NET Framework 4.6 %28x86 and x64%29</ProductName>
99+
<Install>true</Install>
100+
</BootstrapperPackage>
101+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
102+
<Visible>False</Visible>
103+
<ProductName>.NET Framework 3.5 SP1</ProductName>
104+
<Install>false</Install>
105+
</BootstrapperPackage>
106+
</ItemGroup>
107+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
108+
</Project>

Examples/Send_Event/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>

Examples/Send_Event/Program.cs

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
//******************************************************************************
2+
// File : Program.cs
3+
// Module : Distribution Examples
4+
// Description : Basic examples for C# distribution
5+
// Author : Anders Modén
6+
//
7+
// Copyright © 2003- Saab Training Systems AB, Sweden
8+
//
9+
// NOTE: GizmoBase is a platform abstraction utility layer for C++. It contains
10+
// design patterns and C++ solutions for the advanced programmer.
11+
//
12+
//
13+
// Revision History...
14+
//
15+
// Who Date Description
16+
//
17+
// AMO 190923 Created file
18+
//
19+
//******************************************************************************
20+
21+
using GizmoSDK.GizmoBase;
22+
using GizmoSDK.GizmoDistribution;
23+
24+
namespace Send_Event
25+
{
26+
27+
class Program
28+
{
29+
static void Main(string[] args)
30+
{
31+
32+
// Add a message receiver
33+
Message.OnMessage += Message_OnMessage;
34+
35+
// Set message level to debug
36+
Message.SetMessageLevel(MessageLevel.DEBUG);
37+
38+
39+
// Initialize platforms for various used SDKs
40+
GizmoSDK.GizmoBase.Platform.Initialize();
41+
GizmoSDK.GizmoDistribution.Platform.Initialize();
42+
43+
44+
45+
// Create a manager. The manager controls it all
46+
DistManager manager = DistManager.GetManager(true);
47+
48+
// Start the manager with settting for transport protocols
49+
manager.Start(DistRemoteChannel.CreateDefaultSessionChannel(), DistRemoteChannel.CreateDefaultServerChannel());
50+
51+
//If we want to attach the DistMonitor debugger
52+
manager.EnableDebug(true);
53+
54+
// Client set up. You are a client that sends and receives information
55+
DistClient client = new DistClient("Our Test Client", manager);
56+
57+
// We need to tell the client how to initialize
58+
client.Initialize();
59+
60+
// Now we can get a session. A kind of a meeting room that is used to exchange various "topics"
61+
DistSession session = client.GetSession("MessageSession", true, true);
62+
63+
// Joint that session and subribe all events
64+
client.JoinSession(session);
65+
66+
// Subscribe standard events
67+
client.SubscribeEvents(session);
68+
69+
// Create a delegete
70+
client.OnEvent += Client_OnEvent;
71+
72+
for(int i=0;i<100;i++)
73+
{
74+
DistEvent e = manager.GetEvent();
75+
76+
e.SetAttributeValue("Message", "Helluuuu");
77+
78+
e.SetAttributeValue("Count", i);
79+
80+
client.SendEvent(e, session);
81+
82+
System.Threading.Thread.Sleep(1000);
83+
}
84+
85+
86+
87+
client.ResignSession(session);
88+
89+
client.Uninitialize();
90+
91+
// Some kind of graceful shutdown
92+
manager.Shutdown();
93+
94+
95+
// GC and platform uninit is managed by the system automatically
96+
}
97+
98+
private static void Client_OnEvent(DistClient sender, DistEvent e)
99+
{
100+
// Check if message is from us
101+
if (e.GetSource() == sender.GetClientID().InstanceID)
102+
return;
103+
104+
System.Console.WriteLine(e.ToString());
105+
}
106+
107+
private static void Message_OnMessage(string sender, MessageLevel level, string message)
108+
{
109+
System.Console.WriteLine(message);
110+
}
111+
}
112+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Event_Demo")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Event_Demo")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("3522e08c-5906-4b9f-9c5e-719cc37395b5")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)