|
@@ -5,10 +5,16 @@ using Avalonia.Interactivity;
|
|
|
using Avalonia.Markup.Xaml;
|
|
|
using MsBox.Avalonia;
|
|
|
using System;
|
|
|
+using System.Windows;
|
|
|
+using System.Text;
|
|
|
using System.IO;
|
|
|
using LoginGenerator.Models;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
+using System.Drawing.Imaging;
|
|
|
+using Avalonia.Input;
|
|
|
+using Avalonia.Media;
|
|
|
+using System.Drawing;
|
|
|
|
|
|
namespace LoginGenerator;
|
|
|
|
|
@@ -23,6 +29,15 @@ public partial class GeneratePage : UserControl
|
|
|
InitializeComponent();
|
|
|
}
|
|
|
|
|
|
+ private SolidColorBrush background = new SolidColorBrush(Avalonia.Media.Color.FromRgb(255,255,255));
|
|
|
+
|
|
|
+ public SolidColorBrush MyProperty
|
|
|
+ {
|
|
|
+ get { return background; }
|
|
|
+ set { background = value; }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private void CopyAll_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
IClipboard Clipboard = TopLevel.GetTopLevel(this)?.Clipboard;
|
|
@@ -49,6 +64,7 @@ public partial class GeneratePage : UserControl
|
|
|
{
|
|
|
var box = MessageBoxManager.GetMessageBoxStandard("Îøèáêà", "Ïîëüçîâàòåëü ñ òàêèì ëîãèíîì óæå ñóùåñòâóåò");
|
|
|
box.ShowAsync();
|
|
|
+ return;
|
|
|
}
|
|
|
DateTime dateTime = DateTime.Now;
|
|
|
File.AppendAllText(FilePath.PATH, $"{FIO.Text} {Login.Text} {Pass.Text} {dateTime.ToShortDateString()}\n");
|
|
@@ -258,7 +274,8 @@ public partial class GeneratePage : UserControl
|
|
|
newUsers.Add(u);
|
|
|
}
|
|
|
}
|
|
|
- if(newUsers.Where(x=>x.Login == Login.Text).First()==null)
|
|
|
+ Users? maybeNew = newUsers.Where(x => x.Login == Login.Text).FirstOrDefault();
|
|
|
+ if (maybeNew == null)
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
@@ -280,4 +297,9 @@ public partial class GeneratePage : UserControl
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void SwitchTheme(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
}
|