Adds IInterface

This commit is contained in:
Cyberboss
2017-11-06 12:50:02 -05:00
parent 68aff86f05
commit f0c93a368d
10 changed files with 112 additions and 63 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ namespace TGCommandLine
abstract class ConsoleCommand : Command
{
/// <summary>
/// The <see cref="TGServiceInterface.Interface"/> currently in use by the <see cref="Program"/>
/// The <see cref="IInterface"/> currently in use by the <see cref="Program"/>
/// </summary>
public static Interface Interface;
public static IInterface Interface;
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ namespace TGCommandLine
{
abstract class InstanceRootCommand : RootCommand
{
public static Interface currentInterface;
public static IInterface currentInterface;
public override ExitCode DoRun(IList<string> parameters)
{
if (currentInterface.InstanceName == null)
+3 -3
View File
@@ -10,7 +10,7 @@ namespace TGCommandLine
class Program
{
static bool interactive = false, saidSrvVersion = false;
static Interface currentInterface;
static IInterface currentInterface;
static Command.ExitCode RunCommandLine(IList<string> argsAsList)
{
//first lookup the connection string
@@ -100,7 +100,7 @@ namespace TGCommandLine
};
}
static void ReplaceInterface(Interface I)
static void ReplaceInterface(IInterface I)
{
currentInterface = I;
ConsoleCommand.Interface = I;
@@ -157,7 +157,7 @@ namespace TGCommandLine
/// </summary>
/// <param name="instanceName">The name of the <see cref="ITGInstance"/> to test</param>
/// <param name="silentSuccess">If <see langword="true"/>, does not output on success</param>
/// <returns><see langword="true"/> if a <see cref="ConnectivityLevel.Authenticated"/> was achieved with <see cref="Interface.ConnectToInstance(string, bool)"/>, <see langword="false"/> otherwise</returns>
/// <returns><see langword="true"/> if a <see cref="ConnectivityLevel.Authenticated"/> was achieved with <see cref="IInterface.ConnectToInstance(string, bool)"/>, <see langword="false"/> otherwise</returns>
static bool CheckInstanceConnectivity(string instanceName, bool silentSuccess)
{
var res = currentInterface.ConnectToInstance(instanceName);
+1 -1
View File
@@ -7,7 +7,7 @@ namespace TGCommandLine
{
class CLICommand : RootCommand
{
public CLICommand(Interface I)
public CLICommand(IInterface I)
{
var tmp = new List<Command> { new UpdateCommand(), new TestmergeCommand(), new RepoCommand(), new BYONDCommand(), new DMCommand(), new DDCommand(), new ConfigCommand(), new IRCCommand(), new DiscordCommand(), new AutoUpdateCommand(), new SetAutoUpdateCommand() };
if (I.ConnectToInstance().HasFlag(ConnectivityLevel.Administrator))