Skip to content

Commit 9900874

Browse files
committedSep 29, 2016
first plugin tests
1 parent fc2e584 commit 9900874

19 files changed

+497
-102
lines changed
 

‎LogWindow/LogWindow.cs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace LogWindow
4+
{
5+
public partial class LogWindow : Gtk.Window
6+
{
7+
public LogWindow() :
8+
base(Gtk.WindowType.Toplevel)
9+
{
10+
this.Build();
11+
}
12+
}
13+
}
14+

‎LogWindow/LogWindow.csproj

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{B3345025-AE6D-4741-9FB9-F69F2B91B244}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>LogWindow</RootNamespace>
11+
<AssemblyName>LogWindow</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15+
<DebugSymbols>true</DebugSymbols>
16+
<DebugType>full</DebugType>
17+
<Optimize>false</Optimize>
18+
<OutputPath>bin\Debug</OutputPath>
19+
<DefineConstants>DEBUG;</DefineConstants>
20+
<ErrorReport>prompt</ErrorReport>
21+
<WarningLevel>4</WarningLevel>
22+
<ConsolePause>false</ConsolePause>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>full</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release</OutputPath>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
<ConsolePause>false</ConsolePause>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
35+
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
36+
<Reference Include="Mono.Posix" />
37+
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
38+
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
39+
</ItemGroup>
40+
<ItemGroup>
41+
<Compile Include="Properties\AssemblyInfo.cs" />
42+
<Compile Include="gtk-gui\generated.cs" />
43+
<Compile Include="LogWindow.cs" />
44+
<Compile Include="gtk-gui\LogWindow.LogWindow.cs" />
45+
<Compile Include="Plugin.cs" />
46+
</ItemGroup>
47+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
48+
<ItemGroup>
49+
<EmbeddedResource Include="gtk-gui\gui.stetic">
50+
<LogicalName>gui.stetic</LogicalName>
51+
</EmbeddedResource>
52+
</ItemGroup>
53+
<ItemGroup>
54+
<ProjectReference Include="..\plugins\plugins.csproj">
55+
<Project>{7F18FA38-0899-4C93-AE09-B04395FB4301}</Project>
56+
<Name>plugins</Name>
57+
</ProjectReference>
58+
</ItemGroup>
59+
</Project>

‎LogWindow/Plugin.cs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using plugins;
3+
4+
namespace LogWindow
5+
{
6+
public class Plugin : PluginInterface
7+
{
8+
public string PluginName { get { return "LogWindow"; } }
9+
10+
public Gtk.Window PluginWindow { get { return new LogWindow(); } }
11+
}
12+
}
13+

‎LogWindow/Properties/AssemblyInfo.cs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
4+
// Information about this assembly is defined by the following attributes.
5+
// Change them to the values specific to your project.
6+
7+
[assembly: AssemblyTitle("LogWindow")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("")]
12+
[assembly: AssemblyCopyright("pbuchegger")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17+
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
18+
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
19+
20+
[assembly: AssemblyVersion("1.0.*")]
21+
22+
// The following attributes are used to specify the signing key for the assembly,
23+
// if desired. See the Mono documentation for more information about signing.
24+
25+
//[assembly: AssemblyDelaySign(false)]
26+
//[assembly: AssemblyKeyFile("")]
27+
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
// This file has been generated by the GUI designer. Do not modify.
3+
namespace LogWindow
4+
{
5+
public partial class LogWindow
6+
{
7+
private global::Gtk.HBox hbox4;
8+
9+
private global::Gtk.Button button6;
10+
11+
private global::Gtk.Label label3;
12+
13+
protected virtual void Build ()
14+
{
15+
global::Stetic.Gui.Initialize (this);
16+
// Widget LogWindow.LogWindow
17+
this.Name = "LogWindow.LogWindow";
18+
this.Title = global::Mono.Unix.Catalog.GetString ("LogWindow");
19+
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
20+
// Container child LogWindow.LogWindow.Gtk.Container+ContainerChild
21+
this.hbox4 = new global::Gtk.HBox ();
22+
this.hbox4.Name = "hbox4";
23+
this.hbox4.Spacing = 6;
24+
// Container child hbox4.Gtk.Box+BoxChild
25+
this.button6 = new global::Gtk.Button ();
26+
this.button6.CanFocus = true;
27+
this.button6.Name = "button6";
28+
this.button6.UseUnderline = true;
29+
this.button6.Label = global::Mono.Unix.Catalog.GetString ("Hihi");
30+
this.hbox4.Add (this.button6);
31+
global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.button6]));
32+
w1.Position = 0;
33+
w1.Expand = false;
34+
w1.Fill = false;
35+
// Container child hbox4.Gtk.Box+BoxChild
36+
this.label3 = new global::Gtk.Label ();
37+
this.label3.Name = "label3";
38+
this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("labelprop");
39+
this.hbox4.Add (this.label3);
40+
global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.label3]));
41+
w2.Position = 1;
42+
w2.Expand = false;
43+
w2.Fill = false;
44+
this.Add (this.hbox4);
45+
if ((this.Child != null)) {
46+
this.Child.ShowAll ();
47+
}
48+
this.DefaultWidth = 400;
49+
this.DefaultHeight = 300;
50+
this.Show ();
51+
}
52+
}
53+
}

