new mat proc std
This commit is contained in:
@@ -1,40 +1,31 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="PostOpration.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
// -----------------------------------------------------------------------
|
||||
// file="PostOpration"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Terminal.Gui;
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using System.IO;
|
||||
|
||||
namespace StgSharpTerminalDialogue
|
||||
{
|
||||
@@ -43,14 +34,18 @@ namespace StgSharpTerminalDialogue
|
||||
|
||||
private static DialogueView _dv;
|
||||
|
||||
internal static void PostOperation( string instruction, string operand )
|
||||
internal static void PostOperation(
|
||||
string instruction,
|
||||
string operand
|
||||
)
|
||||
{
|
||||
switch( instruction ) {
|
||||
switch (instruction)
|
||||
{
|
||||
case "posterror":
|
||||
_dv.ShowError( operand );
|
||||
using( StreamWriter sw = new StreamWriter(
|
||||
_callerServerPipe ) ) {
|
||||
sw.WriteLine( "ERRORGET" );
|
||||
_dv.ShowError(operand);
|
||||
using (StreamWriter sw = new StreamWriter(
|
||||
_callerServerPipe)) {
|
||||
sw.WriteLine("ERRORGET");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,37 +1,36 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="Program.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
// -----------------------------------------------------------------------
|
||||
// file="Program"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.IO.Pipes;
|
||||
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Terminal.Gui;
|
||||
|
||||
namespace StgSharpTerminalDialogue
|
||||
@@ -41,57 +40,69 @@ namespace StgSharpTerminalDialogue
|
||||
|
||||
private static AnonymousPipeClientStream _callerClientPipe, _callerServerPipe;
|
||||
|
||||
private static void Main( string[] args )
|
||||
private static void Main(
|
||||
string[] args
|
||||
)
|
||||
{
|
||||
Application.Init();
|
||||
|
||||
Console.CancelKeyPress += ( sender, e ) => {
|
||||
Console.CancelKeyPress += (
|
||||
sender,
|
||||
e
|
||||
) => {
|
||||
e.Cancel = true;
|
||||
Application.RequestStop();
|
||||
};
|
||||
|
||||
Task renderTask = Task.Factory
|
||||
.StartNew(
|
||||
() => {
|
||||
_dv = DialogueView.Single;
|
||||
Application.Run( view: _dv );
|
||||
} );
|
||||
.StartNew((
|
||||
) => {
|
||||
_dv = DialogueView.Single;
|
||||
Application.Run(view:_dv);
|
||||
}, CancellationToken.None, TaskCreationOptions.None,
|
||||
TaskScheduler.Default);
|
||||
|
||||
/**/
|
||||
if( args.Length != 2 ) {
|
||||
if (args.Length != 2)
|
||||
{
|
||||
Console.ReadLine();
|
||||
Application.RequestStop();
|
||||
}
|
||||
/**/
|
||||
|
||||
_callerClientPipe = new AnonymousPipeClientStream(
|
||||
PipeDirection.In, args[ 0 ] );
|
||||
PipeDirection.In, args[0]);
|
||||
_callerServerPipe = new AnonymousPipeClientStream(
|
||||
PipeDirection.Out, args[ 1 ] );
|
||||
PipeDirection.Out, args[1]);
|
||||
|
||||
|
||||
using( StreamReader clientReader = new StreamReader(
|
||||
_callerClientPipe ) ) {
|
||||
using( StreamWriter clientSender = new StreamWriter(
|
||||
_callerServerPipe ) ) {
|
||||
using (StreamReader clientReader = new StreamReader(
|
||||
_callerClientPipe))
|
||||
{
|
||||
using (StreamWriter clientSender = new StreamWriter(
|
||||
_callerServerPipe))
|
||||
{
|
||||
clientSender.AutoFlush = true;
|
||||
string temp = string.Empty;
|
||||
while( !temp!.Contains( "exit " ) && !renderTask.IsCompleted ) {
|
||||
while (!temp!.Contains("exit ") && !renderTask.IsCompleted)
|
||||
{
|
||||
temp = clientReader.ReadLine()!;
|
||||
temp = temp ?? string.Empty;
|
||||
if( string.IsNullOrEmpty( temp ) ) {
|
||||
if (string.IsNullOrEmpty(temp))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int index = temp.IndexOf( ' ' );
|
||||
if( index == -1 ) {
|
||||
int index = temp.IndexOf(' ');
|
||||
if (index == -1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string command = temp.Substring( 0, index );
|
||||
string operand = temp.Substring( index + 1 );
|
||||
string command = temp[..index];
|
||||
string operand = temp[(index + 1)..];
|
||||
|
||||
PostOperation( command, operand );
|
||||
PostOperation(command, operand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<BaseOutputPath>build\StgSharpTerminalDialogue</BaseOutputPath>
|
||||
<OutputPath>$(BaseOutputPath)</OutputPath>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<SatelliteResourceLanguages>none</SatelliteResourceLanguages>
|
||||
<Platforms>x64</Platforms>
|
||||
<Configurations>Debug;Release;PerformanceDebug</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PerformanceDebug|x64'">
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PerformanceDebug|ARM64'">
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Terminal.Gui" Version="2.0.0-v2-develop.2329" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="xcopy /E /I /Y $(OutputPath) $(SolutionDir)build\StgSharp.TerminalDialogue" />
|
||||
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user