Skip to content

Commit

Permalink
Added disconnected server
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Fyfe committed May 11, 2018
1 parent 493d9a2 commit 6941c49
Show file tree
Hide file tree
Showing 9 changed files with 593 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DisconnectedServer/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
35 changes: 35 additions & 0 deletions DisconnectedServer/ConsoleDialogProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using DisconnectedClient.Core;
using System;

namespace DisconnectedServer
{
/// <summary>
/// Represents a console based dialog provider
/// </summary>
internal class ConsoleDialogProvider : IDialogProvider
{
public ConsoleDialogProvider()
{
}

/// <summary>
/// Alert has been raised
/// </summary>
public void Alert(string text)
{
Console.WriteLine("ALERT >>>> {0}", text);
}

/// <summary>
/// Confirmation dialog
/// </summary>
/// <param name="text"></param>
/// <param name="title"></param>
/// <returns></returns>
public bool Confirm(string text, string title)
{
Console.WriteLine("CONFIRM >>>> {0}", text);
return true;
}
}
}
31 changes: 31 additions & 0 deletions DisconnectedServer/ConsoleParameters.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using MohawkCollege.Util.Console.Parameters;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DisconnectedServer
{
/// <summary>
/// Console parameters
/// </summary>
public class ConsoleParameters : DisconnectedClient.Core.ConsoleParameters
{

/// <summary>
/// Whether to run on console
/// </summary>
[Parameter("console")]
[Description("Run the server in console (opposed to service) mode")]
public bool ConsoleMode { get; set; }

/// <summary>
/// Gets the help
/// </summary>
[Parameter("help")]
[Description("Show this help")]
public bool Help { get; set; }
}
}
37 changes: 37 additions & 0 deletions DisconnectedServer/DisconnectedClientService.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions DisconnectedServer/DisconnectedClientService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

