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 class Config
{ {
public string PasswordStorePath { get; set; } public string PasswordStorePath { get; set; }
@@ -11,4 +11,3 @@ namespace Common
this.Recipient = Recipient; this.Recipient = Recipient;
} }
} }
}

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
using System.Text; using System.Text;
namespace Common namespace Common;
{
static class PasswordGenerator static class PasswordGenerator
{ {
private static string RandomStr(int length, bool no_symbols = false) 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}"); 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.Diagnostics;
using System.Text; using System.Text;
namespace Common namespace Common;
{
public delegate void ProcessSuccess(); public delegate void ProcessSuccess();
public delegate void ProcessFailure(Exception e); public delegate void ProcessFailure(Exception e);
sealed class ProcessBuilder sealed class ProcessBuilder
@@ -58,4 +58,3 @@ namespace Common
return null; return null;
} }
} }
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
using System.Collections; using System.Collections;
namespace GUI namespace GUI;
{
public delegate string SearchQuery(); public delegate string SearchQuery();
public class PasswordListBox : ListBox 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 public delegate string DataRequest(); //Fire whenever a specific field of ProfileHandler.CurrentProfile is needed
internal static class Program internal static class Program
{ {
@@ -19,4 +19,3 @@ namespace GUI
() => ConfigFileManager.GetRecipient() () => ConfigFileManager.GetRecipient()
); //needed at creation so that MainForm may pass this method down to other classes in its constructor ); //needed at creation so that MainForm may pass this method down to other classes in its constructor
} }
}