‎LogWindow/gtk-gui/generated.cs

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
// This file has been generated by the GUI designer. Do not modify.
3+
namespace Stetic
4+
{
5+
internal class Gui
6+
{
7+
private static bool initialized;
8+
9+
internal static void Initialize (Gtk.Widget iconRenderer)
10+
{
11+
if ((Stetic.Gui.initialized == false)) {
12+
Stetic.Gui.initialized = true;
13+
}
14+
}
15+
}
16+
17+
internal class ActionGroups
18+
{
19+
public static Gtk.ActionGroup GetActionGroup (System.Type type)
20+
{
21+
return Stetic.ActionGroups.GetActionGroup (type.FullName);
22+
}
23+
24+
public static Gtk.ActionGroup GetActionGroup (string name)
25+
{
26+
return null;
27+
}
28+
}
29+
}

‎LogWindow/gtk-gui/gui.stetic

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<stetic-interface>
3+
<configuration>
4+
<images-root-path>..</images-root-path>
5+
<target-gtk-version>2.12</target-gtk-version>
6+
</configuration>
7+
<import>
8+
<widget-library name="../../plugins/bin/Debug/plugins.dll" />
9+
<widget-library name="../bin/Debug/LogWindow.dll" internal="true" />
10+
</import>
11+
<widget class="Gtk.Window" id="LogWindow.LogWindow" design-size="400 300">
12+
<property name="MemberName" />
13+
<property name="Title" translatable="yes">LogWindow</property>
14+
<property name="WindowPosition">CenterOnParent</property>
15+
<child>
16+
<widget class="Gtk.HBox" id="hbox4">
17+
<property name="MemberName" />
18+
<property name="Spacing">6</property>
19+
<child>
20+
<widget class="Gtk.Button" id="button6">
21+
<property name="MemberName" />
22+
<property name="CanFocus">True</property>
23+
<property name="Type">TextOnly</property>
24+
<property name="Label" translatable="yes">Hihi</property>
25+
<property name="UseUnderline">True</property>
26+
</widget>
27+
<packing>
28+
<property name="Position">0</property>
29+
<property name="AutoSize">True</property>
30+
<property name="Expand">False</property>
31+
<property name="Fill">False</property>
32+
</packing>
33+
</child>
34+
<child>
35+
<widget class="Gtk.Label" id="label3">
36+
<property name="MemberName" />
37+
<property name="LabelProp" translatable="yes">labelprop</property>
38+
</widget>
39+
<packing>
40+
<property name="Position">1</property>
41+
<property name="AutoSize">True</property>
42+
<property name="Expand">False</property>
43+
<property name="Fill">False</property>
44+
</packing>
45+
</child>
46+
<child>
47+
<placeholder />
48+
</child>
49+
</widget>
50+
</child>
51+
</widget>
52+
</stetic-interface>

