diff options
| author | TheEdgeNK <trey6979@gmail.com> | 2018-09-01 00:36:43 -0400 |
|---|---|---|
| committer | TheEdgeNK <trey6979@gmail.com> | 2018-09-01 00:36:43 -0400 |
| commit | fb69cc80fc9e22549915f2a0905323f145e23374 (patch) | |
| tree | fe96528ac85d03485fef7fbe72131e80878d4694 | |
| parent | e9e4ec9c4ede2ac2a2c954e0a8b8fef946322c4e (diff) | |
| download | Project-Silicon-fb69cc80fc9e22549915f2a0905323f145e23374.tar.gz Project-Silicon-fb69cc80fc9e22549915f2a0905323f145e23374.tar.bz2 Project-Silicon-fb69cc80fc9e22549915f2a0905323f145e23374.zip | |
New terminal in the form of a console application
| -rw-r--r-- | PortEngine/PortEngine.csproj | 1 | ||||
| -rw-r--r-- | PortEngine/PortsTerminalAPI.cs | 70 | ||||
| -rw-r--r-- | PortEngine/TerminalAPI.cs | 1 | ||||
| -rw-r--r-- | PortsTerminal/App.config | 6 | ||||
| -rw-r--r-- | PortsTerminal/PortsTerminal.csproj | 62 | ||||
| -rw-r--r-- | PortsTerminal/Program.cs | 26 | ||||
| -rw-r--r-- | PortsTerminal/Properties/AssemblyInfo.cs | 36 | ||||
| -rw-r--r-- | Project Ports.sln | 6 |
8 files changed, 208 insertions, 0 deletions
diff --git a/PortEngine/PortEngine.csproj b/PortEngine/PortEngine.csproj index 544ab0e..1485897 100644 --- a/PortEngine/PortEngine.csproj +++ b/PortEngine/PortEngine.csproj @@ -50,6 +50,7 @@ <DependentUpon>EarnSite.cs</DependentUpon> </Compile> <Compile Include="GeneralAPI.cs" /> + <Compile Include="PortsTerminalAPI.cs" /> <Compile Include="QuantumAPI\Sites\Malwarebits.cs"> <SubType>UserControl</SubType> </Compile> diff --git a/PortEngine/PortsTerminalAPI.cs b/PortEngine/PortsTerminalAPI.cs new file mode 100644 index 0000000..c751b85 --- /dev/null +++ b/PortEngine/PortsTerminalAPI.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace PortEngine +{ + public class PortsTerminalAPI + { + public static void InitializeConsole() + { + AppendConsolePrefix(); + } + + public static void AppendConsolePrefix() + { + string ConsolePrefix = (Properties.Settings.Default.userDisplayName + "@PortOS:~$ "); + + Console.Write(ConsolePrefix); + } + + public static void RunCommand(String pendingCommand) + { + bool LastCommandWasClear = false; + + switch (pendingCommand) + { + case "help": + Console.WriteLine("help - lists the commands\r\ntest - displays a test message\r\nclear - clears the terminal\r\nchangeusername - changes your username for use with the Chatter application\r\n example: changeusername --TheBestUser" + Environment.NewLine); + + break; + case "clear": + Console.Clear(); + LastCommandWasClear = true; + + break; + case "test": + Console.WriteLine("This is a test!\r\nof the EBS!" + Environment.NewLine); + + break; + + default: + if (pendingCommand.StartsWith("changeusername --")) + { + Console.WriteLine("Username changed from " + Properties.Settings.Default.userDisplayName + " to " + pendingCommand.Substring(17)); + Properties.Settings.Default.userDisplayName = pendingCommand.Substring(17); + break; + } + else + { + Console.WriteLine("Syntax error. Reference the command list for commands that exist." + Environment.NewLine); + } + break; + } + + if (LastCommandWasClear == true) + { + LastCommandWasClear = false; + AppendConsolePrefix(); + } + else + { + Console.WriteLine(); + AppendConsolePrefix(); + } + } + } +} diff --git a/PortEngine/TerminalAPI.cs b/PortEngine/TerminalAPI.cs index 7724c48..d7ec2ba 100644 --- a/PortEngine/TerminalAPI.cs +++ b/PortEngine/TerminalAPI.cs @@ -1,6 +1,7 @@ /************************************************************************ * * PortEngine + * Deprecated Component - TerminalAPI * Copyright (C) 2018 UniverseDG * * This program is free software: you can redistribute it and/or modify diff --git a/PortsTerminal/App.config b/PortsTerminal/App.config new file mode 100644 index 0000000..bae5d6d --- /dev/null +++ b/PortsTerminal/App.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/> + </startup> +</configuration> diff --git a/PortsTerminal/PortsTerminal.csproj b/PortsTerminal/PortsTerminal.csproj new file mode 100644 index 0000000..0f9e69f --- /dev/null +++ b/PortsTerminal/PortsTerminal.csproj @@ -0,0 +1,62 @@ +<?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>{51B19B80-B154-4EFE-B838-FEC598F9E6D9}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>PortsTerminal</RootNamespace> + <AssemblyName>PortsTerminal</AssemblyName> + <TargetFrameworkVersion>v4.6.1</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> + <ItemGroup> + <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.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\PortEngine\PortEngine.csproj"> + <Project>{c1b21b60-7ccc-42fc-83aa-b41644faa952}</Project> + <Name>PortEngine</Name> + </ProjectReference> + <ProjectReference Include="..\Project Ports\Project Ports.csproj"> + <Project>{7ff89341-be42-4ae1-b53e-f9fa4104d30f}</Project> + <Name>Project Ports</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/PortsTerminal/Program.cs b/PortsTerminal/Program.cs new file mode 100644 index 0000000..6640c6c --- /dev/null +++ b/PortsTerminal/Program.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PortEngine; + +namespace PortsTerminal +{ + class Program + { + static void Main(string[] args) + { + bool RunConsole = true; + PortsTerminalAPI.InitializeConsole(); + + while(RunConsole == true) + { + PortsTerminalAPI.RunCommand(Console.ReadLine()); + } + + + Console.ReadLine(); + } + } +} diff --git a/PortsTerminal/Properties/AssemblyInfo.cs b/PortsTerminal/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c530a10 --- /dev/null +++ b/PortsTerminal/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PortsTerminal")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PortsTerminal")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("51b19b80-b154-4efe-b838-fec598f9e6d9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Project Ports.sln b/Project Ports.sln index 97db25d..ff72833 100644 --- a/Project Ports.sln +++ b/Project Ports.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project Ports", "Project Po EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortEngine", "PortEngine\PortEngine.csproj", "{C1B21B60-7CCC-42FC-83AA-B41644FAA952}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortsTerminal", "PortsTerminal\PortsTerminal.csproj", "{51B19B80-B154-4EFE-B838-FEC598F9E6D9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Debug|Any CPU.Build.0 = Debug|Any CPU {C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Release|Any CPU.ActiveCfg = Release|Any CPU {C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Release|Any CPU.Build.0 = Release|Any CPU + {51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE |
