Move helpers to Helpers/

This commit is contained in:
2023-03-11 15:19:52 +01:00
parent 9adec37e86
commit aca39be8d4
12 changed files with 18 additions and 10 deletions

View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.IO; using System.IO;
using WGneu.Helpers;
namespace WGneu { namespace WGneu {
public partial class App : Application { public partial class App : Application {

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using WGneu.Helpers;
namespace WGneu.Documents { namespace WGneu.Documents {
public abstract class Document : IDisposable { public abstract class Document : IDisposable {

View File

@ -12,6 +12,7 @@ using PdfSharp.Pdf.IO;
using PuppeteerSharp; using PuppeteerSharp;
using PuppeteerSharp.Media; using PuppeteerSharp.Media;
using RazorLight; using RazorLight;
using WGneu.Helpers;
using WGneu.Windows; using WGneu.Windows;
namespace WGneu.Documents { namespace WGneu.Documents {

View File

@ -9,7 +9,7 @@ using System.Windows.Controls;
using System.IO; using System.IO;
using System.Diagnostics; using System.Diagnostics;
namespace WGneu { namespace WGneu.Helpers {
public static class Utils { public static class Utils {
public static void SetInputChanged(Control input) { public static void SetInputChanged(Control input) {
input.BorderBrush = Brushes.Orange; input.BorderBrush = Brushes.Orange;
@ -68,9 +68,9 @@ namespace WGneu {
private int Usages = 0; private int Usages = 0;
public string FilePath { get; private set; } public string FilePath { get; private set; }
public TemporaryFile() : this(null) {} public TemporaryFile() : this(null) { }
public TemporaryFile(string? ext) : this(Path.Combine(Path.GetTempPath(), "Kelwin"), ext) {} public TemporaryFile(string? ext) : this(Path.Combine(Path.GetTempPath(), "Kelwin"), ext) { }
public TemporaryFile(string dir, string? ext) { public TemporaryFile(string dir, string? ext) {
FilePath = Path.Combine(dir, Path.GetRandomFileName().Replace(".", "") + (ext != null ? $".{ext}" : "")); FilePath = Path.Combine(dir, Path.GetRandomFileName().Replace(".", "") + (ext != null ? $".{ext}" : ""));
@ -95,7 +95,7 @@ namespace WGneu {
} }
private void Create() { private void Create() {
using (File.Create(FilePath)) {}; using (File.Create(FilePath)) { };
} }
private void Delete() { private void Delete() {

View File

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
namespace WGneu { namespace WGneu.Helpers {
static class Validator { static class Validator {
private static readonly Dictionary<string, string[][]> PHONE_NRS = new() { private static readonly Dictionary<string, string[][]> PHONE_NRS = new() {

View File

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WGneu.Models; using WGneu.Models;
namespace WGneu { namespace WGneu.Helpers {
public class WgContext : DbContext { public class WgContext : DbContext {
public DbSet<Country> Countries { get; set; } public DbSet<Country> Countries { get; set; }
public DbSet<Member> Members { get; set; } public DbSet<Member> Members { get; set; }
@ -26,8 +26,7 @@ namespace WGneu {
public DbSet<WineVar> WineVarieties { get; set; } public DbSet<WineVar> WineVarieties { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
{
optionsBuilder.UseSqlite("Data Source=\"C:\\Users\\lorenz\\Desktop\\wgtest.sqlite3\"; foreign keys=true"); optionsBuilder.UseSqlite("Data Source=\"C:\\Users\\lorenz\\Desktop\\wgtest.sqlite3\"; foreign keys=true");
optionsBuilder.UseLazyLoadingProxies(); optionsBuilder.UseLazyLoadingProxies();
} }

View File

@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WGneu.Helpers;
namespace WGneu.Models { namespace WGneu.Models {
[Table("AT_plz"), PrimaryKey("Plz", "Okz"), Index("Id", IsUnique = true)] [Table("AT_plz"), PrimaryKey("Plz", "Okz"), Index("Id", IsUnique = true)]

View File

@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WGneu.Helpers;
namespace WGneu.Models { namespace WGneu.Models {
[Table("postal_dest"), PrimaryKey("CountryCode", "Id")] [Table("postal_dest"), PrimaryKey("CountryCode", "Id")]

View File

@ -12,6 +12,7 @@ using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using WGneu.Helpers;
using WGneu.Models; using WGneu.Models;
namespace WGneu.Windows { namespace WGneu.Windows {

View File

@ -11,6 +11,7 @@ using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using WGneu.Helpers;
namespace WGneu.Windows { namespace WGneu.Windows {
public partial class DocumentViewerWindow : Window { public partial class DocumentViewerWindow : Window {

View File

@ -16,6 +16,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using WGneu.Documents; using WGneu.Documents;
using WGneu.Helpers;
using WGneu.Models; using WGneu.Models;

View File

@ -16,6 +16,7 @@ using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using WGneu.Helpers;
using WGneu.Models; using WGneu.Models;
@ -257,7 +258,7 @@ namespace WGneu.Windows {
} }
private void ContractButton_Click(object sender, RoutedEventArgs e) { private void ContractButton_Click(object sender, RoutedEventArgs e) {
var w = new ContractListWindow((Member) MemberList.SelectedItem); var w = new ContractListWindow((Member)MemberList.SelectedItem);
w.Show(); w.Show();
} }