‎client/MainWindow.cs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Gtk;
4+
using client;
5+
using plugins;
6+
7+
public partial class MainWindow: Gtk.Window
8+
{
9+
public MainWindow() : base(Gtk.WindowType.Toplevel)
10+
{
11+
Build();
12+
}
13+
14+
protected void OnDeleteEvent(object sender, DeleteEventArgs a)
15+
{
16+
Application.Quit();
17+
a.RetVal = true;
18+
}
19+
20+
protected void OnButton3Clicked(object sender, EventArgs e)
21+
{
22+
Console.WriteLine("lets load the plugins!");
23+
ICollection<PluginInterface> plugins = GenericPluginLoader<PluginInterface>.LoadPlugins(".");
24+
foreach(PluginInterface plugin in plugins)
25+
{
26+
Console.WriteLine(plugin.PluginName);
27+
plugin.PluginWindow.Show();
28+
}
29+
Console.WriteLine("loaded all plugins!");
30+
}
31+
}

‎client/Program.cs

+6-32
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,16 @@
1-
/*********************************************************************************************
2-
*
3-
* ILS-Sim.org Apps
4-
* Copyright (C) 2016 ils-sim.org Team
5-
*
6-
* This program is free software; you can redistribute it and/or modify it under the terms
7-
* of the GNU General Public License as published by the Free Software Foundation; either
8-
* version 3 of the License, or (at your option) any later version.
9-
*
10-
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12-
* See the GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License along with this
15-
* program; if not, see <http://www.gnu.org/licenses/>.
16-
*
17-
*********************************************************************************************/
18-
using System;
19-
using System.Collections.Generic;
20-
using network;
21-
using models;
1+
using System;
2+
using Gtk;
223

234
namespace client
245
{
256
class MainClass
267
{
27-
public static void ReceivePacket(Protocol package)
28-
{
29-
Console.WriteLine(package.ToString());
30-
}
31-
328
public static void Main(string[] args)
339
{
34-
10+
Application.Init();
11+
MainWindow win = new MainWindow();
12+
win.Show();
13+
Application.Run();
3514

3615
/*TCPClient client = new TCPClient();
3716
client.Connect("127.0.0.1", 1244);
@@ -85,10 +64,5 @@ public static void Main(string[] args)
8564
CarUpdate update = CarUpdateFactory.Get(car);
8665
List<CarPosition> positions = CarPositionFactory.Get(car);*/
8766
}
88-
89-
static void HandleReceivePacketEventHandler(Protocol package)
90-
{
91-
92-
}
9367
}
9468
}

‎client/Properties/AssemblyInfo.cs

+17-29
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
1-
/*********************************************************************************************
2-
*
3-
* ILS-Sim.org Apps
4-
* Copyright (C) 2016 ils-sim.org Team
5-
*
6-
* This program is free software; you can redistribute it and/or modify it under the terms
7-
* of the GNU General Public License as published by the Free Software Foundation; either
8-
* version 3 of the License, or (at your option) any later version.
9-
*
10-
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12-
* See the GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License along with this
15-
* program; if not, see <http://www.gnu.org/licenses/>.
16-
*
17-
*********************************************************************************************/
18-
using System.Reflection;
1+
using System.Reflection;
192
using System.Runtime.CompilerServices;
203

