Converting to file-scoped namespaces

This commit is contained in:
2023-04-02 22:10:42 +02:00
parent 2637741703
commit 4f3a768432
11 changed files with 525 additions and 536 deletions

View File

@@ -1,5 +1,5 @@
namespace Common
{
namespace Common;
class Config
{
public string PasswordStorePath { get; set; }
@@ -11,4 +11,3 @@ namespace Common
this.Recipient = Recipient;
}
}
}

View File

@@ -1,7 +1,7 @@
using Microsoft.VisualBasic.FileIO;
namespace Common
{
namespace Common;
static class ConfigFileManager
{
#region Config flags
@@ -91,4 +91,3 @@ namespace Common
}
}
}
}

View File

@@ -1,9 +1,8 @@
namespace Common
{
namespace Common;
class InvalidConfigurationException : Exception
{
public InvalidConfigurationException() : base() { }
public InvalidConfigurationException(string message) : base(message) { }
public InvalidConfigurationException(string message, Exception inner) : base(message, inner) { }
}
}

View File

@@ -1,7 +1,7 @@
using System.Text;
namespace Common
{
namespace Common;
static class PasswordGenerator
{
private static string RandomStr(int length, bool no_symbols = false)
@@ -36,4 +36,3 @@ namespace Common
return new ProcessBuilder().GetOutput("cmd.exe", $"echo {RandomStr(length, no_symbols)} | gpg --quiet --encrypt --recipient {recipient}");
}
}
}

View File

@@ -1,8 +1,8 @@
using System.Diagnostics;
using System.Text;
namespace Common
{
namespace Common;
public delegate void ProcessSuccess();
public delegate void ProcessFailure(Exception e);
sealed class ProcessBuilder
@@ -58,4 +58,3 @@ namespace Common
return null;
}
}
}

View File

@@ -1,5 +1,5 @@
namespace GUI
{
namespace GUI;
partial class GeneratePassword
{
/// <summary>
@@ -133,4 +133,3 @@
private Button generate;
private Button cancel;
}
}

View File

@@ -1,5 +1,5 @@
namespace GUI
{
namespace GUI;
public delegate void MethodRequest();
public partial class GeneratePassword : Form
{
@@ -53,4 +53,3 @@
Close();
}
}
}

View File

@@ -1,5 +1,5 @@
namespace GUI
{
namespace GUI;
sealed partial class MainForm : Form
{
/// <summary>
@@ -112,4 +112,3 @@
private Button DecryptBtn;
private Button Cancel;
}
}

View File

@@ -1,5 +1,5 @@
namespace GUI
{
namespace GUI;
sealed public partial class MainForm : Form
{
public event DataRequest PathRequest;
@@ -66,4 +66,3 @@ namespace GUI
Close();
}
}
}

View File

@@ -1,7 +1,7 @@
using System.Collections;
namespace GUI
{
namespace GUI;
public delegate string SearchQuery();
public class PasswordListBox : ListBox
{
@@ -70,4 +70,3 @@ namespace GUI
}
}
}
}

View File

@@ -1,5 +1,5 @@
namespace GUI
{
namespace GUI;
public delegate string DataRequest(); //Fire whenever a specific field of ProfileHandler.CurrentProfile is needed
internal static class Program
{
@@ -19,4 +19,3 @@ namespace GUI
() => ConfigFileManager.GetRecipient()
); //needed at creation so that MainForm may pass this method down to other classes in its constructor
}
}