Clean code

Remove unused usings
Remove blank lines
Fix style issues
This commit is contained in:
2019-07-20 16:16:23 +02:00
parent ffb62b7737
commit 94431aebb8
44 changed files with 37 additions and 176 deletions

View File

@@ -2,7 +2,6 @@
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using YamlDotNet.Serialization;

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Configurations
namespace DearFTP.Configurations
{
class ServerConfiguration
{

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization;
namespace DearFTP.Configurations
{

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using YamlDotNet.Serialization;
namespace DearFTP.Configurations

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Configurations
namespace DearFTP.Configurations
{
class User
{

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class AuthCommand : ICommand
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class ClntCommand : ICommand
{

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class CwdCommand : ICommand
{

View File

@@ -1,10 +1,7 @@
using DearFTP.Configurations;
using DearFTP.Utils;
using DearFTP.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class FeaturesCommand : ICommand
{

View File

@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class HelpCommand : ICommand
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
interface ICommand
{

View File

@@ -3,7 +3,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace DearFTP.Connection.Commands
{
@@ -114,7 +113,7 @@ namespace DearFTP.Connection.Commands
{
string currentDirectory = navigablePath.GetDirectoryPath("");
yield return GenerateInfo(new DirectoryInfo(currentDirectory), writeable, "cdir");
yield return GenerateInfo(new DirectoryInfo(currentDirectory), writeable, "cdir");
if (virtualDirectory.Count(x => x == '/') > 1)
{

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class OptionsCommand : ICommand
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class ParentDirectoryCommand : ICommand
{

View File

@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class ProtectionBufferSizeCommand : ICommand
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class ProtectionCommand : ICommand
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class PwdCommand : ICommand
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class QuitCommand : ICommand
{

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class RestartCommand : ICommand
{

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class SiteCommand : ICommand
{

View File

@@ -1,8 +1,4 @@
using DearFTP.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.IO;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class SystemCommand : ICommand
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
namespace DearFTP.Connection.Commands
{
class TypeCommand : ICommand
{

View File

@@ -1,8 +1,6 @@
using DearFTP.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DearFTP.Connection.Commands
{

View File

@@ -1,12 +1,7 @@
using DearFTP.Configurations;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DearFTP.Connection

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
namespace DearFTP.Connection

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.IO;
namespace DearFTP.Connection
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection
namespace DearFTP.Connection
{
public enum ResponseCode : uint
{

View File

@@ -2,13 +2,9 @@
using DearFTP.Connection.Commands;
using DearFTP.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Text;
namespace DearFTP.Connection
{

View File

@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;

View File

@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using DearFTP.Configurations;
using DearFTP.Configurations;
using DearFTP.Connection;
using DearFTP.Connection.Commands;
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
namespace DearFTP
{
@@ -46,7 +43,6 @@ namespace DearFTP
}
TcpLoop();
}
public void Stop()

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using DearFTP.Configurations;
using System;
using System.IO;
using System.Text;
using DearFTP.Configurations;
namespace DearFTP
{
@@ -10,12 +8,12 @@ namespace DearFTP
{
public bool WriteToFile { get; private set; }
public string FilePath { get; private set; }
public string FilePath { get; private set; }
public Logger(Configuration configuration)
{
WriteToFile = configuration.Server.LogFileEnabled;
FilePath = configuration.Server.LogFilePath;
FilePath = configuration.Server.LogFilePath;
}
public void Log(string message)

View File

@@ -2,8 +2,6 @@
using System;
using System.Globalization;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace DearFTP

View File

@@ -3,7 +3,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace DearFTP.Utils
{

View File

@@ -33,7 +33,6 @@ using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
namespace DearFTP.Utils

View File

@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq;
using System.Security.Cryptography;
using System.Text;