Commit d768e60a authored by Kirill's avatar Kirill

Удалена реализация ipc через named pipes

parent c2c21b90
...@@ -4,8 +4,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TourDataManager", "TourData ...@@ -4,8 +4,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TourDataManager", "TourData
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TourDataManagerConsoleApplication", "TourDataManagerConsoleApplication\TourDataManagerConsoleApplication.csproj", "{66F0D20A-DA45-45CB-8DDF-0F9900E03AE3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TourDataManagerConsoleApplication", "TourDataManagerConsoleApplication\TourDataManagerConsoleApplication.csproj", "{66F0D20A-DA45-45CB-8DDF-0F9900E03AE3}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Clifton.Core.Pipes", "Clifton.Core.Pipes\Clifton.Core.Pipes.csproj", "{B826097C-CC24-4CAC-8D31-8A65C4B76BE9}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -20,9 +18,5 @@ Global ...@@ -20,9 +18,5 @@ Global
{66F0D20A-DA45-45CB-8DDF-0F9900E03AE3}.Debug|Any CPU.Build.0 = Debug|Any CPU {66F0D20A-DA45-45CB-8DDF-0F9900E03AE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66F0D20A-DA45-45CB-8DDF-0F9900E03AE3}.Release|Any CPU.ActiveCfg = Release|Any CPU {66F0D20A-DA45-45CB-8DDF-0F9900E03AE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66F0D20A-DA45-45CB-8DDF-0F9900E03AE3}.Release|Any CPU.Build.0 = Release|Any CPU {66F0D20A-DA45-45CB-8DDF-0F9900E03AE3}.Release|Any CPU.Build.0 = Release|Any CPU
{B826097C-CC24-4CAC-8D31-8A65C4B76BE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B826097C-CC24-4CAC-8D31-8A65C4B76BE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B826097C-CC24-4CAC-8D31-8A65C4B76BE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B826097C-CC24-4CAC-8D31-8A65C4B76BE9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal
...@@ -13,10 +13,8 @@ namespace TourDataManager { ...@@ -13,10 +13,8 @@ namespace TourDataManager {
Console.ResetColor(); Console.ResetColor();
} }
public static char ReadKey(){ public static string ReadLine(){
var ch = Console.ReadKey().KeyChar; return Console.ReadLine();
Console.WriteLine();
return ch;
} }
} }
} }
\ No newline at end of file
using System; using System;
using System.IO; using System.Text;
using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using Clifton.Core.Pipes;
using Ninject.Activation.Strategies;
using TourDataManager; using TourDataManager;
using TourDataManager.Entities; using TourDataManager.Entities;
...@@ -18,9 +15,16 @@ namespace TourDataManagerConsoleApplication { ...@@ -18,9 +15,16 @@ namespace TourDataManagerConsoleApplication {
public static TourDataManager.TourDataManagerPlugin TourDataManagerPlugin; public static TourDataManager.TourDataManagerPlugin TourDataManagerPlugin;
public static void Main(string[] args){ public static void Main(string[] args){
Console.OutputEncoding = Encoding.UTF8;
Console.InputEncoding = Encoding.UTF8;
Console.WriteLine("Привет");
var line = Console.ReadLine();
Console.WriteLine(line);
//TourDataManagerPlugin = new TourDataManager.TourDataManagerPlugin(PersistentPath); //TourDataManagerPlugin = new TourDataManager.TourDataManagerPlugin(PersistentPath);
CreateServer("Test3"); //CreateServer("Test3");
//MainWindow(); //MainWindow();
...@@ -29,30 +33,10 @@ namespace TourDataManagerConsoleApplication { ...@@ -29,30 +33,10 @@ namespace TourDataManagerConsoleApplication {
Console.Read(); Console.Read();
} }
private static ServerPipe CreateServer(string serverName)
{
ServerPipe serverPipe = new ServerPipe(serverName, p => p.StartStringReaderAsync());
serverPipe.DataReceived += (sndr, args) => {
Console.WriteLine($"Server pipe /DataRecieved : {args.String}");
};
serverPipe.Connected += (sndr, args) => {
Console.WriteLine($"Server pipe /Connected : {args}");
};
serverPipe.PipeClosed += (sndr, args) => {
Console.WriteLine($"Server pipe /Closed : {args}");
};
return serverPipe;
}
public static void MainWindow(){ public static void MainWindow(){
Debug.Log("Commands : \n0 - Auth\n1 - Show estates list\n2 - exit"); Debug.Log("Commands : \n0 - Auth\n1 - Show estates list\n2 - exit");
var ch = Debug.ReadKey(); var ch = Debug.ReadLine()[0];
switch (ch){ switch (ch){
case '0' : case '0' :
...@@ -78,7 +62,7 @@ namespace TourDataManagerConsoleApplication { ...@@ -78,7 +62,7 @@ namespace TourDataManagerConsoleApplication {
public static void EstateWindow(){ public static void EstateWindow(){
Debug.Log("Commands : \n0 - Fetch tours of estate\n1 - back\n2 - exit"); Debug.Log("Commands : \n0 - Fetch tours of estate\n1 - back\n2 - exit");
var ch = Debug.ReadKey(); var ch = Debug.ReadLine()[0];
switch (ch){ switch (ch){
case '0' : case '0' :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment