Compare commits
79 commits
Author | SHA1 | Date | |
---|---|---|---|
e199c426f5 | |||
77ef325085 | |||
c1be81924b | |||
dd3f5782a3 | |||
83c85f932e | |||
9585ab95aa | |||
d698312381 | |||
d9981c025d | |||
3e2ed4b627 | |||
e69218c791 | |||
cd9d8fe20a | |||
a0ae016646 | |||
77250ee7c1 | |||
6846729432 | |||
97f3d31eab | |||
7d937fd89f | |||
025347faf6 | |||
12fbc227a5 | |||
16b21bf005 | |||
e57fef6b57 | |||
5c6b5dff76 | |||
4d937f14eb | |||
c85baa5172 | |||
d05f8db247 | |||
1faad86a8e | |||
09a7ee6dea | |||
![]() |
a0e607d1e3 | ||
f98cdf9b63 | |||
a118f4fe8b | |||
9e8b3b89f8 | |||
6e60333fdf | |||
b832aafa7c | |||
111c511ac9 | |||
55c753dead | |||
5cb3c52ba7 | |||
0d26606d5b | |||
cbe7bfc2be | |||
bff0928b7c | |||
f65057350d | |||
9f96ae1493 | |||
218f9e1490 | |||
7fc12b2c98 | |||
e2525e253a | |||
9c4f2c6138 | |||
48ef43f31e | |||
56174d8003 | |||
7570f7d442 | |||
d5f6e160da | |||
30099b56d2 | |||
55b0ff1c45 | |||
f6e3687ec2 | |||
e3a34fa966 | |||
![]() |
336dbef991 | ||
17931a3103 | |||
2225790af2 | |||
![]() |
ddc56e7a41 | ||
776a9d86c0 | |||
6fdbc9e74f | |||
79933338c9 | |||
89d3bd8409 | |||
2f4ac2f00d | |||
826e6823a1 | |||
e1351cc756 | |||
f623fd79f2 | |||
892cd40895 | |||
79dcc39826 | |||
884e12f980 | |||
3ef67556dd | |||
68d59943a7 | |||
aa96f282f6 | |||
8df1154cc4 | |||
6ce57b90ca | |||
![]() |
01e388ff37 | ||
2b24d81d1a | |||
287dffbb5d | |||
b95fb58925 | |||
45e43d49e6 | |||
a91c4af09f | |||
717ed8a6bf |
79 changed files with 2535 additions and 369 deletions
140
.forgejo/workflows/dotnet.yaml
Normal file
140
.forgejo/workflows/dotnet.yaml
Normal file
|
@ -0,0 +1,140 @@
|
|||
name: Dotnet Build
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: win11
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
|
||||
- name: MSBuild version
|
||||
run: |
|
||||
msbuild -version
|
||||
|
||||
- name: Extract project version
|
||||
run: |
|
||||
$version = Select-String -Path "WeeXnes/WeeXnes.csproj" -Pattern "<Version>(.+?)</Version>" | ForEach-Object {
|
||||
($_ -match "<Version>(.+?)</Version>") | Out-Null
|
||||
$matches[1]
|
||||
}
|
||||
Write-Output "Version extracted: $version"
|
||||
"PROJECT_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding ASCII -Append
|
||||
|
||||
|
||||
|
||||
- name: Test exported version variable
|
||||
run: |
|
||||
Write-Output "The extracted project version is: $env:PROJECT_VERSION"
|
||||
if (-not $env:PROJECT_VERSION) {
|
||||
Write-Error "PROJECT_VERSION variable is not set!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- name: Restore Packages
|
||||
run: nuget restore WeeXnes.sln
|
||||
|
||||
- name: Build Solution
|
||||
run: |
|
||||
msbuild WeeXnes.sln /p:DeleteExistingFiles=True /p:platform="Any CPU" /p:configuration="Release"
|
||||
|
||||
|
||||
- name: Packing Zip
|
||||
run: |
|
||||
$zipName = "currentRelease_$env:PROJECT_VERSION.zip"
|
||||
Compress-Archive -Path `
|
||||
WeeXnes\bin\Release\WeeXnes.exe, `
|
||||
WeeXnes\bin\Release\System.Drawing.Common.dll, `
|
||||
WeeXnes\bin\Release\Wpf.Ui.dll, `
|
||||
WeeXnes_UAC\bin\Release\WeeXnes_UAC.exe, `
|
||||
WeeXnes\bin\Release\DiscordRPC.dll, `
|
||||
WeeXnes\bin\Release\Newtonsoft.Json.dll, `
|
||||
Autostart\bin\Release\Autostart.exe, `
|
||||
WXPlugin\bin\Release\WXPlugin.dll, `
|
||||
Update\bin\Release\Update.exe `
|
||||
-CompressionLevel Optimal `
|
||||
-DestinationPath $zipName
|
||||
Write-Output "Created zip: $zipName"
|
||||
|
||||
- name: Prepare release directory
|
||||
run: |
|
||||
mkdir release
|
||||
move currentRelease_$env:PROJECT_VERSION.zip release\
|
||||
|
||||
|
||||
- name: Create Git tag
|
||||
run: |
|
||||
git config user.name "WeeXnes"
|
||||
git config user.email "weexnes@weexnes.dev"
|
||||
git tag $env:PROJECT_VERSION
|
||||
git push origin $env:PROJECT_VERSION
|
||||
|
||||
- name: Upload Release Asset to Forgejo
|
||||
env:
|
||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
PROJECT_VERSION: ${{ env.PROJECT_VERSION }}
|
||||
run: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$owner = "WeeXnes"
|
||||
$repo = "WeeXnesSuite"
|
||||
$tag = "$env:PROJECT_VERSION"
|
||||
$token = $env:RELEASE_TOKEN
|
||||
$fileName = "currentRelease_$tag.zip"
|
||||
$filePath = "release/$fileName"
|
||||
|
||||
$releaseUrl = "https://git.weexnes.dev/api/v1/repos/$owner/$repo/releases/tags/$tag"
|
||||
try {
|
||||
$release = Invoke-RestMethod -Uri $releaseUrl -Headers @{ Authorization = "token $token" }
|
||||
Write-Host "Found existing release for tag $tag"
|
||||
} catch {
|
||||
Write-Host "Release for tag $tag not found, creating..."
|
||||
$createReleaseUrl = "https://git.weexnes.dev/api/v1/repos/$owner/$repo/releases"
|
||||
$body = @{
|
||||
tag_name = $tag
|
||||
name = $tag
|
||||
draft = $false
|
||||
prerelease = $false
|
||||
} | ConvertTo-Json -Depth 3
|
||||
$release = Invoke-RestMethod -Uri $createReleaseUrl -Headers @{ Authorization = "token $token"; "Content-Type" = "application/json" } -Method Post -Body $body
|
||||
}
|
||||
|
||||
$releaseId = $release.id
|
||||
Write-Host "Release ID: $releaseId"
|
||||
|
||||
$uploadUrl = "https://git.weexnes.dev/api/v1/repos/$owner/$repo/releases/$releaseId/assets?name=$fileName"
|
||||
Write-Host "Uploading asset to $uploadUrl"
|
||||
|
||||
Add-Type -AssemblyName "System.Net.Http"
|
||||
|
||||
$fileBytes = [System.IO.File]::ReadAllBytes($filePath)
|
||||
|
||||
# Use static method to correctly instantiate ByteArrayContent
|
||||
$byteContent = [System.Net.Http.ByteArrayContent]::new($fileBytes)
|
||||
$byteContent.Headers.ContentType = [System.Net.Http.Headers.MediaTypeHeaderValue]::new("application/zip")
|
||||
|
||||
$form = [System.Net.Http.MultipartFormDataContent]::new()
|
||||
$form.Add($byteContent, "attachment", $fileName)
|
||||
|
||||
$client = [System.Net.Http.HttpClient]::new()
|
||||
$client.DefaultRequestHeaders.Authorization = [System.Net.Http.Headers.AuthenticationHeaderValue]::new("token", $token)
|
||||
|
||||
$response = $client.PostAsync($uploadUrl, $form).Result
|
||||
$responseContent = $response.Content.ReadAsStringAsync().Result
|
||||
|
||||
if ($response.IsSuccessStatusCode) {
|
||||
Write-Host "✅ Upload succeeded"
|
||||
} else {
|
||||
Write-Host "❌ Upload failed with status $($response.StatusCode)"
|
||||
Write-Host "Response: $responseContent"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
|
96
.github/workflows/dotnet-framework.yml
vendored
96
.github/workflows/dotnet-framework.yml
vendored
|
@ -1,96 +0,0 @@
|
|||
name: .NET Framework
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
- name: Setup NuGet
|
||||
uses: NuGet/setup-nuget@v1.1.1
|
||||
|
||||
- name: Navigate to Workspace
|
||||
run: cd $GITHUB_WORKSPACE
|
||||
|
||||
- name: Restore Packages
|
||||
run: nuget restore WeeXnes.sln
|
||||
|
||||
- name: Build Solution
|
||||
run: |
|
||||
msbuild.exe WeeXnes.sln /p:DeleteExistingFiles=True /p:platform="Any CPU" /p:configuration="Release"
|
||||
|
||||
- name: List Folder 1
|
||||
run: dir D:\a\WeeXnesSuite\WeeXnesSuite\WeeXnes\bin\Release\
|
||||
- name: List Folder 2
|
||||
run: dir D:\a\WeeXnesSuite\WeeXnesSuite\WeeXnes_UAC\bin\Release\
|
||||
- name: List Folder 3
|
||||
run: dir D:\a\WeeXnesSuite\WeeXnesSuite\Autostart\bin\Release\
|
||||
- name: List Folder 4
|
||||
run: dir D:\a\WeeXnesSuite\WeeXnesSuite\Update\bin\Release\
|
||||
- name: List Folder 5
|
||||
run: dir D:\a\WeeXnesSuite\WeeXnesSuite\Release_Tool\bin\Release\
|
||||
|
||||
|
||||
- name: Format Xaml to XML
|
||||
run: (gc Weexnes\WeeXnes.csproj) -replace ' ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"', '' | Out-File -encoding ASCII formatted.csproj
|
||||
shell: pwsh
|
||||
|
||||
- uses: bbonkr/get-version-action@v1.0.4
|
||||
id: get_version
|
||||
with:
|
||||
project: "formatted.csproj"
|
||||
- name: logging
|
||||
run: |
|
||||
echo "Version=${{ steps.get_version.outputs.version }}"
|
||||
|
||||
- name: Packing Zip
|
||||
run: Compress-Archive
|
||||
D:\a\WeeXnesSuite\WeeXnesSuite\WeeXnes\bin\Release\WeeXnes.exe,
|
||||
D:\a\WeeXnesSuite\WeeXnesSuite\WeeXnes\bin\Release\System.Drawing.Common.dll,
|
||||
D:\a\WeeXnesSuite\WeeXnesSuite\WeeXnes\bin\Release\Wpf.Ui.dll,
|
||||
D:\a\WeeXnesSuite\WeeXnesSuite\WeeXnes_UAC\bin\Release\WeeXnes_UAC.exe,
|
||||
D:\a\WeeXnesSuite\WeeXnesSuite\WeeXnes\bin\Release\DiscordRPC.dll,
|
||||
D:\a\WeeXnesSuite\WeeXnesSuite\WeeXnes\bin\Release\Newtonsoft.Json.dll,
|
||||
D:\a\WeeXnesSuite\WeeXnesSuite\Autostart\bin\Release\Autostart.exe,
|
||||
Update\bin\Release\Update.exe
|
||||
-CompressionLevel Optimal -DestinationPath packed.zip
|
||||
shell: pwsh
|
||||
|
||||
|
||||
- name: Check for Zip
|
||||
run: dir
|
||||
|
||||
|
||||
|
||||
- name: release
|
||||
uses: actions/create-release@v1
|
||||
id: create_release
|
||||
with:
|
||||
draft: false
|
||||
prerelease: false
|
||||
release_name: v${{ steps.get_version.outputs.version }}
|
||||
tag_name: ${{ steps.get_version.outputs.version }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
- name: upload windows artifact
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: D:\a\WeeXnesSuite\WeeXnesSuite\packed.zip
|
||||
asset_name: currentRelease_${{ steps.get_version.outputs.version }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<ApplicationIcon>wicns.ico</ApplicationIcon>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
|
33
ExamplePlugin/ExamplePlugin.cs
Normal file
33
ExamplePlugin/ExamplePlugin.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Windows.Controls;
|
||||
using Wpf.Ui.Common;
|
||||
using Wpf.Ui.Controls;
|
||||
using WXPlugin.PluginCore;
|
||||
|
||||
namespace ExamplePlugin
|
||||
{
|
||||
public class ExamplePlugin : IPluginBase
|
||||
{
|
||||
public String Name { get; set; } = "Example Plugin";
|
||||
public String Description { get; set; } = "This is an example plugin.";
|
||||
|
||||
public Page UiPage { get; set; } = new ExampleUi();
|
||||
public NavigationItem NavIcon { get; set; } = new NavigationItem
|
||||
{
|
||||
Content = "Plugin",
|
||||
Icon = SymbolRegular.Syringe20,
|
||||
PageTag = "examplePlugin",
|
||||
PageType = typeof(ExampleUi),
|
||||
};
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
//throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
77
ExamplePlugin/ExamplePlugin.csproj
Normal file
77
ExamplePlugin/ExamplePlugin.csproj
Normal file
|
@ -0,0 +1,77 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
|
||||
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{910F0FC8-B73D-449F-ADD7-C6CA147D9F05}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ExamplePlugin</RootNamespace>
|
||||
<AssemblyName>ExamplePlugin</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System"/>
|
||||
<Reference Include="System.Core"/>
|
||||
<Reference Include="System.Data"/>
|
||||
<Reference Include="System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Drawing.Common.6.0.0\lib\net461\System.Drawing.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml"/>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="Wpf.Ui, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\WPF-UI.2.0.3\lib\net48\Wpf.Ui.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ExamplePlugin.cs" />
|
||||
<Compile Include="ExampleUi.xaml.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WXPlugin\WXPlugin.csproj">
|
||||
<Project>{56bfe4e0-0d30-474a-b57b-cf08515ff66e}</Project>
|
||||
<Name>WXPlugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="ExampleUi.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
17
ExamplePlugin/ExampleUi.xaml
Normal file
17
ExamplePlugin/ExampleUi.xaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<Page x:Class="ExampleUi"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ExamplePlugin"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="AddRPCView" Height="Auto" Width="Auto"
|
||||
Loaded="ExampleUi_OnLoaded">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="White">This is a Test Ui for the Example Plugin</TextBlock>
|
||||
<TextBlock Name="TestLabel" Foreground="White" Text="{Binding LabelContent}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
18
ExamplePlugin/ExampleUi.xaml.cs
Normal file
18
ExamplePlugin/ExampleUi.xaml.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
public partial class ExampleUi : Page
|
||||
{
|
||||
private int counter = 0;
|
||||
public ExampleUi()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ExampleUi_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
counter++;
|
||||
TestLabel.Text = counter.ToString();
|
||||
}
|
||||
}
|
35
ExamplePlugin/Properties/AssemblyInfo.cs
Normal file
35
ExamplePlugin/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ExamplePlugin")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ExamplePlugin")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("910F0FC8-B73D-449F-ADD7-C6CA147D9F05")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
5
ExamplePlugin/packages.config
Normal file
5
ExamplePlugin/packages.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="System.Drawing.Common" version="6.0.0" targetFramework="net48" />
|
||||
<package id="WPF-UI" version="2.0.3" targetFramework="net48" />
|
||||
</packages>
|
BIN
Images/home.png
Normal file
BIN
Images/home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
BIN
Images/password_gen.png
Normal file
BIN
Images/password_gen.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
BIN
Images/password_manager.png
Normal file
BIN
Images/password_manager.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
BIN
Images/rpc.png
Normal file
BIN
Images/rpc.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 62 KiB |
BIN
Images/settings.png
Normal file
BIN
Images/settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
50
README.md
50
README.md
|
@ -1,11 +1,9 @@
|
|||
<div align="center">
|
||||
<img width="100" height="100" src="https://cdn.discordapp.com/attachments/741123537582162020/965619554426437732/wicon.png">
|
||||
<img width="100" height="100" src="https://raw.githubusercontent.com/WeeXnes/WeeXnesSuite/master/WeeXnes/Images/wicon.png">
|
||||
<br>
|
||||
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/WeeXnes/WeeXnesSuite?color=%23702e94">
|
||||
|
||||
</div>
|
||||
<h1 align="center">WeeXnes Suite</h1>
|
||||
<div align="center">
|
||||
|
||||
Built with:
|
||||
|
||||
|
@ -16,14 +14,48 @@ Built with:
|
|||
Uses:
|
||||
<a href="https://github.com/lepoco/wpfui">C# WPF-UI Library</a>
|
||||
|
||||
</div>
|
||||
|
||||
<h2></h2>
|
||||
|
||||
|
||||
|
||||
<h3 align="center">Encrypted Key Manager and Custom Discord Rich Presence that you can configure for every Process you want</h3>
|
||||
<h2>Overview:</h2>
|
||||
<image src="https://cdn.discordapp.com/attachments/741123537582162020/1045710949014843402/preview1.png" height="400">
|
||||
<image src="https://cdn.discordapp.com/attachments/741123537582162020/1045710949442658314/preview2.png" height="400">
|
||||
<h3>Discord Rich Presence</h3>
|
||||
Configurable DiscordRPC for every process you want. It detects if a process is started and starts the Rich Presence you configured for the Process
|
||||
<image src="https://cdn.discordapp.com/attachments/741123537582162020/1045710949811761293/preview3.png" height="320">
|
||||
<image src="https://raw.githubusercontent.com/WeeXnes/WeeXnesSuite/master/Images/home.png" height="400">
|
||||
<h2></h2>
|
||||
|
||||
|
||||
<h3>Discord Rich Presence</h3>
|
||||
Configurable DiscordRPC for every process you want. It detects if a process is started and starts the Rich Presence you configured for the Process (also has import/export functionality)
|
||||
<br>
|
||||
<image src="https://raw.githubusercontent.com/WeeXnes/WeeXnesSuite/master/Images/rpc.png" height="400">
|
||||
<h2></h2>
|
||||
|
||||
|
||||
|
||||
<h3>Key Manager</h3>
|
||||
encrypted key manager with import/export functionality
|
||||
<br>
|
||||
<image src="https://raw.githubusercontent.com/WeeXnes/WeeXnesSuite/master/Images/password_manager.png" height="400">
|
||||
<h2></h2>
|
||||
|
||||
|
||||
<h3>Password Generator</h3>
|
||||
Password Generator. Generated passwords can be quickly saved to the Key Manager
|
||||
<br>
|
||||
<image src="https://raw.githubusercontent.com/WeeXnes/WeeXnesSuite/master/Images/password_gen.png" height="400">
|
||||
<h2></h2>
|
||||
|
||||
|
||||
<h3>Settings</h3>
|
||||
Settings Showcase
|
||||
<br>
|
||||
<image src="https://raw.githubusercontent.com/WeeXnes/WeeXnesSuite/master/Images/settings.png" height="600">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Supported by: <a href="https://www.jetbrains.com">JetBrains</a></h2>
|
||||
<image src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" width="200"><br>
|
||||
Special thanks to JetBrains supporting this Project with their <a href="https://jb.gg/OpenSourceSupport">Open Source License Program</a>
|
||||
</div>
|
||||
|
|
|
@ -1,134 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Release_Tool
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static List<file> files = new List<file>();
|
||||
public static string globalTimestamp = null;
|
||||
public static string releaseFolder = "debug_release";
|
||||
public static string releaseFileName = "currentRelease";
|
||||
public static string fileending = ".zip";
|
||||
public static string destFolder = null;
|
||||
public static bool success = true;
|
||||
public static bool Contains(string source, string toCheck, StringComparison comp)
|
||||
{
|
||||
return source?.IndexOf(toCheck, comp) >= 0;
|
||||
}
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var lines = File.ReadAllLines(".\\WeeXnes\\Core\\Globals.cs");
|
||||
string versionLine = "";
|
||||
foreach (var line in lines)
|
||||
{
|
||||
if (Contains(line, "public static string version", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
versionLine = line;
|
||||
}
|
||||
}
|
||||
Console.WriteLine(versionLine);
|
||||
string versionnr =
|
||||
versionLine.Substring(versionLine.IndexOf("\""), versionLine.Length - versionLine.IndexOf("\""));
|
||||
versionnr = versionnr.Substring(1, versionnr.Length - 1);
|
||||
versionnr = versionnr.Substring(0, versionnr.IndexOf("\""));
|
||||
string VersionNumber = versionnr;
|
||||
releaseFileName = releaseFileName + "_" + versionnr + fileending;
|
||||
Console.WriteLine("Packing " + releaseFileName);
|
||||
Console.Title = "WeeXnes Automated Release Tool";
|
||||
SetTimestamp();
|
||||
SetPaths();
|
||||
Console.WriteLine("Folder -> " + globalTimestamp);
|
||||
CheckDirectories();
|
||||
GetFiles();
|
||||
PackFiles();
|
||||
if (!success)
|
||||
{
|
||||
Console.WriteLine("Something went wrong");
|
||||
Console.ReadLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
PackIntoZip();
|
||||
Console.WriteLine("Build succeeded | " + globalTimestamp);
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
private static void PackIntoZip()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(File.Exists(Path.Combine(releaseFolder, releaseFileName)))
|
||||
{
|
||||
File.Delete(Path.Combine(releaseFolder, "currentRelease.zip"));
|
||||
ZipFile.CreateFromDirectory(destFolder, Path.Combine(releaseFolder, releaseFileName));
|
||||
}
|
||||
else
|
||||
{
|
||||
ZipFile.CreateFromDirectory(destFolder, Path.Combine(releaseFolder, releaseFileName));
|
||||
}
|
||||
|
||||
}catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetPaths()
|
||||
{
|
||||
destFolder = Path.Combine(releaseFolder, globalTimestamp);
|
||||
}
|
||||
|
||||
private static void CheckDirectories()
|
||||
{
|
||||
if (!Directory.Exists(releaseFolder))
|
||||
{
|
||||
Directory.CreateDirectory(releaseFolder);
|
||||
}
|
||||
if(!Directory.Exists(destFolder))
|
||||
{
|
||||
Directory.CreateDirectory(destFolder);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetTimestamp()
|
||||
{
|
||||
string date = DateTime.Now.ToString("dd.MM.yyyy");
|
||||
string time = DateTime.Now.ToString("HH.mm.ss");
|
||||
string timestamp = date + " - " + time;
|
||||
globalTimestamp = timestamp;
|
||||
}
|
||||
|
||||
private static void PackFiles()
|
||||
{
|
||||
foreach(file fileobj in files)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Copy(fileobj.path, Path.Combine(destFolder, fileobj.newfilename));
|
||||
Console.WriteLine("Copied " + fileobj.path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Coudnt find " + fileobj.path + "| ->" + ex.GetType());
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetFiles()
|
||||
{
|
||||
files.Add(new file(@"WeeXnes\bin\Release\WeeXnes.exe", "WeeXnes.exe"));
|
||||
files.Add(new file(@"WeeXnes_UAC\bin\Release\WeeXnes_UAC.exe", "WeeXnes_UAC.exe"));
|
||||
files.Add(new file(@"WeeXnes\bin\Release\DiscordRPC.dll", "DiscordRPC.dll"));
|
||||
files.Add(new file(@"WeeXnes\bin\Release\Newtonsoft.Json.dll", "Newtonsoft.Json.dll"));
|
||||
files.Add(new file(@"Autostart\bin\Release\Autostart.exe", "Autostart.exe"));
|
||||
files.Add(new file(@"Update\bin\Release\Update.exe", "Update.exe"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
namespace Release_Tool
|
||||
{
|
||||
public class file
|
||||
{
|
||||
public string path { get; set; }
|
||||
public string newfilename { get; set; }
|
||||
public file(string _path, string _newfilename)
|
||||
{
|
||||
this.path = _path;
|
||||
this.newfilename = _newfilename;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 308 KiB |
|
@ -14,6 +14,7 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<ApplicationIcon>wicns.ico</ApplicationIcon>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
|
16
WXPlugin/PluginCore/IPluginBase.cs
Normal file
16
WXPlugin/PluginCore/IPluginBase.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Windows.Controls;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace WXPlugin.PluginCore
|
||||
{
|
||||
public interface IPluginBase
|
||||
{
|
||||
public String Name { get; set; }
|
||||
public String Description { get; set; }
|
||||
public Page UiPage { get; set; }
|
||||
public NavigationItem NavIcon { get; set; }
|
||||
public void Initialize();
|
||||
public void Execute();
|
||||
}
|
||||
}
|
|
@ -4,12 +4,12 @@ using System.Runtime.InteropServices;
|
|||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Release_Tool")]
|
||||
[assembly: AssemblyTitle("WXPlugin")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Release_Tool")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyProduct("WXPlugin")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
@ -19,7 +19,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("4C09AD12-B48E-40ED-B418-CF868889E317")]
|
||||
[assembly: Guid("56BFE4E0-0D30-474A-B57B-CF08515FF66E")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
|
@ -1,18 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
|
||||
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{4C09AD12-B48E-40ED-B418-CF868889E317}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<ProjectGuid>{56BFE4E0-0D30-474A-B57B-CF08515FF66E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Release_Tool</RootNamespace>
|
||||
<AssemblyName>Release_Tool</AssemblyName>
|
||||
<RootNamespace>WXPlugin</RootNamespace>
|
||||
<AssemblyName>WXPlugin</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<ApplicationIcon>wicns.ico</ApplicationIcon>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
@ -34,21 +34,28 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System"/>
|
||||
<Reference Include="System.Core"/>
|
||||
<Reference Include="System.Data"/>
|
||||
<Reference Include="System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Drawing.Common.6.0.0\lib\net461\System.Drawing.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml"/>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="Wpf.Ui, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\WPF-UI.2.0.3\lib\net48\Wpf.Ui.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="file.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PluginCore\IPluginBase.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="wicns.ico" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
5
WXPlugin/packages.config
Normal file
5
WXPlugin/packages.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="System.Drawing.Common" version="6.0.0" targetFramework="net48" />
|
||||
<package id="WPF-UI" version="2.0.3" targetFramework="net48" />
|
||||
</packages>
|
18
WeeXnes.sln
18
WeeXnes.sln
|
@ -6,10 +6,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autostart", "Autostart\Auto
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeeXnes_UAC", "WeeXnes_UAC\WeeXnes_UAC.csproj", "{2DCC0DCD-7843-4719-9FDD-1786924CF941}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Release_Tool", "Release_Tool\Release_Tool.csproj", "{4C09AD12-B48E-40ED-B418-CF868889E317}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Update", "Update\Update.csproj", "{133FF515-D605-4856-BA2E-5841BF47EC2F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WXPlugin", "WXPlugin\WXPlugin.csproj", "{56BFE4E0-0D30-474A-B57B-CF08515FF66E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExamplePlugin", "ExamplePlugin\ExamplePlugin.csproj", "{910F0FC8-B73D-449F-ADD7-C6CA147D9F05}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -28,13 +30,17 @@ Global
|
|||
{2DCC0DCD-7843-4719-9FDD-1786924CF941}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2DCC0DCD-7843-4719-9FDD-1786924CF941}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2DCC0DCD-7843-4719-9FDD-1786924CF941}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4C09AD12-B48E-40ED-B418-CF868889E317}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4C09AD12-B48E-40ED-B418-CF868889E317}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4C09AD12-B48E-40ED-B418-CF868889E317}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4C09AD12-B48E-40ED-B418-CF868889E317}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{133FF515-D605-4856-BA2E-5841BF47EC2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{133FF515-D605-4856-BA2E-5841BF47EC2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{133FF515-D605-4856-BA2E-5841BF47EC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{133FF515-D605-4856-BA2E-5841BF47EC2F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{56BFE4E0-0D30-474A-B57B-CF08515FF66E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{56BFE4E0-0D30-474A-B57B-CF08515FF66E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{56BFE4E0-0D30-474A-B57B-CF08515FF66E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{56BFE4E0-0D30-474A-B57B-CF08515FF66E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{910F0FC8-B73D-449F-ADD7-C6CA147D9F05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{910F0FC8-B73D-449F-ADD7-C6CA147D9F05}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{910F0FC8-B73D-449F-ADD7-C6CA147D9F05}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{910F0FC8-B73D-449F-ADD7-C6CA147D9F05}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -2,6 +2,9 @@
|
|||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Media;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Nocksoft.IO.ConfigFiles;
|
||||
using WeeXnes.Core;
|
||||
|
@ -17,16 +20,52 @@ namespace WeeXnes
|
|||
/// </summary>
|
||||
public partial class App
|
||||
{
|
||||
public static bool DebugMode = false;
|
||||
private void SetExceptionHandler()
|
||||
{
|
||||
AppDomain currentDomain = default(AppDomain);
|
||||
currentDomain = AppDomain.CurrentDomain;
|
||||
currentDomain.UnhandledException += GlobalUnhandledExceptionHandler;
|
||||
}
|
||||
private static void GlobalUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
Exception ex = (Exception)e.ExceptionObject;
|
||||
DateTime currentDateTime = DateTime.Now;
|
||||
string formattedDateTime = currentDateTime.ToString("dddd, dd MMMM yyyy HH:mm:ss");
|
||||
using (StreamWriter writer = new StreamWriter("error_log.txt"))
|
||||
{
|
||||
writer.WriteLine(formattedDateTime);
|
||||
writer.WriteLine(ex.ToString());
|
||||
}
|
||||
new FluentMessageBox(ex.Message).ShowDialog();
|
||||
}
|
||||
private void App_OnStartup(object sender, StartupEventArgs e)
|
||||
{
|
||||
Environment.CurrentDirectory = Application.StartupPath;
|
||||
Console.Data.Colors.colored_output = false;
|
||||
Console.Data.Formatting.timestamp_prefix = true;
|
||||
SetExceptionHandler();
|
||||
CheckForDebugMode();
|
||||
CheckStartupArgs(e.Args);
|
||||
CheckUpdatedFiles();
|
||||
CheckForFolder();
|
||||
LoadSettings();
|
||||
SaveSettingsHandler.SetupSaveEvents();
|
||||
LoadFiles();
|
||||
CheckStartupArgs(e.Args);
|
||||
LoadPluginManager();
|
||||
|
||||
}
|
||||
|
||||
private void LoadPluginManager()
|
||||
{
|
||||
if (!Directory.Exists(Global.Defaults.DefaultPathPlugins))
|
||||
Directory.CreateDirectory(Global.Defaults.DefaultPathPlugins);
|
||||
|
||||
Global.pluginManager.LoadPlugins();
|
||||
foreach (var plugin in Global.pluginManager.CurrentPlugins)
|
||||
{
|
||||
plugin.Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckUpdatedFiles()
|
||||
|
@ -44,7 +83,7 @@ namespace WeeXnes
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Console.Error(ex.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,28 +96,65 @@ namespace WeeXnes
|
|||
Convert.ToBoolean(SettingsView.Data.settingsFile.GetValue(
|
||||
SaveSettingsHandler.Data.KeyManager.Section,
|
||||
SaveSettingsHandler.Data.KeyManager.CensorKeys));
|
||||
|
||||
KeyManagerView.Data.copyOnSelect.Value =
|
||||
Convert.ToBoolean(SettingsView.Data.settingsFile.GetValue(
|
||||
SaveSettingsHandler.Data.KeyManager.Section,
|
||||
SaveSettingsHandler.Data.KeyManager.CopyOnSelect));
|
||||
|
||||
KeyManagerView.Data.sortList.Value =
|
||||
Convert.ToBoolean(SettingsView.Data.settingsFile.GetValue(
|
||||
SaveSettingsHandler.Data.KeyManager.Section,
|
||||
SaveSettingsHandler.Data.KeyManager.SortList));
|
||||
|
||||
//Load paths
|
||||
|
||||
string customRpcPath = SettingsView.Data.settingsFile.GetValue(
|
||||
SaveSettingsHandler.Data.General.Section,
|
||||
SaveSettingsHandler.Data.General.RpcFilesPath
|
||||
);
|
||||
if (!String.IsNullOrEmpty(customRpcPath))
|
||||
{
|
||||
Global.AppDataPathRPC.Value = customRpcPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.AppDataPathRPC.Value = Global.Defaults.DefaultPathRPC;
|
||||
}
|
||||
string customKeyPath = SettingsView.Data.settingsFile.GetValue(
|
||||
SaveSettingsHandler.Data.General.Section,
|
||||
SaveSettingsHandler.Data.General.KeyFilesPath
|
||||
);
|
||||
if (!String.IsNullOrEmpty(customKeyPath))
|
||||
{
|
||||
Global.AppDataPathKEY.Value = customKeyPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.AppDataPathKEY.Value = Global.Defaults.DefaultPathKEY;
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadFiles()
|
||||
{
|
||||
Functions.CheckFolderAndCreate(Global.AppDataPathRPC);
|
||||
DirectoryInfo rpcDirectoryInfo = new DirectoryInfo(Global.AppDataPathRPC);
|
||||
Functions.CheckFolderAndCreate(Global.AppDataPathRPC.Value);
|
||||
DirectoryInfo rpcDirectoryInfo = new DirectoryInfo(Global.AppDataPathRPC.Value);
|
||||
foreach (var file in rpcDirectoryInfo.GetFiles("*.rpc"))
|
||||
{
|
||||
try
|
||||
{
|
||||
Game newGame = Game.Methods.GameFromIni(new INIFile(file.FullName));
|
||||
DiscordRPCView.Data.Games.Add(newGame);
|
||||
Console.WriteLine(file.Name + " loaded");
|
||||
Console.WriteLine(file.Name + " loaded -> " + newGame.ProcessName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(file.Name + ": " + ex.Message);
|
||||
Console.Error(file.Name + ": " + ex.Message);
|
||||
new FluentMessageBox(file.Name + ": " + ex.Message).ShowDialog();
|
||||
}
|
||||
}
|
||||
Functions.CheckFolderAndCreate(Global.AppDataPathKEY);
|
||||
DirectoryInfo keyDirectoryInfo = new DirectoryInfo(Global.AppDataPathKEY);
|
||||
Functions.CheckFolderAndCreate(Global.AppDataPathKEY.Value);
|
||||
DirectoryInfo keyDirectoryInfo = new DirectoryInfo(Global.AppDataPathKEY.Value);
|
||||
foreach (var file in keyDirectoryInfo.GetFiles("*.wx"))
|
||||
{
|
||||
try
|
||||
|
@ -95,12 +171,13 @@ namespace WeeXnes
|
|||
);
|
||||
newItem.Filename = file.Name;
|
||||
KeyManagerView.Data.KeyItemsList.Add(newItem);
|
||||
Console.WriteLine(file.Name + " loaded");
|
||||
Console.WriteLine(file.Name + " loaded -> " + newItem.Name);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(file.Name + ": " + ex.Message);
|
||||
Console.Error(file.Name + ": " + ex.Message);
|
||||
new FluentMessageBox(file.Name + ": " + ex.Message).ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,10 +191,10 @@ namespace WeeXnes
|
|||
{
|
||||
switch (argument)
|
||||
{
|
||||
case "-autostart":
|
||||
case HandleLaunchArguments.ArgumentStrings.autostart:
|
||||
HandleLaunchArguments.arg_autostart();
|
||||
break;
|
||||
case "-debugMode":
|
||||
case HandleLaunchArguments.ArgumentStrings.debugMode:
|
||||
HandleLaunchArguments.arg_debugMode();
|
||||
break;
|
||||
}
|
||||
|
@ -126,9 +203,9 @@ namespace WeeXnes
|
|||
|
||||
private void CheckForDebugMode()
|
||||
{
|
||||
#if DEBUG
|
||||
HandleLaunchArguments.arg_enableConsole();
|
||||
#endif
|
||||
#if DEBUG
|
||||
HandleLaunchArguments.arg_debugMode();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
147
WeeXnes/Core/Console.cs
Normal file
147
WeeXnes/Core/Console.cs
Normal file
|
@ -0,0 +1,147 @@
|
|||
global using Console = WeeXnes.Core.Console;
|
||||
global using VanillaConsole = System.Console;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
|
||||
|
||||
namespace WeeXnes.Core
|
||||
{
|
||||
|
||||
|
||||
public static class Console
|
||||
{
|
||||
public static class Data
|
||||
{
|
||||
public static class Colors
|
||||
{
|
||||
public static bool colored_output = true;
|
||||
public static ConsoleColor int_color = ConsoleColor.Blue;
|
||||
public static ConsoleColor double_color = ConsoleColor.Cyan;
|
||||
public static ConsoleColor float_color = ConsoleColor.DarkCyan;
|
||||
}
|
||||
|
||||
public static class Formatting
|
||||
{
|
||||
public static bool timestamp_prefix = false;
|
||||
public static string success_char = "✓";
|
||||
public static string warning_char = "⌬";
|
||||
public static string info_char = "◈";
|
||||
public static string error_char = "☓";
|
||||
public static string writeline_char = "•";
|
||||
}
|
||||
}
|
||||
private static void ConfiguredWriteline(
|
||||
string text,
|
||||
ConsoleColor color,
|
||||
ConsoleColor foregroundColor = ConsoleColor.White)
|
||||
{
|
||||
if(!App.DebugMode)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
VanillaConsole.OutputEncoding = Encoding.UTF8;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
ConsoleColor prevColor = VanillaConsole.BackgroundColor;
|
||||
ConsoleColor prevForeColor = VanillaConsole.ForegroundColor;
|
||||
if (Data.Colors.colored_output)
|
||||
{
|
||||
VanillaConsole.BackgroundColor = color;
|
||||
VanillaConsole.ForegroundColor = foregroundColor;
|
||||
}
|
||||
DateTime currentTime = DateTime.Now;
|
||||
if (Data.Formatting.timestamp_prefix)
|
||||
text = currentTime.ToString("[HH:mm:ss]") + text;
|
||||
VanillaConsole.WriteLine(text + " ");
|
||||
if (Data.Colors.colored_output)
|
||||
{
|
||||
|
||||
VanillaConsole.BackgroundColor = prevColor;
|
||||
VanillaConsole.ForegroundColor = prevForeColor;
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteLine(string text,
|
||||
[CallerLineNumber] int lineNumber = 0,
|
||||
[CallerMemberName] string caller = null)
|
||||
{
|
||||
ConfiguredWriteline(" " + Data.Formatting.writeline_char + " (" + lineNumber + "|" + caller + ") " + text,VanillaConsole.BackgroundColor, ConsoleColor.White);
|
||||
}
|
||||
public static void WriteLine(float text,
|
||||
[CallerLineNumber] int lineNumber = 0,
|
||||
[CallerMemberName] string caller = null)
|
||||
{
|
||||
ConfiguredWriteline(" " + Data.Formatting.writeline_char + " (" + lineNumber + "|" + caller + ") " + text,Data.Colors.float_color, ConsoleColor.White);
|
||||
}
|
||||
public static void WriteLine(double text,
|
||||
[CallerLineNumber] int lineNumber = 0,
|
||||
[CallerMemberName] string caller = null)
|
||||
{
|
||||
ConfiguredWriteline(" " + Data.Formatting.writeline_char + " (" + lineNumber + "|" + caller + ") " + text,Data.Colors.double_color, ConsoleColor.White);
|
||||
}
|
||||
public static void WriteLine(int text,
|
||||
[CallerLineNumber] int lineNumber = 0,
|
||||
[CallerMemberName] string caller = null)
|
||||
{
|
||||
ConfiguredWriteline(" " + Data.Formatting.writeline_char + " (" + lineNumber + "|" + caller + ") " + text,Data.Colors.int_color, ConsoleColor.White);
|
||||
}
|
||||
public static void Success(string text,
|
||||
[CallerLineNumber] int lineNumber = 0,
|
||||
[CallerMemberName] string caller = null)
|
||||
{
|
||||
ConfiguredWriteline(" " + Data.Formatting.success_char + " (" + lineNumber + "|" + caller + ") " + text, ConsoleColor.Green,
|
||||
ConsoleColor.Black);
|
||||
}
|
||||
|
||||
public static void Info(string text,
|
||||
[CallerLineNumber] int lineNumber = 0,
|
||||
[CallerMemberName] string caller = null)
|
||||
{
|
||||
ConfiguredWriteline(" " + Data.Formatting.info_char + " (" + lineNumber + "|" + caller + ") " + text, ConsoleColor.Blue,
|
||||
ConsoleColor.Black);
|
||||
}
|
||||
|
||||
public static void Error(string text,
|
||||
[CallerLineNumber] int lineNumber = 0,
|
||||
[CallerMemberName] string caller = null)
|
||||
{
|
||||
ConfiguredWriteline(" " + Data.Formatting.error_char + " (" + lineNumber + "|" + caller + ") " + text, ConsoleColor.DarkRed,
|
||||
ConsoleColor.Black);
|
||||
}
|
||||
|
||||
public static void Warning(string text,
|
||||
[CallerLineNumber] int lineNumber = 0,
|
||||
[CallerMemberName] string caller = null)
|
||||
{
|
||||
ConfiguredWriteline(" " + Data.Formatting.warning_char + " (" + lineNumber + "|" + caller + ") " + text, ConsoleColor.DarkYellow,
|
||||
ConsoleColor.Black);
|
||||
}
|
||||
|
||||
public static void WriteLine<T>(List<T> List, bool verbose = true)
|
||||
{
|
||||
ConfiguredWriteline("List contains " + typeof(T) + "(" + List.Count + ")", ConsoleColor.DarkMagenta,
|
||||
ConsoleColor.Black);
|
||||
if (!verbose)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < List.Count; i++)
|
||||
{
|
||||
if (i % 2 == 0)
|
||||
{
|
||||
ConfiguredWriteline("(" + i + "): " + List[i], ConsoleColor.DarkGray);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConfiguredWriteline("(" + i + "): " + List[i], ConsoleColor.Black);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,5 +39,12 @@ namespace WeeXnes.Core
|
|||
}
|
||||
File.WriteAllLines(filepath, stringArray, Encoding.UTF8);
|
||||
}
|
||||
|
||||
public static void ThrowTestException(Exception ex = null)
|
||||
{
|
||||
if (ex == null)
|
||||
ex = new NotImplementedException();
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,21 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace WeeXnes.Core
|
||||
{
|
||||
public class Information
|
||||
{
|
||||
public const string Version = "4.0.9";
|
||||
public const string Version = "4.7";
|
||||
public const string EncryptionHash = "8zf5#RdyQ]$4x4_";
|
||||
public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest";
|
||||
}
|
||||
|
||||
public class Global
|
||||
{
|
||||
public static PluginManager pluginManager = new PluginManager(Path.Combine(Environment.CurrentDirectory, "plugins"));
|
||||
public static string AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "WeeXnes");
|
||||
public static string AppDataPathRPC = Path.Combine(AppDataPath, "RPC");
|
||||
public static string AppDataPathKEY = Path.Combine(AppDataPath, "Keys");
|
||||
public static UpdateVar<string> AppDataPathRPC = new UpdateVar<string>();
|
||||
public static UpdateVar<string> AppDataPathKEY = new UpdateVar<string>();
|
||||
public static UpdateVar<bool> checkUpdateOnStartup = new UpdateVar<bool>();
|
||||
public static string SettingsFile = "settings.ini";
|
||||
public class Defaults
|
||||
{
|
||||
public static string DefaultPathRPC = Path.Combine(AppDataPath, "RPC");
|
||||
public static string DefaultPathKEY = Path.Combine(AppDataPath, "Keys");
|
||||
public static string DefaultPathPlugins = Path.Combine(Environment.CurrentDirectory, "plugins");
|
||||
}
|
||||
public static void ForceClose()
|
||||
{
|
||||
System.Windows.Forms.Application.Restart();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +1,18 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace WeeXnes.Core
|
||||
{
|
||||
public class HandleLaunchArguments
|
||||
{
|
||||
public static class ArgumentStrings
|
||||
{
|
||||
public const string autostart = "-autostart";
|
||||
public const string debugMode = "-debugMode";
|
||||
}
|
||||
public static class Data
|
||||
{
|
||||
public static bool Autostart = false;
|
||||
|
@ -19,7 +26,11 @@ namespace WeeXnes.Core
|
|||
}
|
||||
public static void arg_debugMode()
|
||||
{
|
||||
|
||||
App.DebugMode = true;
|
||||
HandleLaunchArguments.arg_enableConsole();
|
||||
//Allow untrusted certs in Debug mode
|
||||
ServicePointManager.ServerCertificateValidationCallback +=
|
||||
(sender, cert, chain, sslPolicyErrors) => true;
|
||||
}
|
||||
public static void arg_enableConsole()
|
||||
{
|
||||
|
|
144
WeeXnes/Core/LoginLib.cs
Normal file
144
WeeXnes/Core/LoginLib.cs
Normal file
|
@ -0,0 +1,144 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Net.Http;
|
||||
using Newtonsoft.Json;
|
||||
using WeeXnes.Views.ProfileView;
|
||||
using WeeXnes.Views.Settings;
|
||||
using Wpf.Ui.Appearance;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace WeeXnes.Core
|
||||
{
|
||||
|
||||
public class Auth
|
||||
{
|
||||
public BackgroundWorker _loginWorker { get; set; }
|
||||
public UpdateVar<dynamic> _currentUserCache { get; private set; } = new UpdateVar<dynamic>();
|
||||
private string _token { get; set; }
|
||||
private string _userDataUrl { get; set; }
|
||||
private string _loginUrl { get; set; }
|
||||
public string _email { get; set; }
|
||||
public string _password { private get; set; }
|
||||
public UpdateVar<Exception> ExceptionCache { get; private set; } = new UpdateVar<Exception>();
|
||||
|
||||
public Auth(string loginUrl, string userDataUrl)
|
||||
{
|
||||
this._currentUserCache.Value = null;
|
||||
this._loginWorker = new BackgroundWorker();
|
||||
this._loginWorker.WorkerReportsProgress = true;
|
||||
this._loginWorker.WorkerSupportsCancellation = true;
|
||||
this._loginWorker.DoWork += (sender, args) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Login(this._email, this._password);
|
||||
GetUserData();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error(ex.ToString());
|
||||
this.ExceptionCache.Value = ex;
|
||||
}
|
||||
};
|
||||
this._loginWorker.RunWorkerCompleted += LoginWorkerOnRunWorkerCompleted;
|
||||
this._loginUrl = loginUrl;
|
||||
this._userDataUrl = userDataUrl;
|
||||
}
|
||||
|
||||
private void LoginWorkerOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("LoginWorker complete");
|
||||
}
|
||||
|
||||
public string Login(string email, string password)
|
||||
{
|
||||
if (String.IsNullOrEmpty(email))
|
||||
throw new NullReferenceException();
|
||||
if (String.IsNullOrEmpty(password))
|
||||
throw new NullReferenceException();
|
||||
|
||||
using (HttpClient client = new HttpClient())
|
||||
{
|
||||
var postData = new Dictionary<string, string>
|
||||
{
|
||||
{ "email", email },
|
||||
{ "password", password }
|
||||
};
|
||||
|
||||
var content = new FormUrlEncodedContent(postData);
|
||||
|
||||
HttpResponseMessage response = client.PostAsync(_loginUrl, content).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string responseData = response.Content.ReadAsStringAsync().Result;
|
||||
dynamic jsonData = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData);
|
||||
string token = jsonData.token;
|
||||
_token = token;
|
||||
return token;
|
||||
//Console.WriteLine($"Token: {token}");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Error("Error: " + response.StatusCode);
|
||||
LoginView.errorStringCache.Value = response.StatusCode.ToString();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public dynamic GetUserData(string token = null)
|
||||
{
|
||||
if(String.IsNullOrEmpty(token))
|
||||
if (String.IsNullOrEmpty(_token))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
token = _token;
|
||||
}
|
||||
// Create an instance of HttpClient
|
||||
using (HttpClient client = new HttpClient())
|
||||
{
|
||||
// Add the token to the request headers
|
||||
client.DefaultRequestHeaders.Add("token", token);
|
||||
|
||||
// Send the GET request
|
||||
HttpResponseMessage response = client.GetAsync(_userDataUrl).Result;
|
||||
|
||||
// Check if the request was successful (status code 200)
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
// Read the response content as a string
|
||||
string responseData = response.Content.ReadAsStringAsync().Result;
|
||||
//Console.WriteLine(responseData);
|
||||
// Parse the JSON data into a dynamic object
|
||||
dynamic user = JsonConvert.DeserializeObject(responseData);
|
||||
user = user.user;
|
||||
|
||||
// Now you can access the user object properties dynamically
|
||||
Console.WriteLine("authenticated user: " + user.name);
|
||||
//Console.WriteLine($"Email: {user.email}");
|
||||
// Access other properties as needed
|
||||
_currentUserCache.Value = user;
|
||||
LoginView.alreadyLoggedIn = true;
|
||||
return user;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Handle the error, e.g., print the status code
|
||||
_currentUserCache.Value = null;
|
||||
|
||||
Console.Error("Error: " + response.StatusCode);
|
||||
|
||||
LoginView.errorStringCache.Value = response.StatusCode.ToString();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
51
WeeXnes/Core/PluginManager.cs
Normal file
51
WeeXnes/Core/PluginManager.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using WXPlugin.PluginCore;
|
||||
|
||||
namespace WeeXnes.Core;
|
||||
|
||||
public class PluginManager
|
||||
{
|
||||
private HashSet<String> Directories = new HashSet<String>();
|
||||
public HashSet<IPluginBase> CurrentPlugins { get; set; } = new HashSet<IPluginBase>();
|
||||
public PluginManager(String pluginPath)
|
||||
{
|
||||
|
||||
Console.WriteLine("Plugin Manager Initialized");
|
||||
Directories.Add(pluginPath);
|
||||
}
|
||||
|
||||
public void LoadPlugins()
|
||||
{
|
||||
|
||||
Console.WriteLine("Plugin Manager Loading Plugins");
|
||||
CurrentPlugins = new HashSet<IPluginBase>();
|
||||
foreach (var dir in Directories)
|
||||
{
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(dir);
|
||||
foreach (var file in dirInfo.GetFiles("*.dll"))
|
||||
{
|
||||
Assembly asm = Assembly.LoadFrom(file.FullName);
|
||||
foreach (Type type in asm.GetTypes())
|
||||
{
|
||||
if (type.IsSubclassOf(typeof(IPluginBase)) || type.GetInterfaces().Contains(typeof(IPluginBase)) && type.IsAbstract == false)
|
||||
{
|
||||
IPluginBase newPlugin = type.InvokeMember(
|
||||
null,
|
||||
BindingFlags.CreateInstance,
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
as IPluginBase;
|
||||
Console.WriteLine("Loaded: " + newPlugin.Name);
|
||||
Console.WriteLine(newPlugin.UiPage.Content.ToString());
|
||||
CurrentPlugins.Add(newPlugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
WeeXnes/Core/RpcLogEvents.cs
Normal file
50
WeeXnes/Core/RpcLogEvents.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
namespace WeeXnes.Core
|
||||
{
|
||||
public enum EventType
|
||||
{
|
||||
ProcessStartedEvent,
|
||||
ProcessStoppedEvent,
|
||||
RPCUpdateEvent,
|
||||
RPCReadyEvent
|
||||
}
|
||||
public class customEvent
|
||||
{
|
||||
|
||||
public string Content { get; set; }
|
||||
public EventType Type { get; set; }
|
||||
|
||||
public string GradientColor1 { get; set; }
|
||||
public string GradientColor2 { get; set; }
|
||||
public customEvent(string content, EventType type)
|
||||
{
|
||||
this.Content = content;
|
||||
this.Type = type;
|
||||
if (this.Type == EventType.ProcessStartedEvent)
|
||||
{
|
||||
this.GradientColor1 = "#46db69";
|
||||
this.GradientColor2 = "#33a34d";
|
||||
}
|
||||
else if (this.Type == EventType.ProcessStoppedEvent)
|
||||
{
|
||||
this.GradientColor1 = "#d1415d";
|
||||
this.GradientColor2 = "#a33349";
|
||||
}
|
||||
else if (this.Type == EventType.RPCUpdateEvent)
|
||||
{
|
||||
this.GradientColor1 = "#3e65c9";
|
||||
this.GradientColor2 = "#3352a3";
|
||||
}
|
||||
else if (this.Type == EventType.RPCReadyEvent)
|
||||
{
|
||||
this.GradientColor1 = "#c93eb4";
|
||||
this.GradientColor2 = "#a33389";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Content;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,8 @@
|
|||
using System.Collections.Specialized;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Net.Mime;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using WeeXnes.Views.KeyManager;
|
||||
using WeeXnes.Views.Settings;
|
||||
|
||||
|
@ -12,11 +16,16 @@ namespace WeeXnes.Core
|
|||
public static class General
|
||||
{
|
||||
public const string Section = "GENERAL";
|
||||
public const string RpcFilesPath = "RpcFilesPath";
|
||||
public const string KeyFilesPath = "KeyFilesPath";
|
||||
public const string StartupUpdateCheck = "StartupUpdateCheck";
|
||||
}
|
||||
public static class KeyManager
|
||||
{
|
||||
public const string Section = "KEY_MANAGER";
|
||||
public const string CensorKeys = "CensorKeys";
|
||||
public const string CopyOnSelect = "CopyOnSelect";
|
||||
public const string SortList = "SortList";
|
||||
}
|
||||
public static class DiscordRpcFiles
|
||||
{
|
||||
|
@ -42,6 +51,51 @@ namespace WeeXnes.Core
|
|||
KeyManagerView.Data.censorKeys.Value.ToString()
|
||||
);
|
||||
};
|
||||
|
||||
KeyManagerView.Data.copyOnSelect.ValueChanged += () =>
|
||||
{
|
||||
SettingsView.Data.settingsFile.SetValue(
|
||||
Data.KeyManager.Section,
|
||||
Data.KeyManager.CopyOnSelect,
|
||||
KeyManagerView.Data.copyOnSelect.Value.ToString()
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
KeyManagerView.Data.sortList.ValueChanged += () =>
|
||||
{
|
||||
SettingsView.Data.settingsFile.SetValue(
|
||||
Data.KeyManager.Section,
|
||||
Data.KeyManager.SortList,
|
||||
KeyManagerView.Data.sortList.Value.ToString()
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Global.AppDataPathRPC.ValueChanged += () =>
|
||||
{
|
||||
SettingsView.Data.settingsFile.SetValue(
|
||||
Data.General.Section,
|
||||
Data.General.RpcFilesPath,
|
||||
Global.AppDataPathRPC.Value
|
||||
);
|
||||
};
|
||||
Global.AppDataPathKEY.ValueChanged += () =>
|
||||
{
|
||||
SettingsView.Data.settingsFile.SetValue(
|
||||
Data.General.Section,
|
||||
Data.General.KeyFilesPath,
|
||||
Global.AppDataPathKEY.Value
|
||||
);
|
||||
};
|
||||
Global.checkUpdateOnStartup.ValueChanged += () =>
|
||||
{
|
||||
SettingsView.Data.settingsFile.SetValue(
|
||||
Data.General.Section,
|
||||
Data.General.StartupUpdateCheck,
|
||||
Global.checkUpdateOnStartup.Value.ToString()
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ namespace WeeXnes.Core
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
Console.WriteLine(e.ToString());
|
||||
returnval = null;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace WeeXnes.Core
|
|||
returnval = rawcontent[2];
|
||||
}catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
Console.WriteLine(e.ToString());
|
||||
returnval = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,14 +8,18 @@
|
|||
xmlns:keymanager="clr-namespace:WeeXnes.Views.KeyManager"
|
||||
xmlns:settings="clr-namespace:WeeXnes.Views.Settings"
|
||||
xmlns:discordrpc="clr-namespace:WeeXnes.Views.DiscordRPC"
|
||||
xmlns:passwordGenerator="clr-namespace:WeeXnes.Views.PasswordGenerator"
|
||||
xmlns:profile="clr-namespace:WeeXnes.Views.ProfileView"
|
||||
xmlns:EncryptedTextEditor="clr-namespace:WeeXnes.Views.EncryptedTextEditor"
|
||||
mc:Ignorable="d"
|
||||
Height="400"
|
||||
Height="540"
|
||||
Width="500"
|
||||
Title="WeeXnes"
|
||||
Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
WindowBackdropType="Mica"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Loaded="MainWindow_OnLoaded">
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
|
@ -45,6 +49,9 @@
|
|||
<MenuItem
|
||||
Header="Stop RPC"
|
||||
Click="ContextStopRpc_OnClick"/>
|
||||
<MenuItem
|
||||
Header="Exit"
|
||||
Click="ContextExit_OnClick"/>
|
||||
</ContextMenu>
|
||||
</ui:NotifyIcon.Menu>
|
||||
</ui:NotifyIcon>
|
||||
|
@ -58,6 +65,7 @@
|
|||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:NavigationStore
|
||||
Name="NavBar"
|
||||
Grid.Column="0"
|
||||
Frame="{Binding ElementName=MainFrame}"
|
||||
SelectedPageIndex="0">
|
||||
|
@ -68,11 +76,6 @@
|
|||
PageTag="home"
|
||||
Name="ButtonHome"
|
||||
PageType="{x:Type home:HomeView}"/>
|
||||
<ui:NavigationItem
|
||||
Content="Keys"
|
||||
Icon="Key24"
|
||||
PageTag="Keys"
|
||||
PageType="{x:Type keymanager:KeyManagerView}"/>
|
||||
<ui:NavigationItem
|
||||
Content="RPC"
|
||||
Icon="XboxController24"
|
||||
|
@ -80,6 +83,30 @@
|
|||
PageTag="RPC"
|
||||
PageType="{x:Type discordrpc:DiscordRPCView}"
|
||||
Loaded="RPCBtn_OnLoaded"/>
|
||||
<ui:NavigationItem
|
||||
Content="Keys"
|
||||
Icon="Key24"
|
||||
PageTag="Keys"
|
||||
PageType="{x:Type keymanager:KeyManagerView}"/>
|
||||
<ui:NavigationItem
|
||||
Content="Gen."
|
||||
Icon="Password24"
|
||||
Name="ButtonPwGen"
|
||||
PageTag="Gen"
|
||||
PageType="{x:Type passwordGenerator:PasswordGenView}"/>
|
||||
<ui:NavigationItem
|
||||
Content="Editor"
|
||||
Icon="DocumentOnePage24"
|
||||
Name="ButtonEncryptedFileEditor"
|
||||
PageTag="Editor"
|
||||
PageType="{x:Type EncryptedTextEditor:TextEditorView}"/>
|
||||
<ui:NavigationItem
|
||||
Content="Profile"
|
||||
Icon="InprivateAccount24"
|
||||
Name="ButtonProfile"
|
||||
PageTag="Profile"
|
||||
PageType="{x:Type profile:LoginView}"
|
||||
Visibility="Collapsed"/>
|
||||
</ui:NavigationStore.Items>
|
||||
<ui:NavigationStore.Footer>
|
||||
<ui:NavigationItem
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using WeeXnes.Core;
|
||||
using ButtonBase = System.Windows.Controls.Primitives.ButtonBase;
|
||||
|
@ -14,6 +15,15 @@ namespace WeeXnes
|
|||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Wpf.Ui.Appearance.Accent.ApplySystemAccent();
|
||||
EnableDebugOptions();
|
||||
}
|
||||
|
||||
private void EnableDebugOptions()
|
||||
{
|
||||
if(!App.DebugMode)
|
||||
return;
|
||||
//Code to be enabled in Debug mode
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,7 +34,8 @@ namespace WeeXnes
|
|||
{
|
||||
ButtonRpc.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
|
||||
MainFrame.Source = new Uri("/Views/DiscordRPC/RunRPCView.xaml",UriKind.Relative);
|
||||
WindowState = WindowState.Minimized;
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
this.ShowInTaskbar = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,8 +52,22 @@ namespace WeeXnes
|
|||
|
||||
private void NotifyIcon_OnLeftClick(NotifyIcon sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
this.ShowInTaskbar = true;
|
||||
this.Show();
|
||||
}
|
||||
private void ContextExit_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var plugin in Global.pluginManager.CurrentPlugins)
|
||||
{
|
||||
NavBar.Items.Add(plugin.NavIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
<StackPanel Orientation="Vertical">
|
||||
<ui:TextBox Name="TextboxProcessname" PlaceholderText="Process name" Margin="0,4"/>
|
||||
<ui:TextBox Name="TextboxClientid" PlaceholderText="Client ID" Margin="0,4"/>
|
||||
<ui:TextBox Name="TextboxState" PlaceholderText="State" Margin="0,4"/>
|
||||
<ui:TextBox Name="TextboxDetails" PlaceholderText="Details" Margin="0,4"/>
|
||||
<ui:TextBox Name="TextboxState" PlaceholderText="State" Margin="0,4"/>
|
||||
<ui:TextBox Name="TextboxBigimgkey" PlaceholderText="Big image key" Margin="0,4"/>
|
||||
<ui:TextBox Name="TextboxBigimgtxt" PlaceholderText="Big image text" Margin="0,4"/>
|
||||
<ui:TextBox Name="TextboxSmallimgkey" PlaceholderText="Small image key" Margin="0,4"/>
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Console.WriteLine(ex.ToString());
|
||||
}
|
||||
CloseDialog();
|
||||
|
||||
|
|
|
@ -24,11 +24,17 @@
|
|||
<ContextMenu>
|
||||
<MenuItem Header="Edit"
|
||||
Name="ButtonContextEdit"
|
||||
Click="ContextEdit_OnClick"/>
|
||||
Click="ContextMenu_Edit"/>
|
||||
<MenuItem Header="Export"
|
||||
Name="ButtonContextExport"
|
||||
Click="ContextMenu_Export"/>
|
||||
<MenuItem Header="Import"
|
||||
Name="ButtonContextImport"
|
||||
Click="ContextMenu_Import"/>
|
||||
<Separator />
|
||||
<MenuItem Header="Remove"
|
||||
Name="ButtonContextRemove"
|
||||
Click="ContextRemove_OnClick"/>
|
||||
Click="ContextMenu_Remove"/>
|
||||
</ContextMenu>
|
||||
</ListBox.ContextMenu>
|
||||
</ListBox>
|
||||
|
|
|
@ -4,6 +4,8 @@ using System.IO;
|
|||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Microsoft.Win32;
|
||||
using Nocksoft.IO.ConfigFiles;
|
||||
using WeeXnes.Core;
|
||||
|
||||
namespace WeeXnes.Views.DiscordRPC
|
||||
|
@ -42,20 +44,72 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
Data.SelectedItem = (Game)listBox.SelectedItem;
|
||||
}
|
||||
|
||||
private void ContextEdit_OnClick(object sender, RoutedEventArgs e)
|
||||
private void ContextMenu_Edit(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(Data.SelectedItem == null)
|
||||
return;
|
||||
NavigationService.Navigate(new Uri("/Views/DiscordRPC/EditRPCView.xaml",UriKind.Relative));
|
||||
}
|
||||
private void ContextMenu_Export(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Game selectedCache = Data.SelectedItem;
|
||||
if(selectedCache == null)
|
||||
return;
|
||||
string filepath = Global.AppDataPathRPC.Value + "\\" + selectedCache.UUID + ".rpc";
|
||||
|
||||
SaveFileDialog dialog = new SaveFileDialog()
|
||||
{
|
||||
FileName = selectedCache.UUID,
|
||||
Filter = "RPC File (*.rpc)|*.rpc",
|
||||
Title = "Export RPC File"
|
||||
};
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
File.Copy(filepath, dialog.FileName, true);
|
||||
Console.WriteLine("Exported to: " + dialog.FileName);
|
||||
}
|
||||
|
||||
}
|
||||
private void ContextMenu_Import(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Game selectedCache = Data.SelectedItem;
|
||||
if(selectedCache == null)
|
||||
return;
|
||||
|
||||
|
||||
OpenFileDialog dialog = new OpenFileDialog()
|
||||
{
|
||||
Filter = "RPC File (*.rpc)|*.rpc",
|
||||
Title = "Import RPC File"
|
||||
};
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
|
||||
Game newGame = Game.Methods.GameFromIni(new INIFile(dialog.FileName));
|
||||
|
||||
if (!File.Exists(Global.AppDataPathRPC.Value + "\\" + newGame.UUID + ".rpc"))
|
||||
{
|
||||
File.Copy(dialog.FileName, Global.AppDataPathRPC.Value + "\\" + newGame.UUID + ".rpc", true);
|
||||
DiscordRPCView.Data.Games.Add(newGame);
|
||||
Console.WriteLine("Imported: " + dialog.FileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Error("not imported: " + dialog.FileName);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ContextRemove_OnClick(object sender, RoutedEventArgs e)
|
||||
private void ContextMenu_Remove(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Game selectedCache = Data.SelectedItem;
|
||||
if(selectedCache == null)
|
||||
return;
|
||||
Data.Games.Remove(selectedCache);
|
||||
File.Delete(Global.AppDataPathRPC + "\\" + selectedCache.UUID + ".rpc");
|
||||
File.Delete(Global.AppDataPathRPC.Value + "\\" + selectedCache.UUID + ".rpc");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ using DiscordRPC.Message;
|
|||
using Nocksoft.IO.ConfigFiles;
|
||||
using WeeXnes.Core;
|
||||
using WeeXnes.Views.Settings;
|
||||
using EventType = WeeXnes.Core.EventType;
|
||||
|
||||
namespace WeeXnes.Views.DiscordRPC
|
||||
{
|
||||
|
@ -88,7 +89,7 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
{
|
||||
this.IsRunning = true;
|
||||
//Console.WriteLine("Process started");
|
||||
RunRPCView.Data.LogCache.Value = this.ProcessName + " is running";
|
||||
RunRPCView.Data.LogCache.Value = new customEvent("[" + this.ProcessName + ".exe] ➜ is running", EventType.ProcessStartedEvent);
|
||||
|
||||
if (!this.PresenceClient.IsInitialized)
|
||||
{
|
||||
|
@ -114,7 +115,7 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
{
|
||||
this.IsRunning = false;
|
||||
//Console.WriteLine("Process stopped");
|
||||
RunRPCView.Data.LogCache.Value = this.ProcessName + " stopped running";
|
||||
RunRPCView.Data.LogCache.Value = new customEvent("[" + this.ProcessName + ".exe] ➜ stopped running", EventType.ProcessStoppedEvent);
|
||||
if (this.PresenceClient.IsInitialized)
|
||||
{
|
||||
this.PresenceClient.ClearPresence();
|
||||
|
@ -126,13 +127,14 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
private void PresenceClientOnOnPresenceUpdate(object sender, PresenceMessage args)
|
||||
{
|
||||
//Console.WriteLine("[" + this.ProcessName + ".exe] ➜ Received Update on " + args.Name);
|
||||
RunRPCView.Data.LogCache.Value = "[" + this.ProcessName + ".exe] ➜ Received Update on " + args.Name;
|
||||
RunRPCView.Data.LogCache.Value = new customEvent("[" + this.ProcessName + ".exe] ➜ Received Update on " + args.Name, EventType.RPCUpdateEvent);
|
||||
}
|
||||
|
||||
private void PresenceClientOnOnReady(object sender, ReadyMessage args)
|
||||
{
|
||||
//Console.WriteLine("[" + this.ProcessName + ".exe] ➜ Received Ready from user " + args.User.Username);
|
||||
RunRPCView.Data.LogCache.Value = "[" + this.ProcessName + ".exe] ➜ Received Ready from user " + args.User.Username;
|
||||
RunRPCView.Data.LogCache.Value =
|
||||
new customEvent("[" + this.ProcessName + ".exe] ➜ Received Ready from user " + args.User.Username, EventType.RPCReadyEvent);
|
||||
}
|
||||
public void CheckState(Process[] processes)
|
||||
{
|
||||
|
@ -158,7 +160,7 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
|
||||
public void Save()
|
||||
{
|
||||
INIFile rpcFile = new INIFile(Global.AppDataPathRPC + "\\" + this.UUID + ".rpc", true);
|
||||
INIFile rpcFile = new INIFile(Global.AppDataPathRPC.Value + "\\" + this.UUID + ".rpc", true);
|
||||
rpcFile.SetValue(
|
||||
SaveSettingsHandler.Data.DiscordRpcFiles.Section,
|
||||
SaveSettingsHandler.Data.DiscordRpcFiles.ProcessName,
|
||||
|
|
|
@ -24,12 +24,54 @@
|
|||
/>
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
<RichTextBox Grid.Row="1" Name="RichTextBoxRPCLog">
|
||||
<RichTextBox.Resources>
|
||||
<Style TargetType="{x:Type Paragraph}">
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
</Style>
|
||||
</RichTextBox.Resources>
|
||||
</RichTextBox>
|
||||
<ScrollViewer Grid.Row="1" Name="LogViewer">
|
||||
<ItemsControl Grid.Row="1" Name="RpcLogView" Loaded="RpcLogView_OnLoaded" Margin="0,0,0,0">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical">
|
||||
|
||||
<Border Height="30" CornerRadius="4" Margin="0,3,0,0" Name="ParentBorder"
|
||||
Opacity="0">
|
||||
<Border.Triggers>
|
||||
|
||||
<!-- Animate the button's Width property. -->
|
||||
<EventTrigger RoutedEvent="Border.Loaded">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Storyboard.TargetName="ParentBorder"
|
||||
Storyboard.TargetProperty="(Border.Opacity)"
|
||||
To="1" Duration="0:0:00.5" AutoReverse="False"
|
||||
/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
|
||||
</Border.Triggers>
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0 0" EndPoint="1 1">
|
||||
<LinearGradientBrush.GradientStops>
|
||||
<GradientStop Offset="0" Color="{Binding GradientColor1}" />
|
||||
<GradientStop Offset="1" Color="{Binding GradientColor2}" />
|
||||
</LinearGradientBrush.GradientStops>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<TextBlock Margin="5 0" Text="{Binding Content}" FontSize="12"
|
||||
Foreground="White"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Padding="10,0,0,0">
|
||||
|
||||
<TextBlock.Effect>
|
||||
<DropShadowEffect ShadowDepth="1"/>
|
||||
|
||||
</TextBlock.Effect>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Page>
|
|
@ -12,7 +12,7 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
{
|
||||
public static class Data
|
||||
{
|
||||
public static UpdateVar<string> LogCache = new UpdateVar<string>();
|
||||
public static UpdateVar<customEvent> LogCache = new UpdateVar<customEvent>();
|
||||
}
|
||||
BackgroundWorker backgroundWorker = new BackgroundWorker();
|
||||
public RunRPCView()
|
||||
|
@ -21,7 +21,6 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
SetupLogListener();
|
||||
SetupBackgroundWorker();
|
||||
}
|
||||
|
||||
public void SetupLogListener()
|
||||
{
|
||||
Data.LogCache.ValueChanged += LogChanged;
|
||||
|
@ -34,13 +33,14 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
|
||||
private void LogChanged()
|
||||
{
|
||||
Console.WriteLine("Log Write Data: " + Data.LogCache.Value);
|
||||
VanillaConsole.WriteLine("Log Write Data: " + Data.LogCache.Value);
|
||||
this.Dispatcher.Invoke(() =>
|
||||
{
|
||||
RichTextBoxRPCLog.AppendText(Data.LogCache.Value + "\n");
|
||||
RpcLogView.Items.Add(Data.LogCache.Value);
|
||||
LogViewer.ScrollToEnd();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void SetupBackgroundWorker()
|
||||
{
|
||||
backgroundWorker.WorkerReportsProgress = true;
|
||||
|
@ -58,7 +58,7 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
VanillaConsole.WriteLine(ex.ToString());
|
||||
}
|
||||
}
|
||||
public void StopBackgroundWorker()
|
||||
|
@ -71,13 +71,14 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
VanillaConsole.WriteLine(ex.ToString());
|
||||
}
|
||||
//Stop RPC
|
||||
}
|
||||
|
||||
private void BackgroundWorkerOnDoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
Data.LogCache.Value = new customEvent("[INFO] RPC Thread is running", EventType.ProcessStartedEvent);
|
||||
bool runWorker = true;
|
||||
while (runWorker)
|
||||
{
|
||||
|
@ -97,7 +98,8 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
{
|
||||
foreach (Game game in DiscordRPCView.Data.Games)
|
||||
game.Stop();
|
||||
Console.WriteLine("Thread Stopped");
|
||||
VanillaConsole.WriteLine("Thread Stopped");
|
||||
Data.LogCache.Value = new customEvent("[INFO] RPC Thread has stopped", EventType.ProcessStoppedEvent);
|
||||
}
|
||||
|
||||
private void RunRPCView_OnUnloaded(object sender, RoutedEventArgs e)
|
||||
|
@ -110,5 +112,11 @@ namespace WeeXnes.Views.DiscordRPC
|
|||
{
|
||||
NavigationService.Navigate(new Uri("/Views/DiscordRPC/DiscordRPCView.xaml",UriKind.Relative));
|
||||
}
|
||||
|
||||
|
||||
private void RpcLogView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
35
WeeXnes/Views/EncryptedTextEditor/TextEditorView.xaml
Normal file
35
WeeXnes/Views/EncryptedTextEditor/TextEditorView.xaml
Normal file
|
@ -0,0 +1,35 @@
|
|||
<Page x:Class="WeeXnes.Views.EncryptedTextEditor.TextEditorView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.EncryptedTextEditor"
|
||||
mc:Ignorable="d"
|
||||
Title="TextEditorView" Height="Auto" Width="Auto">
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40px"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="btn_openFile" Click="Btn_openFile_OnClick" Grid.Column="0" Content="Open File" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5"/>
|
||||
<Button Name="btn_saveFile" Click="Btn_saveFile_OnClick" Grid.Column="1" Content="Save" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5"/>
|
||||
<Button Name="btn_saveFileAs" Click="Btn_saveFileAs_OnClick" Grid.Column="2" Content="Save As" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5"/>
|
||||
</Grid>
|
||||
<RichTextBox Name="rtb_FileEditor" Grid.Row="1">
|
||||
<RichTextBox.Resources>
|
||||
<Style TargetType="{x:Type Paragraph}">
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
</Style>
|
||||
</RichTextBox.Resources>
|
||||
</RichTextBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
97
WeeXnes/Views/EncryptedTextEditor/TextEditorView.xaml.cs
Normal file
97
WeeXnes/Views/EncryptedTextEditor/TextEditorView.xaml.cs
Normal file
|
@ -0,0 +1,97 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Forms;
|
||||
using EncryptionLib;
|
||||
using WeeXnes.Core;
|
||||
|
||||
namespace WeeXnes.Views.EncryptedTextEditor;
|
||||
|
||||
public partial class TextEditorView : Page
|
||||
{
|
||||
public string currentFilePath { get; set; } = null;
|
||||
public TextEditorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void RaiseClickEvent(System.Windows.Controls.Button button)
|
||||
{
|
||||
var clickEventArgs = new RoutedEventArgs(System.Windows.Controls.Button.ClickEvent);
|
||||
button.RaiseEvent(clickEventArgs);
|
||||
}
|
||||
|
||||
private void Btn_openFile_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var fileContent = string.Empty;
|
||||
var filePath = string.Empty;
|
||||
|
||||
Console.WriteLine("Calling OpenFileDialog");
|
||||
using (OpenFileDialog openFileDialog = new OpenFileDialog())
|
||||
{
|
||||
//openFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
openFileDialog.Filter = "WXN Text Files (*.wtf)|*.wtf";
|
||||
openFileDialog.RestoreDirectory = true;
|
||||
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Console.WriteLine("Opening file " + openFileDialog.FileName);
|
||||
this.currentFilePath = openFileDialog.FileName;
|
||||
string[] FileContent = File.ReadAllLines(openFileDialog.FileName);
|
||||
string[] decryptedContent = EncryptorLibary.decryptArray(Information.EncryptionHash, FileContent);
|
||||
rtb_FileEditor.Document.Blocks.Clear();
|
||||
foreach (string line in decryptedContent)
|
||||
{
|
||||
rtb_FileEditor.Document.Blocks.Add(new Paragraph(new Run(line)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Btn_saveFile_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.currentFilePath == null)
|
||||
{
|
||||
RaiseClickEvent(btn_saveFileAs);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Saving file " + currentFilePath);
|
||||
TextRange textRange = new TextRange(rtb_FileEditor.Document.ContentStart, rtb_FileEditor.Document.ContentEnd);
|
||||
string plainText = textRange.Text;
|
||||
string[] lines = plainText.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
string[] encryptedContent =
|
||||
EncryptionLib.EncryptorLibary.encryptArray(Information.EncryptionHash, lines);
|
||||
File.WriteAllLines(this.currentFilePath, encryptedContent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Btn_saveFileAs_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("Calling SaveFileDialog");
|
||||
using (SaveFileDialog saveFileDialog = new SaveFileDialog())
|
||||
{
|
||||
//saveFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
saveFileDialog.Filter = "WXN Text Files (*.wtf)|*.wtf";
|
||||
saveFileDialog.RestoreDirectory = true;
|
||||
|
||||
if(saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Console.WriteLine("Saving file " + saveFileDialog.FileName);
|
||||
this.currentFilePath = saveFileDialog.FileName;
|
||||
TextRange textRange = new TextRange(rtb_FileEditor.Document.ContentStart, rtb_FileEditor.Document.ContentEnd);
|
||||
string plainText = textRange.Text;
|
||||
string[] lines = plainText.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
string[] encryptedContent =
|
||||
EncryptionLib.EncryptorLibary.encryptArray(Information.EncryptionHash, lines);
|
||||
File.WriteAllLines(saveFileDialog.FileName, encryptedContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,11 @@
|
|||
using System;
|
||||
using System.Windows.Shapes;
|
||||
using WeeXnes.Core;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using Wpf.Ui.Controls;
|
||||
using Microsoft.Win32;
|
||||
using Path = System.Windows.Shapes.Path;
|
||||
|
||||
namespace WeeXnes.Views.KeyManager
|
||||
{
|
||||
|
@ -18,5 +25,56 @@ namespace WeeXnes.Views.KeyManager
|
|||
{
|
||||
return this.Name;
|
||||
}
|
||||
|
||||
|
||||
public void Export()
|
||||
{
|
||||
string filePath = Global.AppDataPathKEY.Value + "\\" + this.Filename;
|
||||
Console.WriteLine(filePath);
|
||||
|
||||
SaveFileDialog dialog = new SaveFileDialog()
|
||||
{
|
||||
FileName = this.Filename,
|
||||
Filter = "WXFiles (*.wx)|*.wx",
|
||||
Title = "Export KeyFile"
|
||||
};
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
File.Copy(filePath, dialog.FileName, true);
|
||||
Console.WriteLine("Exported to: " + dialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Import()
|
||||
{
|
||||
OpenFileDialog dialog = new OpenFileDialog()
|
||||
{
|
||||
Filter = "WXFiles (*.wx)|*.wx",
|
||||
Title = "Import KeyFile"
|
||||
};
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
string filename = System.IO.Path.GetFileName(dialog.FileName);
|
||||
WXFile wxFile = new WXFile(dialog.FileName);
|
||||
KeyItem newItem = new KeyItem(
|
||||
wxFile.GetName(),
|
||||
EncryptionLib.EncryptorLibary.decrypt(
|
||||
Information.EncryptionHash,
|
||||
wxFile.GetValue()
|
||||
)
|
||||
);
|
||||
newItem.Filename = filename;
|
||||
if (!File.Exists(Global.AppDataPathKEY.Value + "\\" + filename))
|
||||
{
|
||||
File.Copy(dialog.FileName, Global.AppDataPathKEY.Value + "\\" + filename, true);
|
||||
KeyManagerView.Data.KeyItemsList.Add(newItem);
|
||||
Console.WriteLine("Imported: " + dialog.FileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Error("Not Imported, already exists: " + dialog.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.KeyManager"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="KeyManagerView" Height="Auto" Width="Auto"
|
||||
Loaded="KeyManagerView_OnLoaded">
|
||||
|
@ -15,12 +16,22 @@
|
|||
<ListView Name="ListviewKeys"
|
||||
Background="Transparent"
|
||||
Foreground="White"
|
||||
BorderThickness="0">
|
||||
BorderThickness="0"
|
||||
SelectionChanged="ListviewKeys_OnSelectionChanged"
|
||||
IsTextSearchEnabled="True"
|
||||
>
|
||||
<ListView.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="Export"
|
||||
Name="btn_context_export"
|
||||
Click="ContextMenu_Export"/>
|
||||
<MenuItem Header="Import"
|
||||
Name="btn_context_import"
|
||||
Click="ContextMenu_Import"/>
|
||||
<Separator />
|
||||
<MenuItem Header="Remove"
|
||||
Name="btn_context_remove"
|
||||
Click="MenuItem_OnClick"/>
|
||||
Click="ContextMenu_Remove"/>
|
||||
</ContextMenu>
|
||||
</ListView.ContextMenu>
|
||||
|
||||
|
@ -49,14 +60,14 @@
|
|||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="100px"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
<ui:TextBox
|
||||
Grid.Column="0"
|
||||
Margin="0,0,5,0"
|
||||
Name="tb_keyname"/>
|
||||
<TextBox
|
||||
Name="tb_keyname" PlaceholderText="Name"/>
|
||||
<ui:TextBox
|
||||
Grid.Column="1"
|
||||
Margin="5,0,0,0"
|
||||
Name="tb_keyvalue"/>
|
||||
Name="tb_keyvalue" PlaceholderText="Key"/>
|
||||
<Button Grid.Column="2"
|
||||
Content="Add"
|
||||
Height="35px"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using WeeXnes.Core;
|
||||
|
@ -14,6 +15,8 @@ namespace WeeXnes.Views.KeyManager
|
|||
{
|
||||
public static BindingList<KeyItem> KeyItemsList = new BindingList<KeyItem>();
|
||||
public static UpdateVar<bool> censorKeys = new UpdateVar<bool>();
|
||||
public static UpdateVar<bool> copyOnSelect = new UpdateVar<bool>();
|
||||
public static UpdateVar<bool> sortList = new UpdateVar<bool>();
|
||||
}
|
||||
public KeyManagerView()
|
||||
{
|
||||
|
@ -23,6 +26,9 @@ namespace WeeXnes.Views.KeyManager
|
|||
}
|
||||
private void KeyManagerView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(Data.sortList.Value)
|
||||
resortList();
|
||||
|
||||
ListviewKeys.Items.Refresh();
|
||||
}
|
||||
|
||||
|
@ -33,6 +39,7 @@ namespace WeeXnes.Views.KeyManager
|
|||
if(String.IsNullOrEmpty(tb_keyvalue.Text))
|
||||
return;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
KeyItem newKey = new KeyItem(
|
||||
|
@ -40,15 +47,26 @@ namespace WeeXnes.Views.KeyManager
|
|||
tb_keyvalue.Text
|
||||
);
|
||||
WXFile wxFile = new WXFile(
|
||||
Global.AppDataPathKEY + "\\" + newKey.Filename);
|
||||
Global.AppDataPathKEY.Value + "\\" + newKey.Filename);
|
||||
WXFile.Methods.WriteFile(newKey, wxFile);
|
||||
Data.KeyItemsList.Add(newKey);
|
||||
KeyManagerView.Data.KeyItemsList.Add(newKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
ClearInputs();
|
||||
|
||||
if(Data.sortList.Value)
|
||||
resortList();
|
||||
}
|
||||
|
||||
private void resortList()
|
||||
{
|
||||
BindingList<KeyItem> newList = new BindingList<KeyItem>(Data.KeyItemsList.OrderBy(x => x.Name).ToList());
|
||||
Data.KeyItemsList = newList;
|
||||
ListviewKeys.ItemsSource = Data.KeyItemsList;
|
||||
}
|
||||
|
||||
private void ClearInputs()
|
||||
|
@ -65,18 +83,27 @@ namespace WeeXnes.Views.KeyManager
|
|||
Data.KeyItemsList.Remove(removeItem);
|
||||
try
|
||||
{
|
||||
File.Delete(Global.AppDataPathKEY + "\\" + removeItem.Filename);
|
||||
File.Delete(Global.AppDataPathKEY.Value + "\\" + removeItem.Filename);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Console.WriteLine(ex.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
private void MenuItem_OnClick(object sender, RoutedEventArgs e)
|
||||
private void ContextMenu_Remove(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DeleteItem((KeyItem)ListviewKeys.SelectedItem);
|
||||
}
|
||||
private void ContextMenu_Import(object sender, RoutedEventArgs e)
|
||||
{
|
||||
KeyItem.Import();
|
||||
}
|
||||
private void ContextMenu_Export(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var item = (KeyItem)ListviewKeys.SelectedItem;
|
||||
item.Export();
|
||||
}
|
||||
|
||||
private void KeyValue_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
@ -91,5 +118,16 @@ namespace WeeXnes.Views.KeyManager
|
|||
|
||||
|
||||
}
|
||||
|
||||
private void ListviewKeys_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
KeyItem selectedItem = (KeyItem)ListviewKeys.SelectedItem;
|
||||
if(selectedItem == null)
|
||||
return;
|
||||
|
||||
if(!Data.copyOnSelect.Value)
|
||||
return;
|
||||
Clipboard.SetText(selectedItem.Value);
|
||||
}
|
||||
}
|
||||
}
|
22
WeeXnes/Views/PasswordGenerator/PasswordGenView.xaml
Normal file
22
WeeXnes/Views/PasswordGenerator/PasswordGenView.xaml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<Page x:Class="WeeXnes.Views.PasswordGenerator.PasswordGenView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.PasswordGenerator"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="PasswordGenView" Height="Auto" Width="Auto">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Foreground="White" Content="Password Generator" HorizontalAlignment="Center"/>
|
||||
<Label Content="Lenght: " Foreground="White"/>
|
||||
<ui:NumberBox Name="numbox_pwCount" Margin="0,5" DecimalPlaces="0" Min="1" Value="15"/>
|
||||
<ui:ToggleSwitch Name="toggle_alpha" Margin="0,5" Content="a-z" IsChecked="True"/>
|
||||
<ui:ToggleSwitch Name="toggle_numeric" Margin="0,5" Content="0-9" IsChecked="True"/>
|
||||
<ui:ToggleSwitch Name="toggle_caps" Margin="0,5" Content="Capitalization" IsChecked="True"/>
|
||||
<ui:ToggleSwitch Name="toggle_special" Margin="0,5" Content="Special characters"/>
|
||||
<ui:Button Content="Generate Password" HorizontalAlignment="Stretch" Click="ButtonBase_OnClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
68
WeeXnes/Views/PasswordGenerator/PasswordGenView.xaml.cs
Normal file
68
WeeXnes/Views/PasswordGenerator/PasswordGenView.xaml.cs
Normal file
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using WeeXnes.Core;
|
||||
|
||||
namespace WeeXnes.Views.PasswordGenerator
|
||||
{
|
||||
public partial class PasswordGenView : Page
|
||||
{
|
||||
public static Random random = new Random();
|
||||
private class PasswordBuilderStrings
|
||||
{
|
||||
public static string alphabetical_lc = "abcdefghijklmnopqrstuvwxyz";
|
||||
public static string alphabetical_caps = "ABCDEFGHIJKLMNOPQRSTUVQXYZ";
|
||||
public static string numerical = "1234567890";
|
||||
public static string special = "!#$%&()*+,-<>=?";
|
||||
}
|
||||
public PasswordGenView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void GeneratePasword()
|
||||
{
|
||||
if(toggle_alpha.IsChecked == false)
|
||||
if(toggle_numeric.IsChecked == false)
|
||||
if(toggle_special.IsChecked == false)
|
||||
return;
|
||||
|
||||
|
||||
string CustomPasswordBuilderString = "";
|
||||
|
||||
if (toggle_alpha.IsChecked == true)
|
||||
CustomPasswordBuilderString += PasswordBuilderStrings.alphabetical_lc;
|
||||
|
||||
if (toggle_caps.IsChecked == true)
|
||||
CustomPasswordBuilderString += PasswordBuilderStrings.alphabetical_caps;
|
||||
|
||||
if (toggle_numeric.IsChecked == true)
|
||||
CustomPasswordBuilderString += PasswordBuilderStrings.numerical;
|
||||
|
||||
if (toggle_special.IsChecked == true)
|
||||
CustomPasswordBuilderString += PasswordBuilderStrings.special;
|
||||
|
||||
|
||||
Console.WriteLine("Generating Password from: " + CustomPasswordBuilderString);
|
||||
//MessageBox.Show(CustomPasswordBuilderString);
|
||||
|
||||
string generatedPassword = "";
|
||||
|
||||
|
||||
for (int i = 0; i < numbox_pwCount.Value; i++)
|
||||
{
|
||||
int randomNr = random.Next(0, CustomPasswordBuilderString.Length);
|
||||
generatedPassword = generatedPassword + CustomPasswordBuilderString[randomNr];
|
||||
}
|
||||
|
||||
SavePasswordView.GeneratedPassword = generatedPassword;
|
||||
SavePasswordView._prevPage = this;
|
||||
NavigationService.Navigate(new Uri("/Views/PasswordGenerator/SavePasswordView.xaml",UriKind.Relative));
|
||||
}
|
||||
|
||||
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
GeneratePasword();
|
||||
}
|
||||
}
|
||||
}
|
20
WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml
Normal file
20
WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<Page x:Class="WeeXnes.Views.PasswordGenerator.SavePasswordView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.PasswordGenerator"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="SavePasswordView" Height="Auto" Width="Auto"
|
||||
Loaded="SavePasswordView_OnLoaded">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="Password Generated: " Foreground="White" FontSize="20"/>
|
||||
<Label Name="displayPassword" Foreground="White" FontSize="15" Margin="0,0,0,5"/>
|
||||
<ui:Button Content="Copy to clipboard" HorizontalAlignment="Stretch" Click="CopyToClipboard" Margin="0,3"/>
|
||||
<ui:Button Content="Save to KeyManager" HorizontalAlignment="Stretch" Click="SaveToKeyManager" Margin="0,3"/>
|
||||
<ui:Button Content="Back" HorizontalAlignment="Stretch" Click="CloseDialog" Margin="0,3"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
35
WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml.cs
Normal file
35
WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace WeeXnes.Views.PasswordGenerator
|
||||
{
|
||||
public partial class SavePasswordView : Page
|
||||
{
|
||||
public static string GeneratedPassword = "";
|
||||
public static PasswordGenView _prevPage = null;
|
||||
public SavePasswordView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SavePasswordView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
displayPassword.Content = GeneratedPassword;
|
||||
}
|
||||
|
||||
private void CloseDialog(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(_prevPage != null)
|
||||
NavigationService.Navigate(_prevPage);
|
||||
}
|
||||
private void CopyToClipboard(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Clipboard.SetText(GeneratedPassword);
|
||||
}
|
||||
private void SaveToKeyManager(object sender, RoutedEventArgs e)
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/Views/PasswordGenerator/SaveToKeyManagerView.xaml",UriKind.Relative));
|
||||
}
|
||||
}
|
||||
}
|
17
WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml
Normal file
17
WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<Page x:Class="WeeXnes.Views.PasswordGenerator.SaveToKeyManagerView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.PasswordGenerator"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="SaveToKeyManagerView" Height="Auto" Width="Auto">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="Save password to KeyManager: " Foreground="White" FontSize="20"/>
|
||||
<ui:TextBox PlaceholderText="Name for Password" Name="tb_keyname"/>
|
||||
<ui:Button Content="Save" HorizontalAlignment="Stretch" Click="SavePassword" Margin="0,3"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
36
WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml.cs
Normal file
36
WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using WeeXnes.Core;
|
||||
using WeeXnes.Views.KeyManager;
|
||||
|
||||
namespace WeeXnes.Views.PasswordGenerator
|
||||
{
|
||||
public partial class SaveToKeyManagerView : Page
|
||||
{
|
||||
|
||||
public SaveToKeyManagerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void SavePassword(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
KeyItem newKey = new KeyItem(
|
||||
tb_keyname.Text,
|
||||
SavePasswordView.GeneratedPassword
|
||||
);
|
||||
WXFile wxFile = new WXFile(
|
||||
Global.AppDataPathKEY.Value + "\\" + newKey.Filename);
|
||||
WXFile.Methods.WriteFile(newKey, wxFile);
|
||||
KeyManagerView.Data.KeyItemsList.Add(newKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
NavigationService.Navigate(SavePasswordView._prevPage);
|
||||
}
|
||||
}
|
||||
}
|
21
WeeXnes/Views/PluginManager/PluginManagerView.xaml
Normal file
21
WeeXnes/Views/PluginManager/PluginManagerView.xaml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<Page x:Class="WeeXnes.Views.PluginManager.PluginManagerView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.PluginManager"
|
||||
mc:Ignorable="d"
|
||||
Title="PluginManagerView" Height="450" Width="800">
|
||||
<Grid>
|
||||
<ListView ItemsSource="{Binding Plugin}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
<TextBlock Text="{Binding Description}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</Page>
|
13
WeeXnes/Views/PluginManager/PluginManagerView.xaml.cs
Normal file
13
WeeXnes/Views/PluginManager/PluginManagerView.xaml.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System.Windows.Controls;
|
||||
|
||||
|
||||
namespace WeeXnes.Views.PluginManager;
|
||||
|
||||
public partial class PluginManagerView : Page
|
||||
{
|
||||
public PluginManagerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
}
|
44
WeeXnes/Views/ProfileView/InboxView.xaml
Normal file
44
WeeXnes/Views/ProfileView/InboxView.xaml
Normal file
|
@ -0,0 +1,44 @@
|
|||
<Page x:Class="WeeXnes.Views.ProfileView.InboxView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.ProfileView"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="InboxView" Height="Auto" Width="Auto"
|
||||
Loaded="InboxView_OnLoaded">
|
||||
<Grid>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ScrollViewer Grid.Row="1" Name="LogViewer">
|
||||
<ItemsControl Grid.Row="1" x:Name="InboxItems" Loaded="InboxItemsLoaded" Margin="0,0,0,0">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<ui:CardAction Icon="Mail24" Margin="0,0,0,5"
|
||||
Click="ButtonBase_OnClick"
|
||||
CommandParameter="test123"
|
||||
Tag="{Binding}">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,4"
|
||||
FontWeight="Medium"
|
||||
Text="{Binding Author}" />
|
||||
<TextBlock
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
||||
Text="{Binding Message}"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Page>
|
46
WeeXnes/Views/ProfileView/InboxView.xaml.cs
Normal file
46
WeeXnes/Views/ProfileView/InboxView.xaml.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using WeeXnes.Core;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace WeeXnes.Views.ProfileView
|
||||
{
|
||||
public partial class InboxView : Page
|
||||
{
|
||||
public InboxView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InboxView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//header_label.Content = "Inbox of " + ProfileView.auth._currentUserCache.Value.name;
|
||||
}
|
||||
|
||||
private void InboxItemsLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//Reverse the message list
|
||||
List<dynamic> messageList = new List<dynamic>();
|
||||
foreach (var msg in ProfileView.auth._currentUserCache.Value.inbox)
|
||||
{
|
||||
messageList.Add(msg);
|
||||
}
|
||||
|
||||
messageList.Reverse();
|
||||
InboxItems.ItemsSource = messageList;
|
||||
}
|
||||
|
||||
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CardAction button = (CardAction)sender;
|
||||
dynamic messageObj = button.Tag;
|
||||
Console.WriteLine(messageObj.ToString());
|
||||
MessageFullView.MessageToShow = messageObj;
|
||||
NavigationService.Navigate(new Uri("/Views/ProfileView/MessageFullView.xaml",UriKind.Relative));
|
||||
}
|
||||
}
|
||||
}
|
15
WeeXnes/Views/ProfileView/LicenseView.xaml
Normal file
15
WeeXnes/Views/ProfileView/LicenseView.xaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<Page x:Class="WeeXnes.Views.ProfileView.LicenseView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.ProfileView"
|
||||
mc:Ignorable="d"
|
||||
Title="LicenseView" Height="Auto" Width="Auto"
|
||||
Loaded="LicenseView_OnLoaded">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<Label Name="header_label"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
18
WeeXnes/Views/ProfileView/LicenseView.xaml.cs
Normal file
18
WeeXnes/Views/ProfileView/LicenseView.xaml.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace WeeXnes.Views.ProfileView
|
||||
{
|
||||
public partial class LicenseView : Page
|
||||
{
|
||||
public LicenseView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void LicenseView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
header_label.Content = "Licenses of " + ProfileView.auth._currentUserCache.Value.name;
|
||||
}
|
||||
}
|
||||
}
|
15
WeeXnes/Views/ProfileView/LoginError.xaml
Normal file
15
WeeXnes/Views/ProfileView/LoginError.xaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<Page x:Class="WeeXnes.Views.ProfileView.LoginError"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.ProfileView"
|
||||
mc:Ignorable="d"
|
||||
Title="LoginError" Height="Auto" Width="Auto">
|
||||
<Grid>
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<Label Content="wrong credentials" HorizontalAlignment="Center" Padding="0,0,0,10"/>
|
||||
<Button Content="Back to login" HorizontalAlignment="Center" Click="ButtonBase_OnClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
19
WeeXnes/Views/ProfileView/LoginError.xaml.cs
Normal file
19
WeeXnes/Views/ProfileView/LoginError.xaml.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace WeeXnes.Views.ProfileView
|
||||
{
|
||||
public partial class LoginError : Page
|
||||
{
|
||||
public LoginError()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/Views/ProfileView/LoginView.xaml",UriKind.Relative));
|
||||
}
|
||||
}
|
||||
}
|
19
WeeXnes/Views/ProfileView/LoginView.xaml
Normal file
19
WeeXnes/Views/ProfileView/LoginView.xaml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<Page x:Class="WeeXnes.Views.ProfileView.LoginView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.ProfileView"
|
||||
mc:Ignorable="d"
|
||||
Title="LoginView" Height="Auto" Width="Auto"
|
||||
Loaded="LoginView_OnLoaded">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<Label Content="Email:"/>
|
||||
<TextBox Name="tb_email" Margin="0,0,0,10" KeyDown="InputKeydown"/>
|
||||
<Label Content="Password:"/>
|
||||
<TextBox Name="tb_password" Margin="0,0,0,10" KeyDown="InputKeydown"/>
|
||||
<Button Content="Login" HorizontalAlignment="Center" Name="LoginButton" Click="LoginButton_OnClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
49
WeeXnes/Views/ProfileView/LoginView.xaml.cs
Normal file
49
WeeXnes/Views/ProfileView/LoginView.xaml.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using WeeXnes.Core;
|
||||
|
||||
namespace WeeXnes.Views.ProfileView
|
||||
{
|
||||
public partial class LoginView : Page
|
||||
{
|
||||
public static bool alreadyLoggedIn = false;
|
||||
public static UpdateVar<string> errorStringCache = new UpdateVar<string>();
|
||||
public LoginView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SwitchToProfileView()
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/Views/ProfileView/ProfileView.xaml",UriKind.Relative));
|
||||
}
|
||||
|
||||
private void LoginView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (alreadyLoggedIn)
|
||||
{
|
||||
SwitchToProfileView();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoginButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
attemptLogin();
|
||||
}
|
||||
|
||||
private void InputKeydown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
attemptLogin();
|
||||
}
|
||||
|
||||
private void attemptLogin()
|
||||
{
|
||||
ProfileView.auth._email = tb_email.Text;
|
||||
ProfileView.auth._password = tb_password.Text;
|
||||
SwitchToProfileView();
|
||||
}
|
||||
}
|
||||
}
|
18
WeeXnes/Views/ProfileView/MessageFullView.xaml
Normal file
18
WeeXnes/Views/ProfileView/MessageFullView.xaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<Page x:Class="WeeXnes.Views.ProfileView.MessageFullView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.ProfileView"
|
||||
mc:Ignorable="d"
|
||||
Title="MessageFullView" Height="Auto" Width="Auto"
|
||||
Loaded="MessageFullView_OnLoaded">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50px"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label HorizontalAlignment="Center" VerticalAlignment="Center" Name="AuthorLabel" Content=""/>
|
||||
<RichTextBox Grid.Row="1" Name="MessageContent" IsReadOnly="True"/>
|
||||
</Grid>
|
||||
</Page>
|
30
WeeXnes/Views/ProfileView/MessageFullView.xaml.cs
Normal file
30
WeeXnes/Views/ProfileView/MessageFullView.xaml.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
|
||||
namespace WeeXnes.Views.ProfileView
|
||||
{
|
||||
public partial class MessageFullView : Page
|
||||
{
|
||||
public static dynamic MessageToShow = null;
|
||||
public MessageFullView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void MessageFullView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(MessageToShow == null)
|
||||
return;
|
||||
AuthorLabel.Content = MessageToShow.Author;
|
||||
MessageContent.Document.Blocks.Clear();
|
||||
MessageContent.Document.Blocks.Add(
|
||||
new Paragraph(
|
||||
new Run(
|
||||
MessageToShow.Message.ToString()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
81
WeeXnes/Views/ProfileView/ProfileView.xaml
Normal file
81
WeeXnes/Views/ProfileView/ProfileView.xaml
Normal file
|
@ -0,0 +1,81 @@
|
|||
<Page x:Class="WeeXnes.Views.ProfileView.ProfileView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.ProfileView"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="ProfileView" Height="Auto" Width="Auto"
|
||||
Loaded="ProfileView_OnLoaded"
|
||||
Unloaded="ProfileView_OnUnloaded">
|
||||
<Grid>
|
||||
<Grid Name="LoadingScreen" Visibility="Collapsed">
|
||||
<ui:LoadingScreen Background="Transparent"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<StackPanel Orientation="Vertical" Name="ProfileContentPanel" Visibility="Collapsed">
|
||||
|
||||
<Border Height="40px" CornerRadius="5">
|
||||
<Border.Background>
|
||||
<ImageBrush
|
||||
Stretch="UniformToFill"
|
||||
x:Name="BannerBackground"/>
|
||||
</Border.Background>
|
||||
<Label Content="TestName" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="White"
|
||||
FontSize="20px"
|
||||
Name="UsernameLabel">
|
||||
<Label.Effect>
|
||||
<DropShadowEffect
|
||||
ShadowDepth="0"
|
||||
Direction="0"
|
||||
Color="Black"
|
||||
Opacity="1"
|
||||
BlurRadius="3"/>
|
||||
</Label.Effect>
|
||||
</Label>
|
||||
|
||||
</Border>
|
||||
<Label Name="ProfileDesc" HorizontalAlignment="Center" Foreground="White" Padding="0,10,0,10"/>
|
||||
|
||||
<Separator/>
|
||||
<Label Content="" HorizontalAlignment="Center" Padding="0,0,0,0"/>
|
||||
<!-- Options for Account -->
|
||||
|
||||
<ui:CardAction Icon="MailInbox24"
|
||||
Name="InboxButton"
|
||||
Click="InboxButton_OnClick">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,4"
|
||||
FontWeight="Medium"
|
||||
Text="Inbox" />
|
||||
<TextBlock
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
||||
Text="Check your messages" />
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
|
||||
<ui:CardAction Icon="Key24"
|
||||
Click="LicenseButton_OnClick"
|
||||
Name="LicenseButton" Margin="0,5,0,0"
|
||||
Visibility="Collapsed">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,4"
|
||||
FontWeight="Medium"
|
||||
Text="Licenses" />
|
||||
<TextBlock
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
||||
Text="See your currently active licenses for other Apps of mine (These are no purchasable licenses, these are access licenses only given to specific people for testing)"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
107
WeeXnes/Views/ProfileView/ProfileView.xaml.cs
Normal file
107
WeeXnes/Views/ProfileView/ProfileView.xaml.cs
Normal file
|
@ -0,0 +1,107 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
using WeeXnes.Core;
|
||||
using WeeXnes.Views.Settings;
|
||||
|
||||
namespace WeeXnes.Views.ProfileView
|
||||
{
|
||||
public partial class ProfileView : Page
|
||||
{
|
||||
public static Auth auth = new Auth(
|
||||
"https://weexnes.dev:4000/login",
|
||||
"https://weexnes.dev:4000/user"
|
||||
);
|
||||
public ProfileView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void ProfileView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
auth.ExceptionCache.ValueChanged += LoginWorkerException;
|
||||
auth._currentUserCache.ValueChanged += userCacheChanged;
|
||||
LoginView.errorStringCache.ValueChanged += errorStringChanged;
|
||||
Console.WriteLine("Event hooks loaded");
|
||||
Console.WriteLine("Error Hooks loaded");
|
||||
|
||||
if (auth._currentUserCache.Value == null)
|
||||
{
|
||||
LoadingScreen.Visibility = Visibility.Visible;
|
||||
auth._loginWorker.RunWorkerAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadProfileToGui();
|
||||
ProfileContentPanel.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
private void userCacheChanged()
|
||||
{
|
||||
if (auth._currentUserCache.Value != null)
|
||||
{
|
||||
this.Dispatcher.Invoke(() =>
|
||||
{
|
||||
LoadProfileToGui();
|
||||
ProfileContentPanel.Visibility = Visibility.Visible;
|
||||
LoadingScreen.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Dispatcher.Invoke(() =>
|
||||
{
|
||||
ProfileContentPanel.Visibility = Visibility.Collapsed;
|
||||
LoadingScreen.Visibility = Visibility.Visible;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void LoginWorkerException()
|
||||
{
|
||||
this.Dispatcher.Invoke(() =>
|
||||
{
|
||||
new FluentMessageBox(auth.ExceptionCache.Value.ToString()).ShowDialog();
|
||||
errorStringChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private void LoadProfileToGui()
|
||||
{
|
||||
//Load Profile
|
||||
UsernameLabel.Content = Convert.ToString(auth._currentUserCache.Value.name);
|
||||
ProfileDesc.Content = Convert.ToString(auth._currentUserCache.Value.profileInfo.bio);
|
||||
BannerBackground.ImageSource =
|
||||
new BitmapImage(new Uri(Convert.ToString(auth._currentUserCache.Value.profileInfo.bannerUrl)));
|
||||
}
|
||||
|
||||
private void ProfileView_OnUnloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
auth.ExceptionCache.ValueChanged -= LoginWorkerException;
|
||||
auth._currentUserCache.ValueChanged -= userCacheChanged;
|
||||
LoginView.errorStringCache.ValueChanged -= errorStringChanged;
|
||||
|
||||
Console.WriteLine("Event hooks unloaded");
|
||||
Console.WriteLine("Error hooks unloaded");
|
||||
}
|
||||
private void errorStringChanged()
|
||||
{
|
||||
this.Dispatcher.Invoke(() =>
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/Views/ProfileView/LoginError.xaml",UriKind.Relative));
|
||||
});
|
||||
}
|
||||
|
||||
private void InboxButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/Views/ProfileView/InboxView.xaml",UriKind.Relative));
|
||||
}
|
||||
|
||||
private void LicenseButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/Views/ProfileView/LicenseView.xaml",UriKind.Relative));
|
||||
}
|
||||
}
|
||||
}
|
66
WeeXnes/Views/Settings/ChangePathsView.xaml
Normal file
66
WeeXnes/Views/Settings/ChangePathsView.xaml
Normal file
|
@ -0,0 +1,66 @@
|
|||
<Page x:Class="WeeXnes.Views.Settings.ChangePathsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.Settings"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="ChangePathsView" Height="Auto" Width="Auto"
|
||||
Loaded="ChangePathsView_OnLoaded">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="45"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollViewer Grid.Row="0">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="Requires Restart after changing!!!" Foreground="White"
|
||||
HorizontalAlignment="Center"/>
|
||||
|
||||
<TextBlock Text="(will auto close after saving)" FontSize="10" Foreground="White"
|
||||
HorizontalAlignment="Center"/>
|
||||
<ui:TextBox Name="TextboxKeyPath" PlaceholderText="Key Files Path" Margin="0,4">
|
||||
<ui:TextBox.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="Select Folder for Key Files"
|
||||
Name="btn_context_selFolderKF"
|
||||
Click="ContextMenu_SelectKfFolder"/>
|
||||
</ContextMenu>
|
||||
</ui:TextBox.ContextMenu>
|
||||
</ui:TextBox>
|
||||
<ui:TextBox Name="TextboxRPCPath" PlaceholderText="Client ID" Margin="0,4">
|
||||
<ui:TextBox.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="Select Folder for RPC Files"
|
||||
Name="btn_context_selFolderRPC"
|
||||
Click="ContextMenu_SelectRpcFolder"
|
||||
/>
|
||||
</ContextMenu>
|
||||
</ui:TextBox.ContextMenu>
|
||||
</ui:TextBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Button
|
||||
Padding="24,6"
|
||||
HorizontalAlignment="Center"
|
||||
Content="Cancel"
|
||||
Icon="CaretLeft24"
|
||||
Name="ButtonCancelDialog"
|
||||
Click="ButtonCancelDialog_OnClick"/>
|
||||
<ui:Button Grid.Column="1"
|
||||
Padding="24,6"
|
||||
HorizontalAlignment="Center"
|
||||
Content="Save"
|
||||
Icon="SaveMultiple24"
|
||||
Name="ButtonSaveDialog"
|
||||
Click="ButtonSaveDialog_OnClick"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
61
WeeXnes/Views/Settings/ChangePathsView.xaml.cs
Normal file
61
WeeXnes/Views/Settings/ChangePathsView.xaml.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using WeeXnes.Core;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
|
||||
using TextBox = System.Windows.Controls.TextBox;
|
||||
|
||||
namespace WeeXnes.Views.Settings
|
||||
{
|
||||
public partial class ChangePathsView : Page
|
||||
{
|
||||
public ChangePathsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ChangePathsView_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TextboxKeyPath.Text = Global.AppDataPathKEY.Value;
|
||||
TextboxRPCPath.Text = Global.AppDataPathRPC.Value;
|
||||
}
|
||||
|
||||
private void ButtonCancelDialog_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/Views/Settings/SettingsView.xaml",UriKind.Relative));
|
||||
}
|
||||
|
||||
private void ButtonSaveDialog_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Global.AppDataPathRPC.Value = TextboxRPCPath.Text;
|
||||
Global.AppDataPathKEY.Value = TextboxKeyPath.Text;
|
||||
Global.ForceClose();
|
||||
}
|
||||
|
||||
private void ContextMenu_SelectKfFolder(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CallOpenFolderDialog(TextboxKeyPath);
|
||||
}
|
||||
private void ContextMenu_SelectRpcFolder(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CallOpenFolderDialog(TextboxRPCPath);
|
||||
}
|
||||
|
||||
private void CallOpenFolderDialog(TextBox textBoxToChange)
|
||||
{
|
||||
|
||||
|
||||
using(var fbd = new FolderBrowserDialog())
|
||||
{
|
||||
DialogResult result = fbd.ShowDialog();
|
||||
|
||||
if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
|
||||
{
|
||||
textBoxToChange.Text = fbd.SelectedPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
33
WeeXnes/Views/Settings/FluentMessageBox.xaml
Normal file
33
WeeXnes/Views/Settings/FluentMessageBox.xaml
Normal file
|
@ -0,0 +1,33 @@
|
|||
<ui:UiWindow x:Class="WeeXnes.Views.Settings.FluentMessageBox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WeeXnes.Views.Settings"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
Title="" Height="200" Width="600"
|
||||
Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
WindowBackdropType="Mica"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<ui:TitleBar
|
||||
Grid.Row="0"
|
||||
Title="Error"
|
||||
ShowHelp="False"
|
||||
ShowClose="True"
|
||||
ShowMinimize="False"
|
||||
ShowMaximize="False"
|
||||
UseSnapLayout="True">
|
||||
|
||||
</ui:TitleBar>
|
||||
<Border Margin="0,0,0,0">
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
|
||||
<Label Content="Oh no! an error has occurred" Foreground="White" HorizontalAlignment="Center" FontSize="25"/>
|
||||
<Label Content="full exception log has been dumped into error__log.txt" Foreground="White" HorizontalAlignment="Center" FontSize="12"/>
|
||||
<Label Content="" Name="ErrorDump" Foreground="Gray" HorizontalAlignment="Center" FontSize="12" Padding="0,15,0,0"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ui:UiWindow>
|
14
WeeXnes/Views/Settings/FluentMessageBox.xaml.cs
Normal file
14
WeeXnes/Views/Settings/FluentMessageBox.xaml.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System.Windows;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace WeeXnes.Views.Settings
|
||||
{
|
||||
public partial class FluentMessageBox : UiWindow
|
||||
{
|
||||
public FluentMessageBox(string messageContent)
|
||||
{
|
||||
InitializeComponent();
|
||||
ErrorDump.Content = "Exception: " + messageContent;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,7 +17,8 @@
|
|||
<ui:CardAction Icon="Play28"
|
||||
Name="ButtonCheckForUpdates"
|
||||
Click="ButtonCheckForUpdates_OnClick"
|
||||
Margin="0,10,0,0">
|
||||
Margin="0,10,0,0"
|
||||
Visibility="Collapsed">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,4"
|
||||
|
@ -29,7 +30,7 @@
|
|||
<ui:CardAction Icon="LinkSquare20"
|
||||
Name="ButtonCreateStartMenuShortcut"
|
||||
Click="ButtonCreateStartMenuShortcut_OnClick"
|
||||
Margin="0,10">
|
||||
Margin="0,10,0,0">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,4"
|
||||
|
@ -38,6 +39,18 @@
|
|||
/>
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
<ui:CardAction Icon="Folder32"
|
||||
Name="ChangePathsButton"
|
||||
Click="ChangePathsButton_OnClick"
|
||||
Margin="0,10">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,4"
|
||||
FontWeight="Medium"
|
||||
Text="Change paths for Key and RPC files"
|
||||
/>
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
<TextBlock Text="Key Manager"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="White"/>
|
||||
|
@ -45,6 +58,14 @@
|
|||
Name="CheckboxCensorKeys"
|
||||
Checked="CheckboxCensorKeys_OnChecked"
|
||||
Unchecked="CheckboxCensorKeys_OnUnchecked"/>
|
||||
<CheckBox Content="Copy Key to Clipboard when selected"
|
||||
Name="CheckboxCopyOnSelect"
|
||||
Checked="CheckboxCopyOnSelect_OnChecked"
|
||||
Unchecked="CheckboxCopyOnSelect_OnUnchecked"/>
|
||||
<CheckBox Content="Sort Keys alphabetically"
|
||||
Name="CheckboxSortKeys"
|
||||
Checked="CheckboxSortKeys_OnChecked"
|
||||
Unchecked="CheckboxSortKeys_OnUnchecked"/>
|
||||
<TextBlock Text="Discord RPC"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="White"/>
|
||||
|
@ -83,6 +104,33 @@
|
|||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel Orientation="Vertical" Name="MiscOptions" Margin="0,0,0,5">
|
||||
<Label Content="set automatic shutdown" HorizontalAlignment="Center"/>
|
||||
<ui:NumberBox Name="ShutdownTimer"/>
|
||||
<ui:Button Content="Set" HorizontalAlignment="Stretch" Margin="0,5,0,5" Click="TimedShutdown_OnClick"/>
|
||||
<ui:Button Content="Reset" HorizontalAlignment="Stretch" Click="ResetShutdown_OnClick"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Vertical" Visibility="Collapsed" Name="DebugOptions">
|
||||
<Label Content="Debug" HorizontalAlignment="Center"/>
|
||||
|
||||
<CheckBox Content="Check for updates on Startup"
|
||||
Name="CheckboxAutoUpdate"
|
||||
Checked="CheckboxAutoUpdate_OnChecked"
|
||||
Unchecked="CheckboxAutoUpdate_OnUnchecked"/>
|
||||
<ui:CardAction Icon="ErrorCircle24"
|
||||
Click="dbg_throwException">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,4"
|
||||
FontWeight="Medium"
|
||||
Text="Throw Exception"
|
||||
/>
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using Application = System.Windows.Forms.Application;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Animation;
|
||||
using Newtonsoft.Json;
|
||||
using Nocksoft.IO.ConfigFiles;
|
||||
using WeeXnes.Core;
|
||||
|
@ -23,11 +25,21 @@ namespace WeeXnes.Views.Settings
|
|||
{
|
||||
InitializeComponent();
|
||||
LoadSettingsToGui();
|
||||
EnableDebugOptions();
|
||||
}
|
||||
|
||||
private void EnableDebugOptions()
|
||||
{
|
||||
if(!App.DebugMode)
|
||||
return;
|
||||
|
||||
DebugOptions.Visibility = Visibility.Visible;
|
||||
}
|
||||
private void LoadSettingsToGui()
|
||||
{
|
||||
CheckboxCensorKeys.IsChecked = KeyManagerView.Data.censorKeys.Value;
|
||||
CheckboxCopyOnSelect.IsChecked = KeyManagerView.Data.copyOnSelect.Value;
|
||||
CheckboxSortKeys.IsChecked = KeyManagerView.Data.sortList.Value;
|
||||
}
|
||||
private void CheckboxCensorKeys_OnChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
@ -38,12 +50,23 @@ namespace WeeXnes.Views.Settings
|
|||
{
|
||||
KeyManagerView.Data.censorKeys.Value = false;
|
||||
}
|
||||
|
||||
private void CheckboxAutoUpdate_OnChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Global.checkUpdateOnStartup.Value = true;
|
||||
}
|
||||
private void CheckboxAutoUpdate_OnUnchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Global.checkUpdateOnStartup.Value = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void ButtonCheckForUpdates_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Console.WriteLine("Checking for Updates...");
|
||||
try
|
||||
{
|
||||
using(WebClient webClient = new WebClient())
|
||||
|
@ -54,14 +77,19 @@ namespace WeeXnes.Views.Settings
|
|||
GithubApiResponse apiResponseData = JsonConvert.DeserializeObject<GithubApiResponse>(downloadString);
|
||||
if (apiResponseData.tag_name != Information.Version)
|
||||
{
|
||||
Console.WriteLine("Update found");
|
||||
UpdateFoundView.Data.updateResponse = apiResponseData;
|
||||
NavigationService.Navigate(new Uri("/Views/Settings/UpdateFoundView.xaml",UriKind.Relative));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("No Update found");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Console.WriteLine(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +103,7 @@ namespace WeeXnes.Views.Settings
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
Console.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,7 +116,7 @@ namespace WeeXnes.Views.Settings
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
Console.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,9 +129,63 @@ namespace WeeXnes.Views.Settings
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
Console.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangePathsButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/Views/Settings/ChangePathsView.xaml",UriKind.Relative));
|
||||
}
|
||||
|
||||
private void CheckboxCopyOnSelect_OnChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
KeyManagerView.Data.copyOnSelect.Value = true;
|
||||
}
|
||||
|
||||
private void CheckboxCopyOnSelect_OnUnchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
KeyManagerView.Data.copyOnSelect.Value = false;
|
||||
}
|
||||
|
||||
private void CheckboxSortKeys_OnChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
KeyManagerView.Data.sortList.Value = true;
|
||||
}
|
||||
|
||||
private void CheckboxSortKeys_OnUnchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
KeyManagerView.Data.sortList.Value = false;
|
||||
}
|
||||
|
||||
private void dbg_throwException(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Console.Warning("Creating ArithmeticException for Debugging");
|
||||
Functions.ThrowTestException(new ArithmeticException());
|
||||
}
|
||||
|
||||
private void TimedShutdown_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("Setting timed shutdown in " + (Convert.ToInt32(ShutdownTimer.Value)) + "mins");
|
||||
System.Diagnostics.Process process = new System.Diagnostics.Process();
|
||||
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
|
||||
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
|
||||
startInfo.FileName = "cmd.exe";
|
||||
startInfo.Arguments = "/C shutdown -s -t " + (Convert.ToInt32(ShutdownTimer.Value)*60).ToString();
|
||||
process.StartInfo = startInfo;
|
||||
process.Start();
|
||||
}
|
||||
|
||||
private void ResetShutdown_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("Canceling timed shutdown");
|
||||
System.Diagnostics.Process process = new System.Diagnostics.Process();
|
||||
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
|
||||
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
|
||||
startInfo.FileName = "cmd.exe";
|
||||
startInfo.Arguments = "/C shutdown -a";
|
||||
process.StartInfo = startInfo;
|
||||
process.Start();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -48,7 +48,7 @@ namespace WeeXnes.Views.Settings
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Console.WriteLine(ex.ToString());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<Version>4.0.9</Version>
|
||||
<Version>4.7</Version>
|
||||
<ProjectGuid>{4B33CEE7-C74D-43B9-B99A-8B273D5195BC}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>WeeXnes</RootNamespace>
|
||||
|
@ -15,6 +15,7 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<ApplicationIcon>wicns.ico</ApplicationIcon>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
@ -25,6 +26,7 @@
|
|||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32bit>true</Prefer32bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
@ -34,13 +36,15 @@
|
|||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32bit>true</Prefer32bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DiscordRPC, Version=1.0.175.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DiscordRichPresence.1.0.175\lib\net35\DiscordRPC.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -49,6 +53,7 @@
|
|||
<Reference Include="System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Drawing.Common.6.0.0\lib\net461\System.Drawing.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xaml">
|
||||
|
@ -66,8 +71,12 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Core\Console.cs" />
|
||||
<Compile Include="Core\EncryptorLibrary.cs" />
|
||||
<Compile Include="Core\HandleLaunchArguments.cs" />
|
||||
<Compile Include="Core\LoginLib.cs" />
|
||||
<Compile Include="Core\PluginManager.cs" />
|
||||
<Compile Include="Core\RpcLogEvents.cs" />
|
||||
<Compile Include="Core\SaveSettingsHandler.cs" />
|
||||
<Compile Include="Core\WXFile.cs" />
|
||||
<Compile Include="Views\DiscordRPC\AddRPCView.xaml.cs">
|
||||
|
@ -83,6 +92,9 @@
|
|||
<Compile Include="Views\DiscordRPC\RunRPCView.xaml.cs">
|
||||
<DependentUpon>RunRPCView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\EncryptedTextEditor\TextEditorView.xaml.cs">
|
||||
<DependentUpon>TextEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Home\HomeView.xaml.cs">
|
||||
<DependentUpon>HomeView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -90,7 +102,43 @@
|
|||
<Compile Include="Views\KeyManager\KeyManagerView.xaml.cs">
|
||||
<DependentUpon>KeyManagerView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\PasswordGenerator\PasswordGenView.xaml.cs">
|
||||
<DependentUpon>PasswordGenView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\PasswordGenerator\SavePasswordView.xaml.cs">
|
||||
<DependentUpon>SavePasswordView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\PasswordGenerator\SaveToKeyManagerView.xaml.cs">
|
||||
<DependentUpon>SaveToKeyManagerView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\PluginManager\PluginManagerView.xaml.cs">
|
||||
<DependentUpon>PluginManagerView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ProfileView\InboxView.xaml.cs">
|
||||
<DependentUpon>InboxView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ProfileView\LicenseView.xaml.cs">
|
||||
<DependentUpon>LicenseView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ProfileView\LoginError.xaml.cs">
|
||||
<DependentUpon>LoginError.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ProfileView\LoginView.xaml.cs">
|
||||
<DependentUpon>LoginView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ProfileView\MessageFullView.xaml.cs">
|
||||
<DependentUpon>MessageFullView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ProfileView\ProfileView.xaml.cs">
|
||||
<DependentUpon>ProfileView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Settings\ApiResponse.cs" />
|
||||
<Compile Include="Views\Settings\ChangePathsView.xaml.cs">
|
||||
<DependentUpon>ChangePathsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Settings\FluentMessageBox.xaml.cs">
|
||||
<DependentUpon>FluentMessageBox.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Settings\SettingsView.xaml.cs">
|
||||
<DependentUpon>SettingsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -117,8 +165,21 @@
|
|||
<Page Include="Views\DiscordRPC\DiscordRPCView.xaml" />
|
||||
<Page Include="Views\DiscordRPC\EditRPCView.xaml" />
|
||||
<Page Include="Views\DiscordRPC\RunRPCView.xaml" />
|
||||
<Page Include="Views\EncryptedTextEditor\TextEditorView.xaml" />
|
||||
<Page Include="Views\Home\HomeView.xaml" />
|
||||
<Page Include="Views\KeyManager\KeyManagerView.xaml" />
|
||||
<Page Include="Views\PasswordGenerator\PasswordGenView.xaml" />
|
||||
<Page Include="Views\PasswordGenerator\SavePasswordView.xaml" />
|
||||
<Page Include="Views\PasswordGenerator\SaveToKeyManagerView.xaml" />
|
||||
<Page Include="Views\PluginManager\PluginManagerView.xaml" />
|
||||
<Page Include="Views\ProfileView\InboxView.xaml" />
|
||||
<Page Include="Views\ProfileView\LicenseView.xaml" />
|
||||
<Page Include="Views\ProfileView\LoginError.xaml" />
|
||||
<Page Include="Views\ProfileView\LoginView.xaml" />
|
||||
<Page Include="Views\ProfileView\MessageFullView.xaml" />
|
||||
<Page Include="Views\ProfileView\ProfileView.xaml" />
|
||||
<Page Include="Views\Settings\ChangePathsView.xaml" />
|
||||
<Page Include="Views\Settings\FluentMessageBox.xaml" />
|
||||
<Page Include="Views\Settings\SettingsView.xaml" />
|
||||
<Page Include="Views\Settings\UpdateFoundView.xaml" />
|
||||
</ItemGroup>
|
||||
|
@ -144,5 +205,11 @@
|
|||
<Content Include="wicns.ico" />
|
||||
<Resource Include="Images\wicon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WXPlugin\WXPlugin.csproj">
|
||||
<Project>{56bfe4e0-0d30-474a-b57b-cf08515ff66e}</Project>
|
||||
<Name>WXPlugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="DiscordRichPresence" version="1.0.175" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.2" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net48" />
|
||||
<package id="System.Drawing.Common" version="6.0.0" targetFramework="net48" />
|
||||
<package id="WPF-UI" version="2.0.3" targetFramework="net48" />
|
||||
</packages>
|
|
@ -13,6 +13,7 @@
|
|||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
|
Loading…
Add table
Reference in a new issue