diff --git a/Project.Controller/InputSanitizer.cs b/Project.Controller/InputSanitizer.cs
index 17b0aa1..abd71ef 100644
--- a/Project.Controller/InputSanitizer.cs
+++ b/Project.Controller/InputSanitizer.cs
@@ -21,4 +21,23 @@ public partial class InputSanitizer
if (string.IsNullOrEmpty(username) || username.Length < 4) return false;
else return true;
}
+
+ //NewEntry - Name Check
+ public static bool EntryName(string name)
+ {
+ if (string.IsNullOrEmpty(name)) return false;
+ else return true;
+ }
+ //NewEntry - user/mailcheck
+ public static bool Userormail(string usermail)
+ {
+ if (string.IsNullOrEmpty(usermail)) return false;
+ else return true;
+ }
+ //NewEntry - password check
+ public static bool Password(string pass)
+ {
+ if (string.IsNullOrEmpty(pass) || pass.Length < 6) return false;
+ else return true;
+ }
}
\ No newline at end of file
diff --git a/Project.View/EntryErrorPopup/EntryErrorPopup.axaml b/Project.View/EntryErrorPopup/EntryErrorPopup.axaml
new file mode 100644
index 0000000..06ac2a4
--- /dev/null
+++ b/Project.View/EntryErrorPopup/EntryErrorPopup.axaml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Project.View/EntryErrorPopup/EntryErrorPopup.axaml.cs b/Project.View/EntryErrorPopup/EntryErrorPopup.axaml.cs
new file mode 100644
index 0000000..6daa399
--- /dev/null
+++ b/Project.View/EntryErrorPopup/EntryErrorPopup.axaml.cs
@@ -0,0 +1,22 @@
+using System;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Media;
+using Project.Controller;
+using Project.Model;
+using Project.Persistence;
+namespace Project.View;
+
+public partial class EntryErrorPopUp : Window
+
+{
+ public EntryErrorPopUp()
+ {
+ InitializeComponent();
+ }
+
+ private void EntryError_Click(object? sender, RoutedEventArgs e)
+ {
+ Close();
+ }
+}
\ No newline at end of file
diff --git a/Project.View/NewEntry/NewEntry.axaml.cs b/Project.View/NewEntry/NewEntry.axaml.cs
index 3f8a7cb..ee5fc19 100644
--- a/Project.View/NewEntry/NewEntry.axaml.cs
+++ b/Project.View/NewEntry/NewEntry.axaml.cs
@@ -1,3 +1,4 @@
+using System;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Media;
@@ -11,6 +12,7 @@ public partial class NewEntry : Window
public NewEntry()
{
InitializeComponent();
+ this.SizeToContent = SizeToContent.Height;
}
public NewEntry(AppController controller)
@@ -30,21 +32,35 @@ public partial class NewEntry : Window
string? url = URLBox.Text;
string? pass = PassBox.Text;
string? note = NoteBox.Text;
- AppController.NewEntrySave(name, username, url, pass, note);
- var newMenuView = new MenuView();
- newMenuView.AfterSavingNewEntry();
- Close();
+ if (InputSanitizer.EntryName(name) && InputSanitizer.Password(pass) && InputSanitizer.Userormail(username))
+ {
+ AppController.NewEntrySave(name, username, url, pass, note);
+ var newMenuView = new MenuView();
+ newMenuView.AfterSavingNewEntry();
+ Close();
+ }
+ else
+ {
+ var newPopUp = new EntryErrorPopUp();
+ NameBox.Text = string.Empty;
+ UsernameMailBox.Text = string.Empty;
+ URLBox.Text = String.Empty;
+ PassBox.Text = String.Empty;
+ NoteBox.Text = String.Empty;
+ newPopUp.Show();
+ }
+
}
private void NewEntry_ShowPW_Click(object? sender, RoutedEventArgs e)
{
- if (NewentryPW.PasswordChar == '*')
+ if (NewentryPW.PasswordChar == '•')
{
NewentryPW.PasswordChar = '\0';
}
else
{
- NewentryPW.PasswordChar = '*';
+ NewentryPW.PasswordChar = '•';
}
}
diff --git a/Project.View/PopUp/PopUp.axaml b/Project.View/PopUp/PopUp.axaml
index 85972a9..8155f73 100644
--- a/Project.View/PopUp/PopUp.axaml
+++ b/Project.View/PopUp/PopUp.axaml
@@ -45,7 +45,8 @@
-
+
+