namespace DisconnectedServer
{
public partial class DisconnectedClientService : ServiceBase
{
public DisconnectedClientService()
{
InitializeComponent();
}

protected override void OnStart(string[] args)
{
}

protected override void OnStop()
{
}
}
}
204 changes: 204 additions & 0 deletions DisconnectedServer/DisconnectedServer.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{344607C3-C412-4E4A-8C1D-32146F888266}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>DisconnectedServer</RootNamespace>
<AssemblyName>DisconnectedServer</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="ExpressionEvaluator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=90d9f15d622e2348, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\ExpressionEvaluator.dll</HintPath>
</Reference>
<Reference Include="jint, Version=2.10.2.0, Culture=neutral, PublicKeyToken=2e92ba9c8d81157f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\jint.dll</HintPath>
</Reference>
<Reference Include="MohawkCollege.Util.Console.Parameters">
<HintPath>..\Solution Items\MohawkCollege.Util.Console.Parameters.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.BusinessRules.JavaScript, Version=1.0.0.26331, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\OpenIZ.BusinessRules.JavaScript.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Core">
<HintPath>..\Solution Items\OpenIZ.Core.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Core.Alert, Version=1.0.0.22773, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\OpenIZ.Core.Alert.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Core.Applets">
<HintPath>..\Solution Items\OpenIZ.Core.Applets.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Core.Model">
<HintPath>..\Solution Items\OpenIZ.Core.Model.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Core.Model.AMI, Version=1.0.0.22715, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\OpenIZ.Core.Model.AMI.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Core.Model.RISI">
<HintPath>..\Solution Items\OpenIZ.Core.Model.RISI.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Core.Model.ViewModelSerializers, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\OpenIZ.Core.Model.ViewModelSerializers.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Core.PCL">
<HintPath>..\Solution Items\OpenIZ.Core.PCL.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Messaging.AMI.Client, Version=1.0.0.22716, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\OpenIZ.Messaging.AMI.Client.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Messaging.IMSI.Client, Version=1.0.0.22716, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\OpenIZ.Messaging.IMSI.Client.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Messaging.RISI.Client">
<HintPath>..\Solution Items\OpenIZ.Messaging.RISI.Client.dll</HintPath>
</Reference>
<Reference Include="OpenIZ.Protocol.Xml, Version=1.0.0.22718, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\OpenIZ.Protocol.Xml.dll</HintPath>
</Reference>
<Reference Include="SQLite.Net, Version=3.1.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\SQLite.Net.dll</HintPath>
</Reference>
<Reference Include="SQLite.Net.Platform.Generic, Version=3.1.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\Net45\SQLite.Net.Platform.Generic.dll</HintPath>
</Reference>
<Reference Include="SQLite.Net.Platform.SqlCipher, Version=3.1.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Solution Items\Net45\SQLite.Net.Platform.SqlCipher.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsoleDialogProvider.cs" />
<Compile Include="ConsoleParameters.cs" />
<Compile Include="DisconnectedClientService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="DisconnectedClientService.Designer.cs">
<DependentUpon>DisconnectedClientService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Applets\org.openiz.core.pak">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Applets\org.openiz.templates.pak">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="lib\shim.js" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DisconnectedClient.Core\DisconnectedClient.Core.csproj">
<Project>{5315173f-51e5-4600-b31d-66cfe3b94205}</Project>
<Name>DisconnectedClient.Core</Name>
</ProjectReference>
<ProjectReference Include="..\OpenIZ.Mobile.Core.Xamarin\OpenIZ.Mobile.Core.Xamarin.csproj">
<Project>{9A06ACC9-4D6F-4EAB-8A8A-9652BC6A70AE}</Project>
<Name>OpenIZ.Mobile.Core.Xamarin</Name>
</ProjectReference>
<ProjectReference Include="..\OpenIZ.Mobile.Core\OpenIZ.Mobile.Core.csproj">
<Project>{554DF209-7744-433F-993A-783E2A2803EF}</Project>
<Name>OpenIZ.Mobile.Core</Name>
</ProjectReference>
<ProjectReference Include="..\OpenIZ.Mobile.Reporting\OpenIZ.Mobile.Reporting.csproj">
<Project>{39a382d5-a4a1-415a-8ceb-618177e23fac}</Project>
<Name>OpenIZ.Mobile.Reporting</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SignedRelease|AnyCPU'">
<PreBuildEvent>
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets\org.openiz.core" -o "$(TargetDir)\org.openiz.core.pak" --keyFile="$(SolutionDir)\..\keys\org.openiz.core.pfx" --keyPassword="$(SolutionDir)\..\keys\org.openiz.core.pass" --embedCert --optimize
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets\org.openiz.templates" -o "$(TargetDir)\org.openiz.templates.pak" --keyFile="$(SolutionDir)\..\keys\org.openiz.core.pfx" --keyPassword="$(SolutionDir)\..\keys\org.openiz.core.pass" --embedCert --optimize

copy "$(TargetDir)\org.openiz.core.pak" "$(ProjectDir)\Applets\org.openiz.core.pak"
copy "$(TargetDir)\org.openiz.templates.pak" "$(ProjectDir)\Applets\org.openiz.templates.pak"
copy "$(SolutionDir)\Solution Items\Net45\libeay32md.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)\sqlite3.dll"

</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<PreBuildEvent>
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets\org.openiz.core" -o "$(TargetDir)\org.openiz.core.pak" --optimize
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets\org.openiz.templates" -o "$(TargetDir)\org.openiz.templates.pak" --optimize
copy "$(TargetDir)\org.openiz.core.pak" "$(ProjectDir)\Applets\org.openiz.core.pak"
copy "$(TargetDir)\org.openiz.templates.pak" "$(ProjectDir)\Applets\org.openiz.templates.pak"
copy "$(SolutionDir)\Solution Items\Net45\libeay32md.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)\sqlite3.dll"
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<PreBuildEvent>
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets\org.openiz.core" -o "$(TargetDir)\org.openiz.core.pak"
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets\org.openiz.templates" -o "$(TargetDir)\org.openiz.templates.pak"
copy "$(TargetDir)\org.openiz.core.pak" "$(ProjectDir)\Applets\org.openiz.core.pak"
copy "$(TargetDir)\org.openiz.templates.pak" "$(ProjectDir)\Applets\org.openiz.templates.pak"
copy "$(SolutionDir)\Solution Items\Net45\libeay32md.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)\sqlite3.dll"
</PreBuildEvent>
</PropertyGroup>
</Project>
Loading

0 comments on commit 6941c49

Please sign in to comment.