21-
// Information about this assembly is defined by the following attributes.
4+
// Information about this assembly is defined by the following attributes.
225
// Change them to the values specific to your project.
23-
[assembly: AssemblyTitle ("client")]
24-
[assembly: AssemblyDescription ("")]
25-
[assembly: AssemblyConfiguration ("")]
26-
[assembly: AssemblyCompany ("")]
27-
[assembly: AssemblyProduct ("")]
28-
[assembly: AssemblyCopyright ("ils-sim.org")]
29-
[assembly: AssemblyTrademark ("")]
30-
[assembly: AssemblyCulture ("")]
6+
7+
[assembly: AssemblyTitle("client")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("")]
12+
[assembly: AssemblyCopyright("pbuchegger")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
3116
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
3217
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
3318
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
34-
[assembly: AssemblyVersion ("1.0.*")]
35-
// The following attributes are used to specify the signing key for the assembly,
19+
20+
[assembly: AssemblyVersion("1.0.*")]
21+
22+
// The following attributes are used to specify the signing key for the assembly,
3623
// if desired. See the Mono documentation for more information about signing.
24+
3725
//[assembly: AssemblyDelaySign(false)]
3826
//[assembly: AssemblyKeyFile("")]
3927

‎client/client.csproj

+36-15
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{756F8EBF-6E98-45E3-A26C-013D86C0696A}</ProjectGuid>
9-
<OutputType>Exe</OutputType>
6+
<ProjectGuid>{1070325B-4597-4757-B43F-83C8D6642FAB}</ProjectGuid>
7+
<OutputType>WinExe</OutputType>
108
<RootNamespace>client</RootNamespace>
119
<AssemblyName>client</AssemblyName>
10+
<ProductVersion>8.0.30703</ProductVersion>
11+
<SchemaVersion>2.0</SchemaVersion>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1213
</PropertyGroup>
1314
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1415
<DebugSymbols>true</DebugSymbols>
@@ -18,40 +19,60 @@
1819
<DefineConstants>DEBUG;</DefineConstants>
1920
<ErrorReport>prompt</ErrorReport>
2021
<WarningLevel>4</WarningLevel>
21-
<Externalconsole>true</Externalconsole>
22+
<ConsolePause>false</ConsolePause>
2223
</PropertyGroup>
2324
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2425
<DebugType>full</DebugType>
2526
<Optimize>true</Optimize>
2627
<OutputPath>bin\Release</OutputPath>
2728
<ErrorReport>prompt</ErrorReport>
2829
<WarningLevel>4</WarningLevel>
29-
<Externalconsole>true</Externalconsole>
30+
<ConsolePause>false</ConsolePause>
3031
</PropertyGroup>
3132
<ItemGroup>
3233
<Reference Include="System" />
33-
<Reference Include="Google.Protobuf">
34-
<HintPath>..\packages\Google.Protobuf.dll</HintPath>
34+
<Reference Include="gtk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
35+
<SpecificVersion>False</SpecificVersion>
36+
</Reference>
37+
<Reference Include="gdk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
38+
<SpecificVersion>False</SpecificVersion>
39+
</Reference>
40+
<Reference Include="glib-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
41+
<SpecificVersion>False</SpecificVersion>
42+
</Reference>
43+
<Reference Include="glade-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
44+
<SpecificVersion>False</SpecificVersion>
45+
</Reference>
46+
<Reference Include="pango-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
47+
<SpecificVersion>False</SpecificVersion>
48+
</Reference>
49+
<Reference Include="atk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
50+
<SpecificVersion>False</SpecificVersion>
3551
</Reference>
52+
<Reference Include="Mono.Posix" />
3653
</ItemGroup>
3754
<ItemGroup>
55+
<EmbeddedResource Include="gtk-gui\gui.stetic">
56+
<LogicalName>gui.stetic</LogicalName>
57+
</EmbeddedResource>
58+
</ItemGroup>
59+
<ItemGroup>
60+
<Compile Include="gtk-gui\generated.cs" />
61+
<Compile Include="MainWindow.cs" />
62+
<Compile Include="gtk-gui\MainWindow.cs" />
3863
<Compile Include="Program.cs" />
3964
<Compile Include="Properties\AssemblyInfo.cs" />
4065
<Compile Include="GenericPluginLoader.cs" />
4166
</ItemGroup>
4267
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
4368
<ItemGroup>
44-
<ProjectReference Include="..\network\network.csproj">
45-
<Project>{0E72E075-35EA-46B1-A8E6-0A3BBBD26AC5}</Project>
46-
<Name>network</Name>
69+
<ProjectReference Include="..\models\models.csproj">
70+
<Project>{75AE14E4-F10C-40B7-B473-F88B7592C162}</Project>
71+
<Name>models</Name>
4772
</ProjectReference>
4873
<ProjectReference Include="..\plugins\plugins.csproj">
4974
<Project>{7F18FA38-0899-4C93-AE09-B04395FB4301}</Project>
5075
<Name>plugins</Name>
5176
</ProjectReference>
52-
<ProjectReference Include="..\models\models.csproj">
53-
<Project>{75AE14E4-F10C-40B7-B473-F88B7592C162}</Project>
54-
<Name>models</Name>
55-
</ProjectReference>
5677
</ItemGroup>
5778
</Project>

‎client/gtk-gui/MainWindow.cs

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
// This file has been generated by the GUI designer. Do not modify.
3+
4+
public partial class MainWindow
5+
{
6+
private global::Gtk.HBox hbox3;
7+
8+
private global::Gtk.Button button3;
9+
10+
protected virtual void Build ()
11+
{
12+
global::Stetic.Gui.Initialize (this);
13+
// Widget MainWindow
14+
this.Name = "MainWindow";
15+
this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow");
16+
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
17+
// Container child MainWindow.Gtk.Container+ContainerChild
18+
this.hbox3 = new global::Gtk.HBox ();
19+
this.hbox3.Name = "hbox3";
20+
this.hbox3.Spacing = 6;
21+
// Container child hbox3.Gtk.Box+BoxChild
22+
this.button3 = new global::Gtk.Button ();
23+
this.button3.CanFocus = true;
24+
this.button3.Name = "button3";
25+
this.button3.UseUnderline = true;
26+
this.button3.Label = global::Mono.Unix.Catalog.GetString ("GtkButton");
27+
this.hbox3.Add (this.button3);
28+
global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.button3]));
29+
w1.Position = 0;
30+
w1.Expand = false;
31+
w1.Fill = false;
32+
this.Add (this.hbox3);
33+
if ((this.Child != null)) {
34+
this.Child.ShowAll ();
35+
}
36+
this.DefaultWidth = 400;
37+
this.DefaultHeight = 300;
38+
this.Show ();
39+
this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
40+
this.button3.Clicked += new global::System.EventHandler (this.OnButton3Clicked);
41+
}
42+
}

