Skip to content

Commit

Permalink
Merge pull request #13
Browse files Browse the repository at this point in the history
Indevelopment
  • Loading branch information
HakuSystems authored Oct 6, 2024
2 parents ef48d91 + f7a3060 commit 0c20c20
Show file tree
Hide file tree
Showing 41 changed files with 667 additions and 761 deletions.
2 changes: 0 additions & 2 deletions EasyExtractUnitypackageRework/EasyExtract/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.IO;
using EasyExtract.Utilities;
using Newtonsoft.Json;

namespace EasyExtract.Config;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Collections.ObjectModel;
using System.IO;
using EasyExtract.CustomDesign;
using Wpf.Ui.Appearance;
using EasyExtract.UI.CustomDesign;

namespace EasyExtract.Config;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media;

namespace EasyExtract.Config;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media;
using Wpf.Ui.Controls;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Reflection;

namespace EasyExtract.Config;

public class UpdateModel
Expand Down
12 changes: 6 additions & 6 deletions EasyExtractUnitypackageRework/EasyExtract/Core/App.xaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Application
x:Class="EasyExtract.App"
Startup="App_OnStartup"
StartupUri="/UI/Initial/MainWindow.xaml"
x:Class="EasyExtract.Core.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:customDesign="clr-namespace:EasyExtract.CustomDesign"
xmlns:customDesign="clr-namespace:EasyExtract.UI.CustomDesign"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Startup="App_OnStartup"
StartupUri="/UI/Initial/MainWindow.xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="BackgroundPrimaryBrush" Color="{DynamicResource BackgroundPrimaryBrush}" />
<SolidColorBrush Color="{DynamicResource BackgroundPrimaryBrush}" x:Key="BackgroundPrimaryBrush" />
<customDesign:BackgroundAndOpacityConverter x:Key="BackgroundAndOpacityConverter" />
<FontFamily x:Key="SegoeFluentIcons">pack://application:,,,/;component/Fonts/#Segoe Fluent Icons</FontFamily>
</ResourceDictionary>
Expand Down
16 changes: 6 additions & 10 deletions EasyExtractUnitypackageRework/EasyExtract/Core/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System.Windows;
using System.Windows.Threading;
using EasyExtract.Config;
using EasyExtract.Discord;
using EasyExtract.Services.CustomMessageBox;
using EasyExtract.Config;
using EasyExtract.Services.Discord;
using EasyExtract.Utilities;
using Application = System.Windows.Application;

namespace EasyExtract;
namespace EasyExtract.Core;

/// <summary>
/// Interaction logic for App.xaml
Expand All @@ -17,10 +16,7 @@ public partial class App : Application
private async void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
await _logger.LogAsync(e.Exception.Message, "App.xaml.cs", Importance.Error);
var customMessageBox =
new CustomMessageBox("An unexpected error occurred. Please check the logs for more information.", "Error",
MessageBoxButton.OK);
customMessageBox.ShowDialog();
// we cant show a Dialog here because the current doesnt have any active Window yet
e.Handled = true;
}

Expand Down
17 changes: 5 additions & 12 deletions EasyExtractUnitypackageRework/EasyExtract/Core/Program.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System.Diagnostics;
using System.Reflection;
using System.Security;
using System.Security.Principal;
using System.Windows;
using EasyExtract.Config;
using EasyExtract.Extraction;
using EasyExtract.Services.CustomMessageBox;
using Microsoft.Win32;
using EasyExtract.Utilities;

namespace EasyExtract;
namespace EasyExtract.Core;

public class Program
{
Expand Down Expand Up @@ -146,7 +142,7 @@ private bool IsRunningAsAdmin()
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
}

private void RunAsAdmin(string[] args)
private async void RunAsAdmin(string[] args)
{
var processInfo = new ProcessStartInfo
{
Expand All @@ -163,11 +159,8 @@ private void RunAsAdmin(string[] args)
}
catch (Exception e)
{
var customMessageBox =
new CustomMessageBox(
"An error occurred while trying to run as administrator. Please check the logs for more information.",
"Error", MessageBoxButton.OK);
customMessageBox.ShowDialog();
await _logger.LogAsync($"An error occurred while running as admin: {e.Message}", "Program.cs", Importance.Error);
// we cant show a Dialog here because the current doesnt have any active Window yet
throw;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System.Globalization;
using System.IO;
using System.IO.Compression;
using EasyExtract.Config;
using SharpCompress.Archives;
using SharpCompress.Common;
using EasyExtract.Utilities;

namespace EasyExtract.Extraction;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.IO;
using EasyExtract.Config;
using EasyExtract.Utilities;

namespace EasyExtract.Extraction;

Expand Down
23 changes: 23 additions & 0 deletions EasyExtractUnitypackageRework/EasyExtract/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Global using directives

global using System.ComponentModel;
global using System.Diagnostics;
global using System.Drawing;
global using System.Drawing.Imaging;
global using System.Drawing.Text;
global using System.IO;
global using System.Net.Http;
global using System.Reflection;
global using System.Runtime.CompilerServices;
global using System.Runtime.InteropServices;
global using System.Windows;
global using System.Windows.Controls;
global using System.Windows.Media.Imaging;
global using System.Windows.Threading;
global using Microsoft.Win32;
global using Octokit;
global using Serilog.Events;
global using SharpCompress.Archives;
global using SharpCompress.Common;
global using Wpf.Ui.Appearance;
global using FileMode = System.IO.FileMode;

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0c20c20

Please sign in to comment.