‎client/gtk-gui/generated.cs

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
// This file has been generated by the GUI designer. Do not modify.
3+
namespace Stetic
4+
{
5+
internal class Gui
6+
{
7+
private static bool initialized;
8+
9+
internal static void Initialize (Gtk.Widget iconRenderer)
10+
{
11+
if ((Stetic.Gui.initialized == false)) {
12+
Stetic.Gui.initialized = true;
13+
}
14+
}
15+
}
16+
17+
internal class ActionGroups
18+
{
19+
public static Gtk.ActionGroup GetActionGroup (System.Type type)
20+
{
21+
return Stetic.ActionGroups.GetActionGroup (type.FullName);
22+
}
23+
24+
public static Gtk.ActionGroup GetActionGroup (string name)
25+
{
26+
return null;
27+
}
28+
}
29+
}

‎client/gtk-gui/gui.stetic

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<stetic-interface>
3+
<configuration>
4+
<images-root-path>..</images-root-path>
5+
</configuration>
6+
<import>
7+
<widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
8+
<widget-library name="../../plugins/bin/Debug/plugins.dll" />
9+
<widget-library name="../bin/Debug/client.exe" internal="true" />
10+
</import>
11+
<widget class="Gtk.Window" id="MainWindow" design-size="400 300">
12+
<property name="MemberName" />
13+
<property name="Title" translatable="yes">MainWindow</property>
14+
<property name="WindowPosition">CenterOnParent</property>
15+
<signal name="DeleteEvent" handler="OnDeleteEvent" />
16+
<child>
17+
<widget class="Gtk.HBox" id="hbox3">
18+
<property name="MemberName" />
19+
<property name="Spacing">6</property>
20+
<child>
21+
<widget class="Gtk.Button" id="button3">
22+
<property name="MemberName" />
23+
<property name="CanFocus">True</property>
24+
<property name="Type">TextOnly</property>
25+
<property name="Label" translatable="yes">GtkButton</property>
26+
<property name="UseUnderline">True</property>
27+
<signal name="Clicked" handler="OnButton3Clicked" />
28+
</widget>
29+
<packing>
30+
<property name="Position">0</property>
31+
<property name="AutoSize">True</property>
32+
<property name="Expand">False</property>
33+
<property name="Fill">False</property>
34+
</packing>
35+
</child>
36+
<child>
37+
<placeholder />
38+
</child>
39+
<child>
40+
<placeholder />
41+
</child>
42+
</widget>
43+
</child>
44+
</widget>
45+
</stetic-interface>

‎main.sln

+17-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 11.00
33
# Visual Studio 2010
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "models", "models\models.csproj", "{75AE14E4-F10C-40B7-B473-F88B7592C162}"
55
EndProject
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "client\client.csproj", "{756F8EBF-6E98-45E3-A26C-013D86C0696A}"
7-
EndProject
86
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plugins", "plugins\plugins.csproj", "{7F18FA38-0899-4C93-AE09-B04395FB4301}"
97
EndProject
108
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "network", "network\network.csproj", "{0E72E075-35EA-46B1-A8E6-0A3BBBD26AC5}"
@@ -13,6 +11,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json", "Newtonso
1311
EndProject
1412
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "unittests", "unittests\unittests.csproj", "{30E839AE-1FB3-4D57-A790-08B21D29877F}"
1513
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "client\client.csproj", "{1070325B-4597-4757-B43F-83C8D6642FAB}"
15+
EndProject
16+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{90204DBD-D1C6-4EC2-9053-8D18B77EE157}"
17+
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogWindow", "LogWindow\LogWindow.csproj", "{B3345025-AE6D-4741-9FB9-F69F2B91B244}"
19+
EndProject
1620
Global
1721
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1822
Debug|Any CPU = Debug|Any CPU
@@ -23,14 +27,14 @@ Global
2327
{0E72E075-35EA-46B1-A8E6-0A3BBBD26AC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
2428
{0E72E075-35EA-46B1-A8E6-0A3BBBD26AC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
2529
{0E72E075-35EA-46B1-A8E6-0A3BBBD26AC5}.Release|Any CPU.Build.0 = Release|Any CPU
30+
{1070325B-4597-4757-B43F-83C8D6642FAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31+
{1070325B-4597-4757-B43F-83C8D6642FAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
32+
{1070325B-4597-4757-B43F-83C8D6642FAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
33+
{1070325B-4597-4757-B43F-83C8D6642FAB}.Release|Any CPU.Build.0 = Release|Any CPU
2634
{30E839AE-1FB3-4D57-A790-08B21D29877F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2735
{30E839AE-1FB3-4D57-A790-08B21D29877F}.Debug|Any CPU.Build.0 = Debug|Any CPU
2836
{30E839AE-1FB3-4D57-A790-08B21D29877F}.Release|Any CPU.ActiveCfg = Release|Any CPU
2937
{30E839AE-1FB3-4D57-A790-08B21D29877F}.Release|Any CPU.Build.0 = Release|Any CPU
30-
{756F8EBF-6E98-45E3-A26C-013D86C0696A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31-
{756F8EBF-6E98-45E3-A26C-013D86C0696A}.Debug|Any CPU.Build.0 = Debug|Any CPU
32-
{756F8EBF-6E98-45E3-A26C-013D86C0696A}.Release|Any CPU.ActiveCfg = Release|Any CPU
33-
{756F8EBF-6E98-45E3-A26C-013D86C0696A}.Release|Any CPU.Build.0 = Release|Any CPU
3438
{75AE14E4-F10C-40B7-B473-F88B7592C162}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3539
{75AE14E4-F10C-40B7-B473-F88B7592C162}.Debug|Any CPU.Build.0 = Debug|Any CPU
3640
{75AE14E4-F10C-40B7-B473-F88B7592C162}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -43,6 +47,13 @@ Global
4347
{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
4448
{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
4549
{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|Any CPU.Build.0 = Release|Any CPU
50+
{B3345025-AE6D-4741-9FB9-F69F2B91B244}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51+
{B3345025-AE6D-4741-9FB9-F69F2B91B244}.Debug|Any CPU.Build.0 = Debug|Any CPU
52+
{B3345025-AE6D-4741-9FB9-F69F2B91B244}.Release|Any CPU.ActiveCfg = Release|Any CPU
53+
{B3345025-AE6D-4741-9FB9-F69F2B91B244}.Release|Any CPU.Build.0 = Release|Any CPU
54+
EndGlobalSection
55+
GlobalSection(NestedProjects) = preSolution
56+
{B3345025-AE6D-4741-9FB9-F69F2B91B244} = {90204DBD-D1C6-4EC2-9053-8D18B77EE157}
4657
EndGlobalSection
4758
GlobalSection(MonoDevelopProperties) = preSolution
4859
StartupItem = models\models.csproj

‎network/NetworkManager.cs

+16-16
Original file line numberDiff line numberDiff line change
@@ -94,44 +94,44 @@ private void PackageReceive(Protocol package)
9494
case Protocol.Types.Type.CallAccepted:
9595
if(onCallAccepted != null)
9696
onCallAccepted(
97-
EmergencyFactory.Get(package.CallAccepted.IdEmerg),
98-
UserFactory.Get(package.CallAccepted.IdReciever));
97+
EmergencyFactory.Get(Convert.ToInt32(package.CallAccepted.IdEmerg)),
98+
UserFactory.Get(Convert.ToInt32(package.CallAccepted.IdReciever)));
9999
break;
100100
case Protocol.Types.Type.CaseEnd:
101101
if(onCaseEnd != null)
102-
onCaseEnd(EmergencyFactory.Get(package.CaseEnd.IdCase));
102+
onCaseEnd(EmergencyFactory.Get(Convert.ToInt32(package.CaseEnd.IdCase)));
103103
break;
104104
case Protocol.Types.Type.CaseNew:
105105
if(onCaseNew != null)
106-
onCaseNew(EmergencyFactory.Get(package.CaseNew.IdCase));
106+
onCaseNew(EmergencyFactory.Get(Convert.ToInt32(package.CaseNew.IdCase)));
107107
break;
108108
case Protocol.Types.Type.CaseUpdate:
109109
if(onCaseUpdate != null)
110-
onCaseUpdate(EmergencyFactory.Get(package.CaseUpdate.IdCase));
110+
onCaseUpdate(EmergencyFactory.Get(Convert.ToInt32(package.CaseUpdate.IdCase)));
111111
break;
112112
case Protocol.Types.Type.EmergEnd:
113113
if(onEmergEnd != null)
114-
onEmergEnd(EmergencyFactory.Get(package.EmergEnd.IdEmerg));
114+
onEmergEnd(EmergencyFactory.Get(Convert.ToInt32(package.EmergEnd.IdEmerg)));
115115
break;
116116
case Protocol.Types.Type.EmergNew:
117117
if(onEmergNew != null)
118-
onEmergNew(EmergencyFactory.Get(package.EmergNew.IdEmerg));
118+
onEmergNew(EmergencyFactory.Get(Convert.ToInt32(package.EmergNew.IdEmerg)));
119119
break;
120120
case Protocol.Types.Type.EmergUpdate:
121121
if(onEmergUpdate != null)
122-
onEmergUpdate(EmergencyFactory.Get(package.EmergUpdate.IdEmerg));
122+
onEmergUpdate(EmergencyFactory.Get(Convert.ToInt32(package.EmergUpdate.IdEmerg)));
123123
break;
124124
case Protocol.Types.Type.MsgChat:
125125
if(onMsgChat != null)
126-
onMsgChat(UserFactory.Get(package.MsgChat.IdSender), package.MsgChat.NewMessage);
126+
onMsgChat(UserFactory.Get(Convert.ToInt32(package.MsgChat.IdSender)), package.MsgChat.NewMessage);
127127
break;
128128
case Protocol.Types.Type.MsgPrivate:
129129
if(onMsgPrivate != null)
130-
onMsgPrivate(UserFactory.Get(package.MsgPrivate.IdSender), package.MsgPrivate.NewMessage);
130+
onMsgPrivate(UserFactory.Get(Convert.ToInt32(package.MsgPrivate.IdSender)), package.MsgPrivate.NewMessage);
131131
break;
132132
case Protocol.Types.Type.MsgWall:
133133
if(onMsgWall != null)
134-
onMsgWall(UserFactory.Get(package.MsgWall.IdSender), package.MsgWall.NewMessage);
134+
onMsgWall(UserFactory.Get(Convert.ToInt32(package.MsgWall.IdSender)), package.MsgWall.NewMessage);
135135
break;
136136
case Protocol.Types.Type.Quit:
137137
if(onQuit != null)
@@ -151,26 +151,26 @@ private void PackageReceive(Protocol package)
151151
break;
152152
case Protocol.Types.Type.VehicleAlarm:
153153
if(onVehicleAlarm != null)
154-
onVehicleAlarm(CarFactory.Get(package.VehicleAlarm.IdVehicle));
154+
onVehicleAlarm(CarFactory.Get(Convert.ToInt32(package.VehicleAlarm.IdVehicle)));
155155
break;
156156
case Protocol.Types.Type.VehicleMsg:
157157
if(onVehicleMsg != null)
158-
onVehicleMsg(CarFactory.Get(package.VehicleMsg.IdVehicle), package.VehicleMsg.NewMessage);
158+
onVehicleMsg(CarFactory.Get(Convert.ToInt32(package.VehicleMsg.IdVehicle)), package.VehicleMsg.NewMessage);
159159
break;
160160
case Protocol.Types.Type.VehiclePosition:
161161
if(onVehiclePosition != null)
162162
onVehiclePosition(
163-
CarFactory.Get(package.VehiclePosition.IdVehicle),
163+
CarFactory.Get(Convert.ToInt32(package.VehiclePosition.IdVehicle)),
164164
new models.CarPosition(DateTime.Now,
165165
new models.Point(package.VehiclePosition.Latitude, package.VehiclePosition.Longitude)));
166166
break;
167167
case Protocol.Types.Type.VehicleStorno:
168168
if(onVehicleStorno != null)
169-
onVehicleStorno(CarFactory.Get(package.VehicleStornno.IdVehicle));
169+
onVehicleStorno(CarFactory.Get(Convert.ToInt32(package.VehicleStornno.IdVehicle)));
170170
break;
171171
case Protocol.Types.Type.VehicleUpdate:
172172
if(onVehicleUpdate != null)
173-
onVehicleUpdate(CarFactory.Get(package.VehicleUpdate.IdVehicle));
173+
onVehicleUpdate(CarFactory.Get(Convert.ToInt32(package.VehicleUpdate.IdVehicle)));
174174
break;
175175
}
176176
}

‎plugins/PluginInterface.cs

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ namespace plugins
2020
public interface PluginInterface
2121
{
2222
string PluginName { get; }
23+
24+
Gtk.Window PluginWindow { get; }
2325
}
2426
}
2527

‎plugins/plugins.csproj

+9
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,19 @@
3030
</PropertyGroup>
3131
<ItemGroup>
3232
<Reference Include="System" />
33+
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
34+
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
35+
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
3336
</ItemGroup>
3437
<ItemGroup>
3538
<Compile Include="Properties\AssemblyInfo.cs" />
3639
<Compile Include="PluginInterface.cs" />
3740
</ItemGroup>
3841
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
42+
<ItemGroup>
43+
<ProjectReference Include="..\models\models.csproj">
44+
<Project>{75AE14E4-F10C-40B7-B473-F88B7592C162}</Project>
45+
<Name>models</Name>
46+
</ProjectReference>
47+
</ItemGroup>
3948
</Project>

‎unittests/unittests.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
<None Include="packages.config" />
4444
</ItemGroup>
4545
<ItemGroup>
46-
<ProjectReference Include="..\client\client.csproj">
47-
<Project>{756F8EBF-6E98-45E3-A26C-013D86C0696A}</Project>
48-
<Name>client</Name>
49-
</ProjectReference>
5046
<ProjectReference Include="..\models\models.csproj">
5147
<Project>{75AE14E4-F10C-40B7-B473-F88B7592C162}</Project>
5248
<Name>models</Name>

0 commit comments

Comments
 (0)
Please sign in to comment.