diff --git a/.gitignore b/.gitignore
index b61ddc5..9491a2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,363 @@
-################################################################################
-# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
-################################################################################
-
-/Fastedit/AppPackages
-/Fastedit/BundleArtifacts
-/Fastedit/obj/x64/Release
-*.xml
-/.vs/Fastedit
-/Fastedit/Fastedit.csproj.user
-/TabGroups.txt
-/Fastedit/bin/x64/Release
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Oo]ut/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
\ No newline at end of file
diff --git a/Fastedit.sln b/Fastedit.sln
index 8d9d785..7f4ef86 100644
--- a/Fastedit.sln
+++ b/Fastedit.sln
@@ -1,9 +1,9 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
-VisualStudioVersion = 17.0.32014.148
+VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fastedit", "Fastedit\Fastedit.csproj", "{EFBC8478-DC04-4052-9C14-B98673911134}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fastedit", "Fastedit\Fastedit.csproj", "{14A97288-EEEA-4786-8D35-704B6244C05A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -17,35 +17,35 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|ARM.ActiveCfg = Debug|ARM
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|ARM.Build.0 = Debug|ARM
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|ARM.Deploy.0 = Debug|ARM
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|ARM64.Build.0 = Debug|ARM64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|ARM64.Deploy.0 = Debug|ARM64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|x64.ActiveCfg = Debug|x64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|x64.Build.0 = Debug|x64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|x64.Deploy.0 = Debug|x64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|x86.ActiveCfg = Debug|x86
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|x86.Build.0 = Debug|x86
- {EFBC8478-DC04-4052-9C14-B98673911134}.Debug|x86.Deploy.0 = Debug|x86
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|ARM.ActiveCfg = Release|ARM
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|ARM.Build.0 = Release|ARM
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|ARM.Deploy.0 = Release|ARM
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|ARM64.ActiveCfg = Release|ARM64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|ARM64.Build.0 = Release|ARM64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|ARM64.Deploy.0 = Release|ARM64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|x64.ActiveCfg = Release|x64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|x64.Build.0 = Release|x64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|x64.Deploy.0 = Release|x64
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|x86.ActiveCfg = Release|x86
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|x86.Build.0 = Release|x86
- {EFBC8478-DC04-4052-9C14-B98673911134}.Release|x86.Deploy.0 = Release|x86
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|ARM.ActiveCfg = Debug|ARM
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|ARM.Build.0 = Debug|ARM
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|ARM.Deploy.0 = Debug|ARM
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|ARM64.Build.0 = Debug|ARM64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|x64.ActiveCfg = Debug|x64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|x64.Build.0 = Debug|x64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|x64.Deploy.0 = Debug|x64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|x86.ActiveCfg = Debug|x86
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|x86.Build.0 = Debug|x86
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Debug|x86.Deploy.0 = Debug|x86
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|ARM.ActiveCfg = Release|ARM
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|ARM.Build.0 = Release|ARM
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|ARM.Deploy.0 = Release|ARM
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|ARM64.ActiveCfg = Release|ARM64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|ARM64.Build.0 = Release|ARM64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|ARM64.Deploy.0 = Release|ARM64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|x64.ActiveCfg = Release|x64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|x64.Build.0 = Release|x64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|x64.Deploy.0 = Release|x64
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|x86.ActiveCfg = Release|x86
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|x86.Build.0 = Release|x86
+ {14A97288-EEEA-4786-8D35-704B6244C05A}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {AE7B0B6B-D9CC-473E-97A2-C60BC5F2A8C8}
+ SolutionGuid = {F36371CE-391D-4E29-8968-2668811F1D78}
EndGlobalSection
EndGlobal
diff --git a/Fastedit/App.xaml b/Fastedit/App.xaml
index 0f5adc9..16c3b94 100644
--- a/Fastedit/App.xaml
+++ b/Fastedit/App.xaml
@@ -2,14 +2,260 @@
x:Class="Fastedit.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:muxc="using:Microsoft.UI.Xaml.Controls">
+ xmlns:local="using:Fastedit"
+ xmlns:controls="using:Microsoft.UI.Xaml.Controls">
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
diff --git a/Fastedit/App.xaml.cs b/Fastedit/App.xaml.cs
index 3964a4c..32ec959 100644
--- a/Fastedit/App.xaml.cs
+++ b/Fastedit/App.xaml.cs
@@ -1,31 +1,28 @@
-using Fastedit.Core.Tab;
-using System;
+using System;
using Windows.ApplicationModel.Activation;
-using Windows.UI.Popups;
-using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace Fastedit
{
+ ///
+ /// Provides application-specific behavior to supplement the default Application class.
+ ///
sealed partial class App : Application
{
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
public App()
{
this.InitializeComponent();
-
+ this.Suspending += OnSuspending;
SetSystemGroupAsync();
- Suspending += App_Suspending;
- //this.UnhandledException += (sender, e) =>
- //{
- // e.Handled = true;
- // System.Diagnostics.Debug.WriteLine(e.Exception);
- //};
}
- public int MainViewId = -1;
-
+ //Enable recent files in the taskbar rightclick menu
private async void SetSystemGroupAsync()
{
var jumpList = await Windows.UI.StartScreen.JumpList.LoadCurrentAsync();
@@ -44,52 +41,25 @@ private Frame CreateRootFrame()
rootFrame.NavigationFailed += OnNavigationFailed;
// Place the frame in the current Window
Window.Current.Content = rootFrame;
- MainViewId = ApplicationView.GetForCurrentView().Id;
}
return rootFrame;
}
- private void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
- {
- var deferral = e.SuspendingOperation.GetDeferral();
- deferral.Complete();
- }
-
protected override void OnActivated(IActivatedEventArgs args)
{
- Frame rootFrame = CreateRootFrame();
-
- if (args.Kind == ActivationKind.CommandLineLaunch)
- {
- if (args is CommandLineActivatedEventArgs commandLine)
- {
- rootFrame.Navigate(typeof(MainPage), new CommandLineLaunchNavigationParameter
- {
- Arguments = commandLine.Operation.Arguments,
- CurrentDirectoryPath = commandLine.Operation.CurrentDirectoryPath
- });
- }
- else
- {
- rootFrame.Navigate(typeof(MainPage));
- }
- }
-
+ CreateRootFrame().Navigate(typeof(MainPage), args);
Window.Current.Activate();
}
+
protected override void OnFileActivated(FileActivatedEventArgs args)
{
- Frame rootFrame = CreateRootFrame();
-
- rootFrame.Navigate(typeof(MainPage), args);
+ CreateRootFrame().Navigate(typeof(MainPage), args);
Window.Current.Activate();
base.OnFileActivated(args);
}
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
- AppSettings appsettings = new AppSettings();
- Frame rootFrame = CreateRootFrame();
- rootFrame.Navigate(typeof(MainPage));
+ CreateRootFrame().Navigate(typeof(MainPage));
Window.Current.Activate();
}
@@ -97,5 +67,10 @@ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
+ private void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
+ {
+ var deferral = e.SuspendingOperation.GetDeferral();
+ deferral.Complete();
+ }
}
}
diff --git a/Fastedit/Assets/App_Icon/App_Icon.svg b/Fastedit/Assets/AppIcon/App_Icon.svg
similarity index 100%
rename from Fastedit/Assets/App_Icon/App_Icon.svg
rename to Fastedit/Assets/AppIcon/App_Icon.svg
diff --git a/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-100.png b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-100.png
new file mode 100644
index 0000000..b4783d3
Binary files /dev/null and b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-100.png differ
diff --git a/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-125.png b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-125.png
new file mode 100644
index 0000000..85ca11e
Binary files /dev/null and b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-125.png differ
diff --git a/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-150.png b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-150.png
new file mode 100644
index 0000000..81b62fa
Binary files /dev/null and b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-150.png differ
diff --git a/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-200.png b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-200.png
new file mode 100644
index 0000000..cb71889
Binary files /dev/null and b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-200.png differ
diff --git a/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-400.png b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-400.png
new file mode 100644
index 0000000..b05e613
Binary files /dev/null and b/Fastedit/Assets/AppIcon/Generated/BadgeLogo.scale-400.png differ
diff --git a/Fastedit/Assets/App_Icon/Generated/LargeTile.scale-100.png b/Fastedit/Assets/AppIcon/Generated/LargeTile.scale-100.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/LargeTile.scale-100.png
rename to Fastedit/Assets/AppIcon/Generated/LargeTile.scale-100.png
diff --git a/Fastedit/Assets/App_Icon/Generated/LargeTile.scale-125.png b/Fastedit/Assets/AppIcon/Generated/LargeTile.scale-125.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/LargeTile.scale-125.png
rename to Fastedit/Assets/AppIcon/Generated/LargeTile.scale-125.png
diff --git a/Fastedit/Assets/App_Icon/Generated/LargeTile.scale-150.png b/Fastedit/Assets/AppIcon/Generated/LargeTile.scale-150.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/LargeTile.scale-150.png
rename to Fastedit/Assets/AppIcon/Generated/LargeTile.scale-150.png
diff --git a/Fastedit/Assets/App_Icon/Generated/LargeTile.scale-200.png b/Fastedit/Assets/AppIcon/Generated/LargeTile.scale-200.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/LargeTile.scale-200.png
rename to Fastedit/Assets/AppIcon/Generated/LargeTile.scale-200.png
diff --git a/Fastedit/Assets/App_Icon/Generated/LargeTile.scale-400.png b/Fastedit/Assets/AppIcon/Generated/LargeTile.scale-400.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/LargeTile.scale-400.png
rename to Fastedit/Assets/AppIcon/Generated/LargeTile.scale-400.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SmallTile.scale-100.png b/Fastedit/Assets/AppIcon/Generated/SmallTile.scale-100.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SmallTile.scale-100.png
rename to Fastedit/Assets/AppIcon/Generated/SmallTile.scale-100.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SmallTile.scale-125.png b/Fastedit/Assets/AppIcon/Generated/SmallTile.scale-125.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SmallTile.scale-125.png
rename to Fastedit/Assets/AppIcon/Generated/SmallTile.scale-125.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SmallTile.scale-150.png b/Fastedit/Assets/AppIcon/Generated/SmallTile.scale-150.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SmallTile.scale-150.png
rename to Fastedit/Assets/AppIcon/Generated/SmallTile.scale-150.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SmallTile.scale-200.png b/Fastedit/Assets/AppIcon/Generated/SmallTile.scale-200.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SmallTile.scale-200.png
rename to Fastedit/Assets/AppIcon/Generated/SmallTile.scale-200.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SmallTile.scale-400.png b/Fastedit/Assets/AppIcon/Generated/SmallTile.scale-400.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SmallTile.scale-400.png
rename to Fastedit/Assets/AppIcon/Generated/SmallTile.scale-400.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-100.png b/Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-100.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-100.png
rename to Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-100.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-125.png b/Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-125.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-125.png
rename to Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-125.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-150.png b/Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-150.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-150.png
rename to Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-150.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-200.png b/Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-200.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-200.png
rename to Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-200.png
diff --git a/Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-400.png b/Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-400.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/SplashScreen.scale-400.png
rename to Fastedit/Assets/AppIcon/Generated/SplashScreen.scale-400.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-100.png b/Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-100.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-100.png
rename to Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-100.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-125.png b/Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-125.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-125.png
rename to Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-125.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-150.png b/Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-150.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-150.png
rename to Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-150.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-200.png b/Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-200.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-200.png
rename to Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-200.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-400.png b/Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-400.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square150x150Logo.scale-400.png
rename to Fastedit/Assets/AppIcon/Generated/Square150x150Logo.scale-400.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-16.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-16.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-16.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-16.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-24.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-24.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-24.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-24.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-256.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-256.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-256.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-256.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-32.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-32.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-32.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-32.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-48.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-48.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-lightunplated_targetsize-48.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-lightunplated_targetsize-48.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-16.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-16.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-16.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-16.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-24.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-24.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-24.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-24.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-256.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-256.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-256.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-256.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-32.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-32.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-32.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-32.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-48.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-48.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.altform-unplated_targetsize-48.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.altform-unplated_targetsize-48.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-100.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-100.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-100.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-100.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-125.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-125.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-125.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-125.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-150.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-150.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-150.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-150.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-200.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-200.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-200.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-200.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-400.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-400.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.scale-400.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.scale-400.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-16.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-16.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-16.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-16.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-24.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-24.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-24.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-24.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-256.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-256.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-256.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-256.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-32.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-32.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-32.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-32.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-48.png b/Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-48.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Square44x44Logo.targetsize-48.png
rename to Fastedit/Assets/AppIcon/Generated/Square44x44Logo.targetsize-48.png
diff --git a/Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-100.png b/Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-100.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-100.png
rename to Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-100.png
diff --git a/Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-125.png b/Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-125.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-125.png
rename to Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-125.png
diff --git a/Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-150.png b/Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-150.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-150.png
rename to Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-150.png
diff --git a/Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-200.png b/Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-200.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-200.png
rename to Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-200.png
diff --git a/Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-400.png b/Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-400.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/StoreLogo.scale-400.png
rename to Fastedit/Assets/AppIcon/Generated/StoreLogo.scale-400.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-100.png b/Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-100.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-100.png
rename to Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-100.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-125.png b/Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-125.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-125.png
rename to Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-125.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-150.png b/Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-150.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-150.png
rename to Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-150.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-200.png b/Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-200.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-200.png
rename to Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-200.png
diff --git a/Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-400.png b/Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-400.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Generated/Wide310x150Logo.scale-400.png
rename to Fastedit/Assets/AppIcon/Generated/Wide310x150Logo.scale-400.png
diff --git a/Fastedit/Assets/App_Icon/Icon.png b/Fastedit/Assets/AppIcon/Icon.png
similarity index 100%
rename from Fastedit/Assets/App_Icon/Icon.png
rename to Fastedit/Assets/AppIcon/Icon.png
diff --git a/Fastedit/Assets/Designs/Acrylic-Blue.fasteditdesign b/Fastedit/Assets/Designs/Acrylic-Blue.fasteditdesign
deleted file mode 100644
index 6dac12b..0000000
--- a/Fastedit/Assets/Designs/Acrylic-Blue.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=0
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FF004BFF
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FF004BFF
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FF004BFF
-AppBackgroundColorIndex=2
-AppBackgroundColor=#66002580
-TitleBarBackgroundColor=#330031A6
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#FF0031A6
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE001A59
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FF004BFF
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=False
-AcrylicEnabled=True
-LineHighlighterBackground=#00000000
-LineHighlighterForeground=#FF0035B3
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Acrylic-Dark.fasteditdesign b/Fastedit/Assets/Designs/Acrylic-Dark.fasteditdesign
deleted file mode 100644
index 3ff8939..0000000
--- a/Fastedit/Assets/Designs/Acrylic-Dark.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=2
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FFFFFFFF
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FFC4C4C4
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FFFFFFFF
-AppBackgroundColorIndex=2
-AppBackgroundColor=#401A1A1A
-TitleBarBackgroundColor=#4D3B3B3B
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#CC1A1A1A
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE262626
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FFFFFFFF
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=False
-AcrylicEnabled=True
-LineHighlighterBackground=#26999999
-LineHighlighterForeground=#80D9D9D9
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Acrylic-Gray.fasteditdesign b/Fastedit/Assets/Designs/Acrylic-Gray.fasteditdesign
deleted file mode 100644
index 65b82a3..0000000
--- a/Fastedit/Assets/Designs/Acrylic-Gray.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=2
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FFFFFFFF
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FFC4C4C4
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FFFFFFFF
-AppBackgroundColorIndex=2
-AppBackgroundColor=#404D4D4D
-TitleBarBackgroundColor=#4D3B3B3B
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#471A1A1A
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE262626
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FFFFFFFF
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=False
-AcrylicEnabled=True
-LineHighlighterBackground=#26999999
-LineHighlighterForeground=#80D9D9D9
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Acrylic-Green.fasteditdesign b/Fastedit/Assets/Designs/Acrylic-Green.fasteditdesign
deleted file mode 100644
index 2992037..0000000
--- a/Fastedit/Assets/Designs/Acrylic-Green.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=0
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FF00FF07
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FF00B305
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FF00FF07
-AppBackgroundColorIndex=2
-AppBackgroundColor=#66008003
-TitleBarBackgroundColor=#33008003
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#FF00A605
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE005402
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FF00FF07
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=False
-AcrylicEnabled=True
-LineHighlighterBackground=#00000000
-LineHighlighterForeground=#FF00B305
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Acrylic-Red.fasteditdesign b/Fastedit/Assets/Designs/Acrylic-Red.fasteditdesign
deleted file mode 100644
index 392857c..0000000
--- a/Fastedit/Assets/Designs/Acrylic-Red.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=0
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FFFF3C00
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FF992400
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FFFF3C00
-AppBackgroundColorIndex=2
-AppBackgroundColor=#66FF0000
-TitleBarBackgroundColor=#4DFF0000
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#FFFF0000
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE800105
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FFFF3C00
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=False
-AcrylicEnabled=True
-LineHighlighterBackground=#00000000
-LineHighlighterForeground=#FFFF3C00
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Mica-Accentcolor.fasteditdesign b/Fastedit/Assets/Designs/Mica-Accentcolor.fasteditdesign
deleted file mode 100644
index 1ea3038..0000000
--- a/Fastedit/Assets/Designs/Mica-Accentcolor.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=0
-TextSelectionColorIndex=0
-TextColorIndex=0
-TextBackgroundColorIndex=1
-TextColor=1
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=4
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=0
-LineNumberForegroundColor=1
-AppBackgroundColorIndex=2
-AppBackgroundColor=#FF0078D4
-TitleBarBackgroundColor=2
-TitleBarBackgroundColorIndex=0
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=0
-TabColorFocused=2
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE474747
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=0
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=2
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=True
-AcrylicEnabled=False
-LineHighlighterBackground=#00000000
-LineHighlighterForeground=4
-LineHighlighterForegroundIndex=0
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Mica-BlackWhite.fasteditdesign b/Fastedit/Assets/Designs/Mica-BlackWhite.fasteditdesign
deleted file mode 100644
index 1d2222a..0000000
--- a/Fastedit/Assets/Designs/Mica-BlackWhite.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=2
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FFFFFFFF
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FFC4C4C4
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FFFFFFFF
-AppBackgroundColorIndex=2
-AppBackgroundColor=#00000000
-TitleBarBackgroundColor=#AB3B3B3B
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#A64D4D4D
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE262626
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FFFFFFFF
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=True
-AcrylicEnabled=False
-LineHighlighterBackground=#26999999
-LineHighlighterForeground=#80D9D9D9
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Mica-Blue.fasteditdesign b/Fastedit/Assets/Designs/Mica-Blue.fasteditdesign
deleted file mode 100644
index 7449c4b..0000000
--- a/Fastedit/Assets/Designs/Mica-Blue.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=0
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FF004BFF
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FF004BFF
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FF004BFF
-AppBackgroundColorIndex=2
-AppBackgroundColor=#FF002580
-TitleBarBackgroundColor=#FF0031A6
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#FF0031A6
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE001A59
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FF004BFF
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=True
-AcrylicEnabled=False
-LineHighlighterBackground=#00000000
-LineHighlighterForeground=#FF0035B3
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Mica-Green.fasteditdesign b/Fastedit/Assets/Designs/Mica-Green.fasteditdesign
deleted file mode 100644
index 432bdf7..0000000
--- a/Fastedit/Assets/Designs/Mica-Green.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=0
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FF00FF07
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FF00B305
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FF00FF07
-AppBackgroundColorIndex=2
-AppBackgroundColor=#FF008003
-TitleBarBackgroundColor=#FF008003
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#FF00A605
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE005402
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FF00FF07
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=True
-AcrylicEnabled=False
-LineHighlighterBackground=#00000000
-LineHighlighterForeground=#FF00B305
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Mica-Purple.fasteditdesign b/Fastedit/Assets/Designs/Mica-Purple.fasteditdesign
deleted file mode 100644
index b943397..0000000
--- a/Fastedit/Assets/Designs/Mica-Purple.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=0
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FFFF00FF
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FFFF00FF
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FFFF00FF
-AppBackgroundColorIndex=2
-AppBackgroundColor=#FF8D00FF
-TitleBarBackgroundColor=#FF8D00FF
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#FF8D00FF
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE474747
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FFFF00FF
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=True
-AcrylicEnabled=False
-LineHighlighterBackground=#00000000
-LineHighlighterForeground=#FF8D00FF
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Mica-Red.fasteditdesign b/Fastedit/Assets/Designs/Mica-Red.fasteditdesign
deleted file mode 100644
index 8c549b3..0000000
--- a/Fastedit/Assets/Designs/Mica-Red.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=0
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FFFF3C00
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FF992400
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FFFF3C00
-AppBackgroundColorIndex=2
-AppBackgroundColor=#66FF0000
-TitleBarBackgroundColor=#4DFF0000
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#FFFF0000
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE800105
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FFFF3C00
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=True
-AcrylicEnabled=False
-LineHighlighterBackground=#00000000
-LineHighlighterForeground=#FFFF3C00
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/Designs/Mica-WhiteBlack.fasteditdesign b/Fastedit/Assets/Designs/Mica-WhiteBlack.fasteditdesign
deleted file mode 100644
index 502fc37..0000000
--- a/Fastedit/Assets/Designs/Mica-WhiteBlack.fasteditdesign
+++ /dev/null
@@ -1,31 +0,0 @@
-ThemeIndex=1
-TextSelectionColorIndex=2
-TextColorIndex=2
-TextBackgroundColorIndex=1
-TextColor=#FF000000
-TextBackgroundColor=#00FFFFFF
-TextSelectionColor=#FF808080
-LineNumberBackgroundColorIndex=1
-LineNumberBackgroundColor=#00FFFFFF
-LineNumberForegroundColorIndex=2
-LineNumberForegroundColor=#FF000000
-AppBackgroundColorIndex=2
-AppBackgroundColor=#FFFFFFFF
-TitleBarBackgroundColor=#00C2C2C2
-TitleBarBackgroundColorIndex=2
-TabColorNotFocusedIndex=1
-TabColorFocusedIndex=2
-TabColorFocused=#99D4D4D4
-TabColorNotFocused=#00FFFFFF
-DialogBackgroundColor=#EE474747
-DialogBackgroundColorIndex=2
-StatusbarForegroundColorIndex=2
-StatusbarBackgroundColorIndex=1
-StatusbarForegroundColor=#FF000000
-StatusbarBackgroundColor=#00FFFFFF
-UseMica=True
-AcrylicEnabled=False
-LineHighlighterBackground=#33999999
-LineHighlighterForeground=#80BFBFBF
-LineHighlighterForegroundIndex=2
-LineHighlighterBackgroundIndex=2
diff --git a/Fastedit/Assets/SocialIcons/GitHub-Mark-120px-plus.png b/Fastedit/Assets/SocialIcons/GitHub-Mark-120px-plus.png
deleted file mode 100644
index ea6ff54..0000000
Binary files a/Fastedit/Assets/SocialIcons/GitHub-Mark-120px-plus.png and /dev/null differ
diff --git a/Fastedit/Assets/SocialIcons/GitHub-Mark-Light-120px-plus.png b/Fastedit/Assets/SocialIcons/GitHub-Mark-Light-120px-plus.png
deleted file mode 100644
index 192846a..0000000
Binary files a/Fastedit/Assets/SocialIcons/GitHub-Mark-Light-120px-plus.png and /dev/null differ
diff --git a/Fastedit/Assets/SocialIcons/Instagram_Glyph_Gradient_RGB.png b/Fastedit/Assets/SocialIcons/Instagram_Glyph_Gradient_RGB.png
deleted file mode 100644
index ca40657..0000000
Binary files a/Fastedit/Assets/SocialIcons/Instagram_Glyph_Gradient_RGB.png and /dev/null differ
diff --git a/Fastedit/Assets/news.txt b/Fastedit/Assets/changelog.txt
similarity index 87%
rename from Fastedit/Assets/news.txt
rename to Fastedit/Assets/changelog.txt
index 14eb730..27e78c2 100644
--- a/Fastedit/Assets/news.txt
+++ b/Fastedit/Assets/changelog.txt
@@ -1,4 +1,22 @@
-Fastedit Changelog:
+Fastedit Changelog:
+
+-------------------------------------------------------
+Version 2.0.0 [01/17/2023]
+ • rebuilt the app from the ground up
+ • faster and way more stable database
+ • syntaxhighlighting
+ • new textbox with a lot more features
+ • textlimit is now 100 million characters
+ • new designs
+ • faster startup time
+ • cleaned up settings page
+ • many more small improvements and overall a more stable experience
+
+ Known issues:
+ • search sometimes has some weird behaviour
+ • replace not implemented yet
+ • Close all not implemented
+
-------------------------------------------------------
Version 1.6.2 [05/20/2022]
@@ -12,8 +30,8 @@ Version 1.5.2 [05/06/2022]
• Added a compact overlay mode for secondary instance
• Improved startup performance mostly for a larger amount of tabs
• Designchange now changes the design of all instances
- • Fixed a bug, where the line under your cursor got copied if nothing selected
- • Fixed a bug, where you could not open a file using the Windows-rightlickmenu,
+ • Fixed a bug, where the line under your cursor got copied if nothig selected
+ • Fixed a bug, where you could not open a file using the Windows-rignhtlickmenu,
if the app was already running
-------------------------------------------------------
@@ -105,4 +123,4 @@ Version 1.0.1 - 02/09/2022
because it caused too many crashes -> I will add this in the future
-------------------------------------------------------
-Version 1.0.0 - 01/24/2022
+Version 1.0.0 - 01/24/2022
\ No newline at end of file
diff --git a/Fastedit/Controls/ColorChooserButton.xaml b/Fastedit/Controls/ColorChooserButton.xaml
deleted file mode 100644
index bb0c9c3..0000000
--- a/Fastedit/Controls/ColorChooserButton.xaml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Fastedit/Controls/ColorChooserButton.xaml.cs b/Fastedit/Controls/ColorChooserButton.xaml.cs
deleted file mode 100644
index 98822c6..0000000
--- a/Fastedit/Controls/ColorChooserButton.xaml.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using Windows.UI;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Media;
-
-namespace Fastedit.Controls
-{
- public sealed partial class ColorChooserButton : UserControl
- {
- public bool IsUsedAsDisplay { get; set; }
- private bool _IsCompact;
- public bool IsCompact
- {
- get => _IsCompact;
- set
- {
- if (value)
- {
- Colordisplay.Height = 20;
- }
- else
- {
- Colordisplay.Height = 30;
- }
- _IsCompact = value;
- }
- }
- private readonly AppSettings appsettings = new AppSettings();
- private readonly Color buttonbordercolor = Colors.Black;
-
- public ColorChooserButton()
- {
- this.InitializeComponent();
-
- buttonbordercolor = appsettings.CurrentApplicationTheme == ElementTheme.Light ? Colors.Black : Colors.White;
-
- Colordisplay.BorderBrush = new SolidColorBrush(buttonbordercolor);
- }
-
- public delegate void ColorChanged(ColorPicker sender);
- public event ColorChanged ColorChangedEvent;
-
- public bool IsAlphaEnabled
- {
- set
- {
- ColorPickerFlyout.IsAlphaEnabled = value;
- }
- }
- public Color Color
- {
- get { return ColorPickerFlyout.Color; }
- set { ColorPickerFlyout.Color = value; }
- }
-
- private void Rectangle_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
- {
- if (!IsUsedAsDisplay)
- {
- flyout.ShowAt(Colordisplay);
- }
- }
-
- private void ColorPickerFlyout_ColorChanged_1(ColorPicker sender, ColorChangedEventArgs args)
- {
-
- }
-
- private void flyout_Closed(object sender, object e)
- {
- if (!IsUsedAsDisplay)
- {
- ColorChangedEvent?.Invoke(ColorPickerFlyout);
- }
- }
- }
-}
diff --git a/Fastedit/Controls/CustomizationControl.xaml b/Fastedit/Controls/CustomizationControl.xaml
deleted file mode 100644
index c5e3ee8..0000000
--- a/Fastedit/Controls/CustomizationControl.xaml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Fastedit/Controls/CustomizationControl.xaml.cs b/Fastedit/Controls/CustomizationControl.xaml.cs
deleted file mode 100644
index 2b8e012..0000000
--- a/Fastedit/Controls/CustomizationControl.xaml.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using Fastedit.Core;
-using Fastedit.Extensions;
-using Fastedit.Views.SettingsPage;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.UI;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
-
-namespace Fastedit.Controls
-{
- public sealed partial class CustomizationControl : UserControl
- {
- private AppSettings appsettings = new AppSettings();
-
- public bool IsAlphaEnabled { set => ColorPickerButton.IsAlphaEnabled = value; }
- public string Header { get; set; } = "";
- public Visibility TransparentComboboxItem
- {
- get => Cb_Item_Transparent.Visibility;
- set => Cb_Item_Transparent.Visibility = value;
- }
- public string ResourceKey { get; set; } = "";
- public AccentColors Accentcolor { get; set; } = AccentColors.Default;
- public bool SaveChangesToSettings { get; set; } = true;
-
- public event ColorChanged ColorChangedEvent;
- public delegate void ColorChanged();
-
- public CustomizationControl()
- {
- this.InitializeComponent();
- }
-
- public void RetrieveFromSettings()
- {
- ColorPickerButton.Color = appsettings.GetSettingsAsColorWithDefault(ResourceKey, DefaultValues.SystemAccentColor);
- combobox.SelectedIndex = appsettings.GetSettingsAsInt(ResourceKey + "Index", 0);
- }
-
- private void ColorPickerButton_ColorChangedEvent(ColorPicker sender)
- {
- appsettings.SaveSettings(ResourceKey, sender.Color);
- ColorChangedEvent?.Invoke();
- }
-
- private void combobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- ColorPickerButton.IsUsedAsDisplay = true;
- if (TransparentComboboxItem == Visibility.Visible)
- {
- PageSettings.SaveCustomAccentTransparentColorToSettings(
- ResourceKey, Accentcolor, Colors.Transparent,
- combobox, ColorPickerButton, SaveChangesToSettings
- );
- }
- else
- {
- PageSettings.SaveCustomAndAccentColorToSettings(
- ResourceKey, Accentcolor, Colors.Transparent,
- combobox, ColorPickerButton, SaveChangesToSettings
- );
- }
- ColorChangedEvent?.Invoke();
- appsettings.SaveSettings(ResourceKey + "Index", combobox.SelectedIndex);
- }
- }
-}
diff --git a/Fastedit/Controls/InfobarMessage.cs b/Fastedit/Controls/InfobarMessage.cs
new file mode 100644
index 0000000..3e7eb4c
--- /dev/null
+++ b/Fastedit/Controls/InfobarMessage.cs
@@ -0,0 +1,40 @@
+using Fastedit.Dialogs;
+using Microsoft.UI.Xaml.Controls;
+using System;
+using Windows.UI.Xaml;
+
+namespace Fastedit.Controls
+{
+ public class InfobarMessage : InfoBar
+ {
+ public InfobarMessage(string title, string message, InfoBarSeverity severity, int showSeconds = 5)
+ {
+ Show(title, message, null, severity, showSeconds);
+ }
+ public InfobarMessage(string title, string message, UIElement content, InfoBarSeverity severity, int showSeconds = 5)
+ {
+ Show(title, message, content, severity, showSeconds);
+ }
+
+ private void Show(string title, string message, UIElement content, InfoBarSeverity severity, int showSeconds = 5)
+ {
+ this.Title = title;
+ this.Message = message;
+ this.Content = content;
+ this.Severity = severity;
+ this.IsOpen = true;
+ //this.Background = DialogHelper.ContentDialogBackground();
+ //this.Foreground = DialogHelper.ContentDialogForeground();
+ this.RequestedTheme = DialogHelper.DialogDesign;
+
+ DispatcherTimer autoCloseTimer = new DispatcherTimer();
+ autoCloseTimer.Interval = new TimeSpan(0, 0, showSeconds);
+ autoCloseTimer.Start();
+ autoCloseTimer.Tick += delegate
+ {
+ this.IsOpen = false;
+ autoCloseTimer.Stop();
+ };
+ }
+ }
+}
diff --git a/Fastedit/Controls/RunCommandWindow.xaml b/Fastedit/Controls/RunCommandWindow.xaml
new file mode 100644
index 0000000..7a92baf
--- /dev/null
+++ b/Fastedit/Controls/RunCommandWindow.xaml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Fastedit/Controls/RunCommandWindow.xaml.cs b/Fastedit/Controls/RunCommandWindow.xaml.cs
new file mode 100644
index 0000000..083fce3
--- /dev/null
+++ b/Fastedit/Controls/RunCommandWindow.xaml.cs
@@ -0,0 +1,206 @@
+using Fastedit.Tab;
+using Microsoft.UI.Xaml.Controls;
+using System.Collections.Generic;
+using System.Linq;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Input;
+
+namespace Fastedit.Controls
+{
+ public sealed partial class RunCommandWindow : UserControl
+ {
+ List CurrentTabPages = new List();
+ RunCommandWindowSubItem currentPage = null;
+
+ public RunCommandWindow()
+ {
+ this.InitializeComponent();
+ }
+
+ public void Toggle(TabView tabView)
+ {
+ if (this.Visibility == Visibility.Visible)
+ Hide();
+ else
+ Show(tabView);
+ }
+ public void Show(TabView tabView)
+ {
+ //Add the current tabpages:
+ AddCurrentTabPages(tabView);
+ Items.AddRange(CurrentTabPages);
+
+ if (itemHostListView == null)
+ {
+ itemHostListView = FindName("itemHostListView") as ListView;
+ }
+
+ searchbox.Text = "";
+ this.Visibility = Visibility.Visible;
+ showControlAnimation.Begin();
+ searchbox.Focus(FocusState.Programmatic);
+ }
+ public void Hide()
+ {
+ //Remove all tabs
+ Items.RemoveAll(x => x.Tag is TabPageItem);
+
+ currentPage = null;
+ hideControlAnimation.Begin();
+ }
+ public List Items { get; set; } = new List();
+
+ private void AddCurrentTabPages(TabView tabView)
+ {
+ //remove when there are too many
+ if (CurrentTabPages.Count > tabView.TabItems.Count)
+ {
+ CurrentTabPages.RemoveRange(0, CurrentTabPages.Count - tabView.TabItems.Count);
+ }
+
+ //overwrite or add new ones:
+ for (int i = 0; i < tabView.TabItems.Count; i++)
+ {
+ if (tabView.TabItems[i] is TabPageItem tab)
+ {
+ if (i < CurrentTabPages.Count)
+ {
+ CurrentTabPages[i].Command = tab.DatabaseItem.FileName;
+ CurrentTabPages[i].Tag = tab;
+ CurrentTabPages[i].Shortcut = "Open document";
+ }
+ else
+ {
+ CurrentTabPages.Add(
+ new RunCommandWindowCustomItem
+ {
+ Command = tab.DatabaseItem.FileName,
+ Tag = tab,
+ Shortcut = "Open document"
+ });
+ }
+ }
+ }
+ }
+ private void searchbox_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (currentPage != null)
+ {
+ var source = currentPage.Items.Where(x => x.Command.ToLower().Contains(searchbox.Text.ToLower()));
+ itemHostListView.ItemsSource = source.OrderBy(x => x.Command);
+ return;
+ }
+
+ var newsource = Items.Where(x => x.Command.ToLower().Contains(searchbox.Text.ToLower()));
+
+ itemHostListView.ItemsSource = newsource.OrderBy(x => x.Command);
+ itemHostListView.SelectedIndex = 0;
+ }
+ private void itemHostListView_ItemClick(object sender, ItemClickEventArgs e)
+ {
+ ItemClicked(e.ClickedItem);
+ }
+ private void ItemClicked(object clickedItem)
+ {
+ if (clickedItem is RunCommandWindowItem item)
+ {
+ item.InvokeEvent();
+ Hide();
+ }
+ else if (clickedItem is RunCommandWindowSubItem subItem)
+ {
+ //change the source -> like switching to sub page:
+ currentPage = subItem;
+ searchbox.Text = "";
+ itemHostListView.ItemsSource = subItem.Items;
+ itemHostListView.SelectedIndex = 1;
+ }
+ else if (clickedItem is RunCommandWindowCustomItem customItem)
+ {
+ //select a tabpage
+ if (customItem.Tag is TabPageItem tab)
+ {
+ TabPageHelper.mainPage.ChangeSelectedTab(tab);
+ Hide();
+ }
+ }
+ }
+ private void UserControl_KeyDown(object sender, KeyRoutedEventArgs e)
+ {
+ if (e.Key == Windows.System.VirtualKey.Escape)
+ {
+ if (currentPage != null)
+ {
+ currentPage = null;
+ searchbox.Text = "";
+ itemHostListView.ItemsSource = Items;
+ return;
+ }
+ Hide();
+ }
+ else if (e.Key == Windows.System.VirtualKey.Down)
+ {
+ if (itemHostListView.SelectedIndex < itemHostListView.Items.Count - 1)
+ {
+ itemHostListView.SelectedIndex++;
+ itemHostListView.ScrollIntoView(itemHostListView.Items[itemHostListView.SelectedIndex]);
+ }
+
+ itemHostListView.ScrollIntoView(itemHostListView.Items[itemHostListView.SelectedIndex]);
+ }
+ else if (e.Key == Windows.System.VirtualKey.Up)
+ {
+ if (itemHostListView.SelectedIndex > 0)
+ {
+ itemHostListView.SelectedIndex--;
+ itemHostListView.ScrollIntoView(itemHostListView.Items[itemHostListView.SelectedIndex]);
+ }
+
+ }
+ else if (e.Key == Windows.System.VirtualKey.Enter)
+ {
+ ItemClicked(itemHostListView.SelectedItem);
+ }
+ }
+ private void hideControlAnimation_Completed(object sender, object e)
+ {
+ this.Visibility = Visibility.Collapsed;
+ }
+ }
+ public class RunCommandWindowItem : IRunCommandWindowItem
+ {
+ public delegate void RunCommandWindowItemClickedEvent(object sender, RoutedEventArgs e);
+ public event RunCommandWindowItemClickedEvent RunCommandWindowItemClicked;
+ public void InvokeEvent()
+ {
+ RunCommandWindowItemClicked?.Invoke(this, null);
+ }
+
+ public object Tag { get; set; }
+ public string Command { get; set; }
+ public string Shortcut { get; set; }
+ }
+
+ public class RunCommandWindowSubItem : IRunCommandWindowItem
+ {
+ public List Items { get; set; } = new List();
+ public string Command { get; set; }
+ public string Shortcut { get; set; }
+ public object Tag { get; set; }
+ }
+
+ public class RunCommandWindowCustomItem : IRunCommandWindowItem
+ {
+ public string Command { get; set; }
+ public string Shortcut { get; set; }
+ public object Tag { get; set; }
+ }
+
+ public interface IRunCommandWindowItem
+ {
+ string Command { get; set; }
+ string Shortcut { get; set; }
+ object Tag { get; set; }
+ }
+}
diff --git a/Fastedit/Controls/SearchControl.xaml b/Fastedit/Controls/SearchControl.xaml
new file mode 100644
index 0000000..172e1dd
--- /dev/null
+++ b/Fastedit/Controls/SearchControl.xaml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Fastedit/Controls/SearchControl.xaml.cs b/Fastedit/Controls/SearchControl.xaml.cs
new file mode 100644
index 0000000..376ef4b
--- /dev/null
+++ b/Fastedit/Controls/SearchControl.xaml.cs
@@ -0,0 +1,255 @@
+using Fastedit.Helper;
+using Fastedit.Settings;
+using TextControlBox.Helper;
+using Windows.System;
+using Windows.UI.Core;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+
+namespace Fastedit.Controls
+{
+ public sealed partial class SearchControl : UserControl
+ {
+ private TextControlBox.TextControlBox currentTextbox = null;
+ private SearchWindowState searchWindowState = SearchWindowState.Hidden;
+
+ public SearchControl()
+ {
+ this.InitializeComponent();
+ }
+
+ private void BeginSearch(string searchword, bool matchCase, bool wholeWord)
+ {
+ if (currentTextbox == null)
+ return;
+
+ try
+ {
+ //begin the search
+ var res = currentTextbox.BeginSearch(searchword, wholeWord, matchCase);
+ ColorWindowBorder(res);
+ }
+ catch
+ {
+ //Due to bug in TextControlBox
+ }
+ }
+ private void ToggleVisibility(bool visible)
+ {
+ textToReplaceTextBox.Visibility = ReplaceAllButton.Visibility =
+ StartReplaceButton.Visibility = ConvertHelper.BoolToVisibility(visible);
+ }
+ private void ColorWindowBorder(SearchResult result)
+ {
+ SearchWindow.BorderBrush = new SolidColorBrush(result == SearchResult.Found ? DefaultValues.correctInputColor : DefaultValues.wrongInputColor);
+ }
+ private void hideWindow()
+ {
+ hideSearchAnimation.Begin();
+ searchWindowState = SearchWindowState.Hidden;
+ }
+ private void showWindow()
+ {
+ this.Visibility = Visibility.Visible;
+ showSearchAnimation.Begin();
+ searchWindowState = SearchWindowState.Default;
+ }
+ private void expandReplace()
+ {
+ expandSearchAnimation.Begin();
+ searchWindowState = SearchWindowState.Expanded;
+ }
+ private void collapseReplace()
+ {
+ collapseSearchAnimation.Begin();
+ searchWindowState = SearchWindowState.Default;
+ }
+
+ public void ShowSearch(TextControlBox.TextControlBox textbox)
+ {
+ if (textbox == null)
+ return;
+ currentTextbox = textbox;
+
+ //hide the window when in search state or show it when in hidden state or show it when hidden:
+ if (searchWindowState == SearchWindowState.Default)
+ hideWindow();
+ else if (searchWindowState == SearchWindowState.Expanded)
+ collapseReplace();
+ else
+ {
+ showWindow();
+ collapseReplace();
+ }
+
+
+ if (textbox.SelectionLength > 0 && textbox.SelectionLength < 200)
+ textToFindTextbox.Text = textbox.SelectedText;
+
+ textToFindTextbox.Focus(FocusState.Keyboard);
+ textToFindTextbox.SelectAll();
+ }
+ public void ShowReplace(TextControlBox.TextControlBox textbox)
+ {
+ if (textbox == null)
+ return;
+ currentTextbox = textbox;
+
+ //hide the window when in replace state or expand it when in search state or show it when hidden:
+ if (searchWindowState == SearchWindowState.Expanded)
+ hideWindow();
+ else if (searchWindowState == SearchWindowState.Default)
+ expandReplace();
+ else
+ {
+ showWindow();
+ expandReplace();
+ }
+
+ if (textbox.SelectionLength > 0 && textbox.SelectionLength < 200)
+ textToFindTextbox.Text = textbox.SelectedText;
+
+ textToReplaceTextBox.Focus(FocusState.Keyboard);
+ textToReplaceTextBox.SelectAll();
+ textToFindTextbox.Focus(FocusState.Keyboard);
+ textToFindTextbox.SelectAll();
+ }
+ public void Close()
+ {
+ currentTextbox.EndSearch();
+ hideWindow();
+ currentTextbox = null;
+ }
+
+ private void ReplaceTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
+ {
+ if (e.Key == VirtualKey.Enter)
+ {
+ ReplaceCurrentButton_Click(null, null);
+ }
+ }
+ private void SearchTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
+ {
+ //Search down on Enter and up on Shift + Enter//
+ var shift = Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down);
+ if (e.Key == VirtualKey.Enter)
+ {
+ if (currentTextbox == null)
+ return;
+
+ try
+ {
+ if (shift)
+ currentTextbox.FindPrevious();
+ else
+ currentTextbox.FindNext();
+ }
+ catch
+ {
+ //Due to bug in TextControlBox
+ }
+ }
+ }
+ private void SearchUpButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (currentTextbox == null)
+ return;
+
+ try
+ {
+ currentTextbox.FindPrevious();
+ }
+ catch
+ {
+ //Due to bug in TextControlBox
+ }
+ }
+ private void SearchDownButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (currentTextbox == null)
+ return;
+ try
+ {
+ currentTextbox.FindNext();
+ }
+ catch
+ {
+ //Due to bug in TextControlBox
+ }
+ }
+ private void FindMatchCaseButton_Click(object sender, RoutedEventArgs e)
+ {
+ //AppSettings.SaveSettings("FindMatchCase", FindMatchCaseButton.IsChecked);
+ }
+ private void FindWholeWordButton_Click(object sender, RoutedEventArgs e)
+ {
+ //if (SaveToSettings)
+ //appsettings.SaveSettings("FindWholeWord", FindWholeWordButton.IsChecked);
+ }
+ private void ReplaceAllButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (currentTextbox == null)
+ return;
+
+ var res = currentTextbox.ReplaceAll(
+ textToFindTextbox.Text,
+ textToReplaceTextBox.Text,
+ FindMatchCaseButton.IsChecked ?? false,
+ FindWholeWordButton.IsChecked ?? false
+ );
+
+ ColorWindowBorder(res);
+ }
+ private void ReplaceCurrentButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (currentTextbox == null)
+ return;
+ }
+ private void SearchWindow_CloseButtonClick(object sender, RoutedEventArgs e)
+ {
+ Close();
+ }
+ private void ExpandSearchBoxForReplaceButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (searchWindowState == SearchWindowState.Expanded)
+ ShowSearch(currentTextbox);
+ else
+ ShowReplace(currentTextbox);
+ }
+ private void TextBoxes_GotFocus(object sender, RoutedEventArgs e)
+ {
+ if (sender is TextBox tb)
+ {
+ tb.SelectAll();
+ }
+ }
+
+ private void textToFindTextbox_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ BeginSearch(textToFindTextbox.Text, FindMatchCaseButton.IsChecked ?? false, FindWholeWordButton.IsChecked ?? false);
+ }
+
+ private void collapseSearchAnimation_Completed(object sender, object e)
+ {
+ ToggleVisibility(false);
+ }
+
+ private void expandSearchAnimation_Completed(object sender, object e)
+ {
+ ToggleVisibility(true);
+ }
+
+ private void hideSearchAnimation_Completed(object sender, object e)
+ {
+ this.Visibility = Visibility.Collapsed;
+ }
+ }
+ public enum SearchWindowState
+ {
+ Expanded, //replace and search
+ Default, //only search
+ Hidden //not visible
+ }
+}
diff --git a/Fastedit/Controls/SetingsItemSeparator.xaml b/Fastedit/Controls/SetingsItemSeparator.xaml
new file mode 100644
index 0000000..df112ea
--- /dev/null
+++ b/Fastedit/Controls/SetingsItemSeparator.xaml
@@ -0,0 +1,13 @@
+
+
+
+
diff --git a/Fastedit/Controls/SetingsItemSeparator.xaml.cs b/Fastedit/Controls/SetingsItemSeparator.xaml.cs
new file mode 100644
index 0000000..3c5450f
--- /dev/null
+++ b/Fastedit/Controls/SetingsItemSeparator.xaml.cs
@@ -0,0 +1,16 @@
+using Windows.UI.Xaml.Controls;
+
+// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
+
+namespace Fastedit.Controls
+{
+ public sealed partial class SetingsItemSeparator : UserControl
+ {
+ public SetingsItemSeparator()
+ {
+ this.InitializeComponent();
+ }
+
+ public string Header { get; set; }
+ }
+}
diff --git a/Fastedit/Controls/SettingsControl.xaml b/Fastedit/Controls/SettingsControl.xaml
new file mode 100644
index 0000000..6b5ba6a
--- /dev/null
+++ b/Fastedit/Controls/SettingsControl.xaml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Fastedit/Controls/SettingsControl.xaml.cs b/Fastedit/Controls/SettingsControl.xaml.cs
new file mode 100644
index 0000000..10ebdb1
--- /dev/null
+++ b/Fastedit/Controls/SettingsControl.xaml.cs
@@ -0,0 +1,54 @@
+using Fastedit.Helper;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Input;
+
+// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
+
+namespace Fastedit.Controls
+{
+ public sealed partial class SettingsControl : UserControl
+ {
+ public delegate void ClickedEvent(SettingsControl sender);
+ public event ClickedEvent Clicked;
+
+ public SettingsControl()
+ {
+ this.InitializeComponent();
+ }
+
+ public bool Clickable { get; set; }
+
+ private string _Glyph;
+ public string Glyph { get => _Glyph; set { _Glyph = value; iconDisplay.Visibility = ConvertHelper.BoolToVisibility(value.Length > 0); } }
+ public string Header { get; set; }
+ public new UIElement Content
+ {
+ set
+ {
+ contentHost.Content = value;
+ }
+ }
+
+ private void mainGrid_PointerPressed(object sender, PointerRoutedEventArgs e)
+ {
+ Clicked?.Invoke(this);
+ }
+
+ private void UserControl_PointerEntered(object sender, PointerRoutedEventArgs e)
+ {
+ if (!Clickable)
+ return;
+
+ EnterStoryboard.Begin();
+ }
+
+ private void UserControl_PointerExited(object sender, PointerRoutedEventArgs e)
+ {
+ if (!Clickable)
+ return;
+
+ ExitStoryboard.Begin();
+ }
+ }
+}
diff --git a/Fastedit/Controls/ShortCutInfo.xaml b/Fastedit/Controls/ShortCutInfo.xaml
deleted file mode 100644
index f65cb9b..0000000
--- a/Fastedit/Controls/ShortCutInfo.xaml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
diff --git a/Fastedit/Controls/ShortCutInfo.xaml.cs b/Fastedit/Controls/ShortCutInfo.xaml.cs
deleted file mode 100644
index f106278..0000000
--- a/Fastedit/Controls/ShortCutInfo.xaml.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-using Fastedit.Extensions;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-
-namespace Fastedit.Controls
-{
- public sealed partial class ShortCutInfo : UserControl
- {
- public ShortCutInfo()
- {
- this.InitializeComponent();
- }
-
- private KeyModifiers _secondmodifier = KeyModifiers.None;
- public KeyModifiers SecondModifier
- {
- set
- {
- _secondmodifier = value;
- SetKey();
- }
- }
-
- private KeyModifiers _modifier = KeyModifiers.None;
- public KeyModifiers Modifier
- {
- set
- {
- _modifier = value;
- SetKey();
- }
- }
-
- private string ModifierString()
- {
- if (_modifier == KeyModifiers.Control)
- {
- return "Ctrl + ";
- }
-
- if (_modifier == KeyModifiers.Windows)
- {
- return "Window + ";
- }
-
- if (_modifier == KeyModifiers.Menu)
- {
- return "Alt + ";
- }
-
- if (_modifier == KeyModifiers.Shift)
- {
- return "Shift + ";
- }
- else
- {
- return "";
- }
- }
- private string SecondModifierString()
- {
- if (_secondmodifier == KeyModifiers.Control)
- {
- return "Ctrl + ";
- }
-
- if (_secondmodifier == KeyModifiers.Windows)
- {
- return "Window + ";
- }
-
- if (_secondmodifier == KeyModifiers.Menu)
- {
- return "Alt + ";
- }
-
- if (_secondmodifier == KeyModifiers.Shift)
- {
- return "Shift + ";
- }
- else
- {
- return "";
- }
- }
- private void SetKey()
- {
- display.Text = ModifierString() + SecondModifierString() + _Key;
- displayOnPress.Text = _ActionOnClick;
- }
-
- private string _Key;
- public string Key
- {
- set
- {
- _Key = value;
- SetKey();
- }
- }
-
- private string _ActionOnClick = "";
- public string ActionOnClick { set { _ActionOnClick = value; SetKey(); } }
-
- private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- if (e.NewSize.Width > 700)
- {
- displayOnPress.Margin = new Thickness(310, 5, 5, 5);
- display.Width = 200;
- }
- else
- {
- displayOnPress.Margin = new Thickness(210, 5, 5, 5);
- display.Width = 100;
- }
- }
- }
-}
diff --git a/Fastedit/Controls/StatusbarItem.xaml b/Fastedit/Controls/StatusbarItem.xaml
new file mode 100644
index 0000000..9814019
--- /dev/null
+++ b/Fastedit/Controls/StatusbarItem.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
diff --git a/Fastedit/Controls/StatusbarItem.xaml.cs b/Fastedit/Controls/StatusbarItem.xaml.cs
new file mode 100644
index 0000000..0927c21
--- /dev/null
+++ b/Fastedit/Controls/StatusbarItem.xaml.cs
@@ -0,0 +1,58 @@
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Media;
+
+// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
+
+namespace Fastedit.Controls
+{
+ public sealed partial class StatusbarItem : UserControl
+ {
+ public delegate void StatusbarItemClickEvent(StatusbarItem sender, Button children);
+ public event StatusbarItemClickEvent StatusbarItemClick;
+
+ public StatusbarItem()
+ {
+ this.InitializeComponent();
+ }
+
+ public FlyoutBase CustomFlyout
+ {
+ set
+ {
+ button.Flyout = value;
+ }
+ }
+
+ public UIElement FlyoutContent
+ {
+ get => flyout.Content;
+ set
+ {
+ button.Flyout = value == null ? null : flyout;
+ flyout.Content = value;
+ }
+ }
+
+ private string _StaticText;
+ private string _ChangingText;
+ public string StaticText { get => _StaticText; set { _StaticText = value; UpdateContent(); } }
+ public string ChangingText { get => _ChangingText; set { _ChangingText = value; UpdateContent(); } }
+
+ public new Brush Foreground { set { button.Foreground = value; } get => button.Foreground; }
+ public void HideFlyout()
+ {
+ flyout.Hide();
+ }
+
+ public void UpdateContent()
+ {
+ button.Content = _StaticText + _ChangingText;
+ }
+ private void button_Click(object sender, RoutedEventArgs e)
+ {
+ StatusbarItemClick?.Invoke(this, button);
+ }
+ }
+}
diff --git a/Fastedit/Controls/Textbox/Linenumbers.cs b/Fastedit/Controls/Textbox/Linenumbers.cs
deleted file mode 100644
index 6dff9bd..0000000
--- a/Fastedit/Controls/Textbox/Linenumbers.cs
+++ /dev/null
@@ -1,254 +0,0 @@
-using Fastedit.Extensions;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using Windows.Foundation;
-using Windows.UI.Composition;
-using Windows.UI.Text;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Hosting;
-using Windows.UI.Xaml.Media;
-
-namespace Fastedit.Controls.Textbox
-{
- //Code inspired from https://github.com/JasonStein/Notepads/blob/master/src/Notepads/Controls/TextEditor/TextEditorCore.LineNumbers.cs
- public class Linenumbers
- {
- TextControlBox tcb = null;
- RichEditBox textbox = null;
- private readonly IList RenderedLineNumbers = new List();
- private readonly Dictionary _miniRequisiteIntegerTextRenderingWidthCache = new Dictionary();
-
- public Linenumbers(TextControlBox tb, RichEditBox textb)
- {
- tcb = tb;
- textbox = textb;
- }
-
- //Linenumbers
- public void ShowLinenumbers()
- {
- if (tcb.LineNumberGrid != null)
- {
- ResetLinenumberCanvas();
- UpdateLinenumberRendering();
- }
- }
- public void HideLinenumbers()
- {
- if (tcb.LineNumberGrid != null)
- {
- for (int i = 0; i < RenderedLineNumbers.Count; i++)
- {
- RenderedLineNumbers[i].Visibility = Visibility.Collapsed;
- }
-
- tcb.LineNumberGrid.BorderThickness = new Thickness(0, 0, 0, 0);
- tcb.LineNumberGrid.Margin = new Thickness(0, 0, 0, 0);
- tcb.LineNumberGrid.Width = .0f;
- }
- }
- public void ResetLinenumberCanvas()
- {
- if (tcb.LineNumberGrid != null)
- {
- tcb.LineNumberGrid.Margin = new Thickness(0, 0, (-1 * tcb.Padding.Left) + 1, 0);
- tcb.LineNumberGrid.Clip = new RectangleGeometry
- {
- Rect = new Rect(
- 0,
- tcb.Padding.Top,
- tcb.LineNumberGrid.ActualWidth,
- Math.Clamp(tcb.LineNumberGrid.ActualHeight - (tcb.Padding.Top + tcb.Padding.Bottom), .0f, Double.PositiveInfinity))
- };
- }
- }
- public void UpdateLinenumberRendering()
- {
- if (!tcb.ShowLineNumbers) return;
-
- if (tcb.MainContentScrollViewer != null)
- {
- var startRange = textbox.Document.GetRangeFromPoint(
- new Point(tcb.MainContentScrollViewer.HorizontalOffset, tcb.MainContentScrollViewer.VerticalOffset),
- PointOptions.ClientCoordinates);
-
- var endRange = textbox.Document.GetRangeFromPoint(
- new Point(tcb.MainContentScrollViewer.HorizontalOffset + tcb.MainContentScrollViewer.ViewportWidth,
- tcb.MainContentScrollViewer.VerticalOffset + tcb.MainContentScrollViewer.ViewportHeight),
- PointOptions.ClientCoordinates);
-
- var document = tcb.GetLineNumberContent;
- document = document.Append("\n");
-
- Dictionary lineNumberTextRenderingPositions = GetLinenumberPos(document, startRange, endRange);
-
- var minLineNumberTextRenderingWidth = CalculateMinimumTextRenderingWidth(tcb.FontFamily,
- textbox.FontSize, (document.Length - 1).ToString().Length) + 10;
-
- DoRenderLineNumbers(lineNumberTextRenderingPositions, minLineNumberTextRenderingWidth);
- }
- }
- public Size GetTextSize(FontFamily font, double fontSize, string text)
- {
- var tb = new TextBlock { Text = text, FontFamily = font, FontSize = fontSize };
- tb.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
- return tb.DesiredSize;
- }
- public double CalculateMinimumTextRenderingWidth(FontFamily fontFamily, double fontSize, int numberTextLength)
- {
- var cacheKey = $"{fontFamily.Source}-{(int)fontSize}-{numberTextLength}";
-
- if (_miniRequisiteIntegerTextRenderingWidthCache.ContainsKey(cacheKey))
- {
- return _miniRequisiteIntegerTextRenderingWidthCache[cacheKey];
- }
-
- double minRequisiteWidth = 0;
-
- for (int i = 0; i < 10; i++)
- {
- var str = new string((char)('0' + i), numberTextLength);
- var width = GetTextSize(fontFamily, fontSize, str).Width;
- if (width > minRequisiteWidth)
- {
- minRequisiteWidth = width;
- }
- }
-
- _miniRequisiteIntegerTextRenderingWidthCache[cacheKey] = minRequisiteWidth;
- return minRequisiteWidth;
- }
- private Dictionary GetLinenumberPos(string[] lines, ITextRange startRange, ITextRange endRange)
- {
- var offset = 0;
- var lineRects = new Dictionary(); // 1 - based
-
- for (int i = 0; i < lines.Length - 1; i++)
- {
- var line = lines[i];
-
- // Use "offset + line.Length + 1" instead of just "offset" here is to capture the line right above the viewport
- if (offset + line.Length + 1 >= startRange.StartPosition && offset <= endRange.EndPosition)
- {
- textbox.Document.GetRange(offset, offset + line.Length)
- .GetRect(PointOptions.ClientCoordinates, out var rect, out _);
-
- lineRects[i + 1] = rect;
- }
- else if (offset > endRange.EndPosition)
- {
- break;
- }
-
- offset += line.Length + 1; // 1 for line ending: '\r'
- }
-
- return lineRects;
- }
- public void DoRenderLineNumbers(Dictionary lineNumberTextRenderingPositions, double minLineNumberTextRenderingWidth)
- {
- var padding = tcb.FontSize / 2;
- var lineNumberPadding = new Thickness(padding, 2, padding + 2, 2);
- var lineNumberTextBlockHeight = tcb.GetSingleLineHeight() + tcb.Padding.Top + lineNumberPadding.Top;
- var numOfReusableLineNumberBlocks = RenderedLineNumbers.Count;
-
- foreach (var (lineNumber, rect) in lineNumberTextRenderingPositions)
- {
- var margin = new Thickness(lineNumberPadding.Left,
- rect.Top + lineNumberPadding.Top + tcb.Padding.Top,
- lineNumberPadding.Right,
- lineNumberPadding.Bottom);
-
- if (numOfReusableLineNumberBlocks > 0)
- {
- var index = numOfReusableLineNumberBlocks - 1;
- var ln = RenderedLineNumbers[index];
- ln.Text = lineNumber.ToString();
- ln.Margin = margin;
- ln.Height = lineNumberTextBlockHeight;
- ln.Width = minLineNumberTextRenderingWidth;
- ln.Visibility = Visibility.Visible;
- ln.Foreground = new SolidColorBrush(tcb.LineNumberForeground);
-
- numOfReusableLineNumberBlocks--;
- }
- else
- {
- var lineNumberBlock = new TextBlock()
- {
- Text = lineNumber.ToString(),
- Height = lineNumberTextBlockHeight,
- Width = minLineNumberTextRenderingWidth,
- Margin = margin,
- TextAlignment = TextAlignment.Right,
- HorizontalAlignment = HorizontalAlignment.Right,
- VerticalAlignment = VerticalAlignment.Bottom,
- HorizontalTextAlignment = TextAlignment.Right,
- Foreground = new SolidColorBrush(tcb.LineNumberForeground)
- };
-
- tcb.LineNumberCanvas.Children.Add(lineNumberBlock);
- RenderedLineNumbers.Add(lineNumberBlock);
- }
- }
-
- // Hide all unused rendered linenumber blocks to avoid collosion
- for (int i = 0; i < numOfReusableLineNumberBlocks; i++)
- {
- RenderedLineNumbers[i].Visibility = Visibility.Collapsed;
- }
- tcb.LineNumberGrid.Width = lineNumberPadding.Left + minLineNumberTextRenderingWidth + lineNumberPadding.Right;
- }
- }
-
- public static class ExtensionClass
- {
- //Extension method to append an element to the stringarray
- public static T[] Append(this T[] array, T item)
- {
- List list = new List(array)
- {
- item
- };
-
- return list.ToArray();
- }
- }
- public static class ScrollViewerExtensions
- {
- public static ExpressionAnimation StartExpressionAnimation(
- this ScrollViewer scrollViewer,
- UIElement target,
- Axis axis)
- {
- return scrollViewer.StartExpressionAnimation(target, sourceAxis: axis, targetAxis: axis);
- }
-
- public static ExpressionAnimation StartExpressionAnimation(
- this ScrollViewer scrollViewer,
- UIElement target,
- Axis sourceAxis,
- Axis targetAxis)
- {
- try
- {
- CompositionPropertySet scrollSet = ElementCompositionPreview.GetScrollViewerManipulationPropertySet(scrollViewer);
-
- ExpressionAnimation animation = scrollSet.Compositor.CreateExpressionAnimation($"{nameof(scrollViewer)}.{nameof(UIElement.Translation)}.{sourceAxis}");
- animation.SetReferenceParameter(nameof(scrollViewer), scrollSet);
-
- Visual visual = ElementCompositionPreview.GetElementVisual(target);
- visual.StartAnimation($"{nameof(Visual.Offset)}.{targetAxis}", animation);
-
- return animation;
- }
- catch
- {
- //Prevent crashing
- return null;
- }
- }
- }
-}
diff --git a/Fastedit/Controls/Textbox/Searchdialog.xaml b/Fastedit/Controls/Textbox/Searchdialog.xaml
deleted file mode 100644
index 55dc1cd..0000000
--- a/Fastedit/Controls/Textbox/Searchdialog.xaml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Fastedit/Controls/Textbox/Searchdialog.xaml.cs b/Fastedit/Controls/Textbox/Searchdialog.xaml.cs
deleted file mode 100644
index 802a6e8..0000000
--- a/Fastedit/Controls/Textbox/Searchdialog.xaml.cs
+++ /dev/null
@@ -1,209 +0,0 @@
-using Fastedit.Core.Tab;
-using Fastedit.Core;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.System;
-using Windows.UI.Core;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
-using Microsoft.UI.Xaml.Controls;
-using Convert = Fastedit.Extensions.Convert;
-using Fastedit.Controls.Textbox;
-using Windows.UI;
-
-namespace Fastedit.Controls.Textbox
-{
- public sealed partial class Searchdialog : UserControl
- {
- private AppSettings appsettings = new AppSettings();
- public TextControlBox textbox = null;
-
- public Searchdialog(TextControlBox textbox)
- {
- this.InitializeComponent();
- this.textbox = textbox;
- }
-
- public new Brush Background
- {
- get => SearchWindow.Background;
- set => SearchWindow.Background = value;
- }
- public bool SearchIsOpen
- {
- get => this.Visibility == Visibility.Visible;
- set
- {
- this.Visibility = Convert.BoolToVisibility(value);
- if (value)
- {
- TextToFindTextbox.Focus(FocusState.Keyboard);
- TextToFindTextbox.SelectAll();
- }
- }
- }
- private bool _ReplaceIsOpen = false;
- public bool ReplaceIsOpen
- {
- get => _ReplaceIsOpen;
- set
- {
- if (value)
- {
- ExpandSearch.Begin();
- SearchWindow.Height = 125;
- ExpandSearchBoxForReplaceButton.Content = "\uF0AD";
- if (SaveToSettings)
- appsettings.SaveSettings("SearchExpanded", 0);
-
- }
- else
- {
- if (SearchWindow.Height > 45)
- CollapseSearch.Begin();
- ExpandSearchBoxForReplaceButton.Content = "\uF0AE";
- if (SaveToSettings)
- appsettings.SaveSettings("SearchExpanded", 1);
- }
- _ReplaceIsOpen = value;
- TextToReplaceTextBox.Visibility = ReplaceAllButton.Visibility =
- StartReplaceButton.Visibility = Convert.BoolToVisibility(value);
- TextToReplaceTextBox.Focus(FocusState.Keyboard);
- TextToReplaceTextBox.SelectAll();
- }
- }
- public void Find(bool Up = false)
- {
- if (textbox != null)
- {
- var res = textbox.FindInText(TextToFindTextbox.Text, Up, FindMatchCaseButton.IsChecked ?? false, FindWholeWordButton.IsChecked ?? false);
- ColorWindowBorder(res);
- }
- }
- public void Show(string text = "")
- {
- if (textbox == null)
- return;
-
- TextToFindTextbox.Text = text.Length == 0 ? textbox.SelectedText : text;
- SearchIsOpen = true;
-
- if (SaveToSettings)
- {
- appsettings.SaveSettings("SearchOpen", true);
- FindMatchCaseButton.IsChecked = appsettings.GetSettingsAsBool("FindMatchCase", false);
- FindWholeWordButton.IsChecked = appsettings.GetSettingsAsBool("FindWholeWord", false);
- }
-
- TextToFindTextbox.Focus(FocusState.Keyboard);
- TextToFindTextbox.SelectAll();
- }
- public void Close()
- {
- SearchIsOpen = false;
- if(SaveToSettings)
- appsettings.SaveSettings("SearchOpen", false);
- }
- public void Toggle(bool Replace)
- {
- if (!SearchIsOpen)
- {
- Show("");
- this.Replace(Replace);
- }
- else
- Close();
- }
- public void Replace(bool IsOn)
- {
- ReplaceIsOpen = IsOn;
- }
- public bool SaveToSettings { get; set; } = true;
-
-
-
- private void ColorWindowBorder(bool state)
- {
- if (SaveToSettings)
- SearchWindow.BorderBrush = state ? DefaultValues.CorrectInput_Color : DefaultValues.WrongInput_Color;
- }
- private void ReplaceTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
- {
- if (e.Key == VirtualKey.Enter)
- {
- ReplaceCurrentButton_Click(null, null);
- }
- }
- private void SearchTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
- {
- //Search down on Enter and up on Shift + Enter//
- var shift = Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift);
- if (e.Key == VirtualKey.Enter)
- {
- Find(shift.HasFlag(CoreVirtualKeyStates.Down));
- }
- }
- private void SearchUpButton_Click(object sender, RoutedEventArgs e)
- {
- Find(true);
- }
- private void SearchDownButton_Click(object sender, RoutedEventArgs e)
- {
- Find(false);
- }
- private void FindMatchCaseButton_Click(object sender, RoutedEventArgs e)
- {
- if(SaveToSettings)
- appsettings.SaveSettings("FindMatchCase", FindMatchCaseButton.IsChecked);
- }
- private void FindWholeWordButton_Click(object sender, RoutedEventArgs e)
- {
- if(SaveToSettings)
- appsettings.SaveSettings("FindWholeWord", FindWholeWordButton.IsChecked);
- }
- private void ReplaceAllButton_Click(object sender, RoutedEventArgs e)
- {
- if (textbox != null)
- {
- var res = textbox.ReplaceAll(TextToFindTextbox.Text, TextToReplaceTextBox.Text,
- false, FindMatchCaseButton.IsChecked ?? false, FindWholeWordButton.IsChecked ?? false);
- ColorWindowBorder(res);
- }
- }
- private void ReplaceCurrentButton_Click(object sender, RoutedEventArgs e)
- {
- if (textbox != null)
- {
- var res = textbox.ReplaceInText(
- TextToFindTextbox.Text, TextToReplaceTextBox.Text,
- false, FindMatchCaseButton.IsChecked ?? false, FindWholeWordButton.IsChecked ?? false);
- ColorWindowBorder(res);
- }
- }
- private void SearchWindow_CloseButtonClick(object sender, RoutedEventArgs e)
- {
- Close();
- }
- private void ExpandSearchBoxForReplaceButton_Click(object sender, RoutedEventArgs e)
- {
- Replace(SaveToSettings ? appsettings.GetSettingsAsInt("SearchExpanded", 0) == 1 : !ReplaceIsOpen);
- }
- private void TextBoxes_GotFocus(object sender, RoutedEventArgs e)
- {
- if (sender is TextBox tb)
- {
- tb.SelectAll();
- }
- }
- }
-}
diff --git a/Fastedit/Controls/Textbox/TabKey.cs b/Fastedit/Controls/Textbox/TabKey.cs
deleted file mode 100644
index 9aa45e9..0000000
--- a/Fastedit/Controls/Textbox/TabKey.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-using Fastedit.Core;
-using System;
-
-namespace Fastedit.Controls.Textbox
-{
- public class TabKey
- {
- private TextControlBox tcb = null;
-
- public TabKey(TextControlBox tb)
- {
- tcb = tb;
- }
-
- //Tab-Key
- public void MoveTextWithTab_Back_WithoutSelection()
- {
- string linecontent = tcb.GetLineNumberContent[tcb.GetCurrentLineNumber - 1];
-
- if (linecontent.Contains(DefaultValues.DefaultTabSize) || linecontent.Contains(" "))
- {
- int currentcurpos = tcb.SelectionStart;
- tcb.SelectLine(tcb.GetCurrentLineNumber);
-
- string outsel = tcb.SelectedText;
-
- if (tcb.SelectedText.Contains(DefaultValues.DefaultTabSize))
- {
- outsel = Extensions.StringBuilder.ReplaceFirstOccurenceInString(tcb.SelectedText, DefaultValues.DefaultTabSize, "");
- }
- else if (tcb.SelectedText.Contains(" "))
- {
- outsel = Extensions.StringBuilder.ReplaceFirstOccurenceInString(tcb.SelectedText, " ", "");
- }
-
- tcb.SelectedText = outsel;
- tcb.SetSelection(currentcurpos - 1, 0);
- }
- }
- public void MoveTextWithTab_Back_WithSelection()
- {
- if (tcb.SelectedText.Contains(DefaultValues.DefaultTabSize))
- {
- string[] AllLines = tcb.SelectedText.Split(new char[] { '\n', '\r' }, StringSplitOptions.None);
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
-
- if (AllLines.Length == 1)
- {
- sb.Append(Extensions.StringBuilder.ReplaceFirstOccurenceInString(tcb.GetLineNumberContent[tcb.GetCurrentLineNumber - 1], DefaultValues.DefaultTabSize, ""));
- tcb.SelectLine(tcb.GetCurrentLineNumber);
- tcb.SetSelection(tcb.SelectionStart, tcb.SelectionLenght - 1);
- tcb.SelectedText = sb.ToString();
- }
- else
- {
- for (int i = 0; i < AllLines.Length; i++)
- {
- if (tcb.SelectedText.Contains(DefaultValues.DefaultTabSize))
- {
- sb.Append(
- Extensions.StringBuilder.ReplaceFirstOccurenceInString(AllLines[i], DefaultValues.DefaultTabSize, "") +
- (i != AllLines.Length - 1 ? "\n" : ""));
- }
- else
- {
- sb.Append($"{AllLines[i]}\n");
- }
- }
- tcb.SelectedText = sb.ToString();
- }
- }
- }
- public void MoveTextWithTab_Forward_WithoutSelection()
- {
- tcb.SelectedText = DefaultValues.DefaultTabSize;
- tcb.SetSelection(tcb.SelectionStart + DefaultValues.DefaultTabSize.Length, 0);
- }
- public void MoveTextWithTab_Forward_WithSelection()
- {
- string[] AllLines = tcb.SelectedText.Split(new char[] { '\n', '\r' }, StringSplitOptions.None);
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
-
- if (AllLines.Length == 1)
- {
- sb.Append(DefaultValues.DefaultTabSize + AllLines[0]);
- }
- else
- {
- for (int i = 0; i < AllLines.Length - 1; i++)
- {
- sb.Append(DefaultValues.DefaultTabSize + AllLines[i] + (i != AllLines.Length - 1 ? "\n" : ""));
- }
- }
- tcb.SelectedText = sb.ToString();
- }
- }
-}
diff --git a/Fastedit/Controls/Textbox/TextControlBox.xaml b/Fastedit/Controls/Textbox/TextControlBox.xaml
deleted file mode 100644
index 3fea327..0000000
--- a/Fastedit/Controls/Textbox/TextControlBox.xaml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Fastedit/Controls/Textbox/TextControlBox.xaml.cs b/Fastedit/Controls/Textbox/TextControlBox.xaml.cs
deleted file mode 100644
index 6d79c3b..0000000
--- a/Fastedit/Controls/Textbox/TextControlBox.xaml.cs
+++ /dev/null
@@ -1,1450 +0,0 @@
-using ColorCode;
-using Fastedit.Core;
-using Fastedit.Core.Tab;
-using Fastedit.Dialogs;
-using Fastedit.Extensions;
-using Microsoft.Toolkit.Uwp.UI;
-using Microsoft.Toolkit.Uwp.UI.Controls;
-using Newtonsoft.Json.Linq;
-using System;
-using System.Buffers.Text;
-using System.Diagnostics;
-using System.Numerics;
-using System.Reflection.Metadata;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Windows.ApplicationModel.DataTransfer;
-using Windows.Foundation;
-using Windows.Security.Cryptography.Certificates;
-using Windows.Storage;
-using Windows.System;
-using Windows.UI;
-using Windows.UI.Core;
-using Windows.UI.Text;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Shapes;
-using Convert = Fastedit.Extensions.Convert;
-using muxc = Microsoft.UI.Xaml.Controls;
-
-namespace Fastedit.Controls.Textbox
-{
- public sealed partial class TextControlBox : UserControl
- {
- private readonly TabKey tabkey = null;
- private readonly Linenumbers linenumbers = null;
- private readonly AppSettings appsettings = new AppSettings();
- private readonly TextControlBoxFlyoutMenu flyoutmenu = null;
- public ScrollViewer MainContentScrollViewer = null;
- public Grid LineNumberGrid = null;
- public Canvas LineNumberCanvas = null;
- public Canvas LineHighlighterCanvas = null;
- public Grid LineHighlighterControl = null;
- private int OldLineNumber = 0;
- private int OldWordCount = 0;
- private bool MarkdownRoatation = false;
- public string TextBuffer = string.Empty;
- public bool TextLoaded = false;
-
- public TextControlBox()
- {
- this.InitializeComponent();
- tabkey = new TabKey(this);
- linenumbers = new Linenumbers(this, textbox);
- flyoutmenu = new TextControlBoxFlyoutMenu(this);
-
- //Create the flyouts
- textbox.ContextFlyout = flyoutmenu.CreateFlyout(false);
- //add events:
- textbox.AddHandler(PointerPressedEvent, new PointerEventHandler(Textbox_PointerPressed), true);
- KeyDown += TextControlBox_KeyDown;
- textbox.CopyingToClipboard += Textbox_CopyingToClipboard;
- textbox.TextChanged += Textbox_TextChanged;
- textbox.PointerWheelChanged += Textbox_PointerWheelChanged;
- textbox.SelectionChanged += Textbox_SelectionChanged;
- textbox.Paste += Textbox_Paste;
- //ScrollViewer
- ScrollViewer.SetHorizontalScrollMode(textbox, ScrollMode.Enabled);
- ScrollViewer.SetVerticalScrollMode(textbox, ScrollMode.Enabled);
- base.Focus(FocusState.Programmatic);
- UpdateRendering();
- }
-
- //Events
- private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- UpdateMarkdownSize();
- UpdateLineHighlighter();
- }
- private void Textbox_CopyingToClipboard(RichEditBox sender, TextControlCopyingToClipboardEventArgs args)
- {
- Copy();
- args.Handled = true;
- }
- private void Textbox_Paste(object sender, TextControlPasteEventArgs e)
- {
- //Prevent the textbox from pasting because it has a custom paste function
- e.Handled = true;
- }
- private void OnLineNumberGridSizeChanged(object sender, SizeChangedEventArgs e)
- {
- if (LineNumberGrid != null)
- {
- linenumbers.ResetLinenumberCanvas();
- }
- }
- private void Textbox_Loaded(object sender, RoutedEventArgs e)
- {
- //Find and assign the children to it's variable
- LineHighlighterCanvas = textbox.FindDependencyObject("LineHighlighterCanvas") as Canvas;
- LineHighlighterControl = textbox.FindDependencyObject("LineHighlighterControl") as Grid;
- LineHighlighterControl.Background = new SolidColorBrush(LineHighlighterBackground);
- LineHighlighterControl.BorderBrush = new SolidColorBrush(LineHighlighterForeground);
- LineNumberCanvas = textbox.FindDependencyObject("LineNumberCanvas") as Canvas;
- LineNumberGrid = textbox.FindDependencyObject("LineNumberGrid") as Grid;
- MainContentScrollViewer = textbox.FindDependencyObject("ContentElement") as ScrollViewer;
-
- UpdateRendering();
- textbox.Focus(FocusState.Programmatic);
- }
- private void Textbox_TextChanged(object sender, RoutedEventArgs e)
- {
- string text = GetText();
- linenumbers.UpdateLinenumberRendering();
-
- if (TextBeforeLastSaved != text)
- {
- TextChangedevent?.Invoke(this);
- SaveStatusChangedEvent?.Invoke(this, IsModified);
- IsModified = true;
- if (MarkdownPreview && text != null)
- {
- markdowntextblock.Text = text;
- }
- }
- int words = CountWords(text);
- if (words != OldWordCount)
- {
- OldWordCount = words;
- WordCountChangedEvent?.Invoke(this, words);
- }
- }
- private void Textbox_PointerWheelChanged(object sender, PointerRoutedEventArgs e)
- {
- var Control = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control);
- if (Control.HasFlag(CoreVirtualKeyStates.Down))
- {
- ScrollViewer.SetVerticalScrollMode(textbox, ScrollMode.Disabled);
-
- int delta = e.GetCurrentPoint((UIElement)sender).Properties.MouseWheelDelta;
-
- if (delta < 0)
- {
- ZoomOut(0.1);
- }
-
- if (delta > 0)
- {
- ZoomIn(0.1);
- }
-
- ScrollViewer.SetVerticalScrollMode(textbox, ScrollMode.Enabled);
- }
- }
- private void Textbox_SelectionChanged(object sender, RoutedEventArgs e)
- {
- UpdateLineHighlighter();
- UpdateLineNumber();
-
- tabdatafromdatabase.TabSelLenght = SelectionLenght;
- tabdatafromdatabase.TabSelStart = SelectionStart;
- }
- private void Textbox_PointerPressed(object sender, PointerRoutedEventArgs e)
- {
- Pointer_PressedEvent?.Invoke(this, e);
- }
- private void TextControlBox_KeyDown(object sender, KeyRoutedEventArgs e)
- {
- KeyPressedEvent?.Invoke(this, e);
- var Shift = Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift);
- var Control = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control);
-
- if (Control.HasFlag(CoreVirtualKeyStates.Down) && Shift.HasFlag(CoreVirtualKeyStates.None))
- {
- //Cut // Copy // Paste
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.C, Copy);
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.V, Paste);
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.X, Cut);
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.D, DuplicateLine);
-
- //Undo // Redo
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.Z, Undo);
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.Y, Redo);
-
- //Select all
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.A, SelectAll);
-
- //Scroll up // Scroll down
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.Up, ScrollWithArrowKeys, VerticalAxis.Up);
- KeyboardCommands.KeyboardCommand(e.Key, VirtualKey.Down, ScrollWithArrowKeys, VerticalAxis.Down);
-
- //Zoom in / Zoom out
- if (e.Key.ToString() == "187")
- {
- ZoomIn(DefaultValues.DefaultZoomFactor);
- }
- if (e.Key.ToString() == "189")
- {
- ZoomOut(DefaultValues.DefaultZoomFactor);
- }
- }
- else
- {
- //TabKey
- if (Shift.HasFlag(CoreVirtualKeyStates.Down))
- {
- if (e.Key == VirtualKey.Tab && SelectionLenght == 0)
- {
- e.Handled = true;
- tabkey.MoveTextWithTab_Back_WithoutSelection();
- }
- else if (e.Key == VirtualKey.Tab && SelectionLenght != 0)
- {
- e.Handled = true;
- tabkey.MoveTextWithTab_Back_WithSelection();
- }
- }
- else if (Shift.HasFlag(CoreVirtualKeyStates.None))
- {
- if (e.Key == VirtualKey.Tab && SelectionLenght == 0)
- {
- e.Handled = true;
- tabkey.MoveTextWithTab_Forward_WithoutSelection();
- }
- else if (e.Key == VirtualKey.Tab && SelectionLenght != 0)
- {
- e.Handled = true;
- tabkey.MoveTextWithTab_Forward_WithSelection();
- }
- }
- }
- }
- private void TextControlBox_ScrollChanged(object sender, ScrollViewerViewChangedEventArgs e)
- {
- if (LineHighlighterCanvas != null && LineHighlighter == true)
- {
- MainContentScrollViewer.StartExpressionAnimation(LineHighlighterCanvas, Axis.Y);
- }
-
- MainContentScrollViewer.StartExpressionAnimation(LineNumberCanvas, Axis.Y);
- linenumbers.UpdateLinenumberRendering();
- UpdateLineHighlighterScroll();
- }
- private void ScrollViewer_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- linenumbers.UpdateLinenumberRendering();
- }
- private void Markdowntextblock_MarkdownRendered(object sender, MarkdownRenderedEventArgs e)
- {
- if (progressring != null)
- {
- progressring.IsActive = false;
- progressring.Visibility = Visibility.Collapsed;
- }
- }
-
- //Store data
- public TabDataForDatabase tabdatafromdatabase = new TabDataForDatabase
- {
- ZoomFactor = 100,
- TabName = "",
- TabModified = false,
- TabHeader = "",
- TabToken = "",
- TabPath = "",
- DataBaseName = "",
- TabTemp = "",
- TabReadOnly = false,
- TabSelLenght = 0,
- TabSelStart = 0,
- CurrentSelectedTabIndex = 0,
- TabSaveMode = TabSaveMode.SaveAsFile,
- TabEncoding = 1,
- Markdown = false,
- MarkdownMode2 = false,
- MarkdownIsColumn = false,
- WordWrap = TextWrapping.NoWrap,
- };
- public string IdentifierName
- {
- get { return this.Name; }
- set { this.Name = value; tabdatafromdatabase.TabName = value; }
- }
- public string FilePath { get => tabdatafromdatabase.TabPath; set { tabdatafromdatabase.TabPath = value; } }
- public string DataBaseName { get => tabdatafromdatabase.DataBaseName; set { tabdatafromdatabase.DataBaseName = value; } }
- public string Header
- {
- get => tabdatafromdatabase.TabHeader;
- set
- {
- if (TextLoaded)
- DocumentTitleChangedEvent?.Invoke(this, value);
- tabdatafromdatabase.TabHeader = value;
- }
- }
- public bool IsModified
- {
- get => tabdatafromdatabase.TabModified;
- set
- {
- tabdatafromdatabase.TabModified = value;
- SaveStatusChangedEvent?.Invoke(this, value);
- }
- }
- public TabSaveMode TabSaveMode { get => tabdatafromdatabase.TabSaveMode; set {tabdatafromdatabase.TabSaveMode = value; } }
- public string FileToken { get => tabdatafromdatabase.TabToken; set { tabdatafromdatabase.TabToken = value; } }
- public string TempFile { get => tabdatafromdatabase.TabTemp; set { tabdatafromdatabase.TabTemp = value; } }
- private Encoding _Encoding = Encoding.Default;
- public Encoding Encoding
- {
- get => _Encoding;
- set
- {
- if (_Encoding != value)
- {
- _Encoding = value;
- tabdatafromdatabase.TabEncoding = Encodings.EncodingToInt(value);
- IsModified = true;
- if (TextLoaded)
- EncodingChangedEvent?.Invoke(this, value);
- }
- }
- }
- public StorageFile Storagefile { get; set; } = null;
- public string TextBeforeLastSaved { get; set; } = "";
-
- //Just for setting the Encoding, without affecting the Modified state
- public void SetEncoding(Encoding encoding)
- {
- if (_Encoding != encoding)
- {
- _Encoding = encoding;
- tabdatafromdatabase.TabEncoding = Encodings.EncodingToInt(encoding);
- if (TextLoaded)
- EncodingChangedEvent?.Invoke(this, encoding);
- }
- }
-
- //TextModes:
- public TextWrapping WordWrap
- {
- get => textbox.TextWrapping;
- set { textbox.TextWrapping = value; linenumbers.UpdateLinenumberRendering(); tabdatafromdatabase.WordWrap = value; }
- }
- public bool IsReadOnly
- {
- get => textbox.IsReadOnly;
- set { textbox.IsReadOnly = value; tabdatafromdatabase.TabReadOnly = value; }
- }
- public bool SpellChecking
- {
- get => textbox.IsSpellCheckEnabled;
- set { textbox.IsSpellCheckEnabled = value; }
- }
- public bool IsHandWritingEnabled
- {
- get => textbox.IsHandwritingViewEnabled;
- set { textbox.IsHandwritingViewEnabled = value; }
- }
-
- //Font & Fontsize
- private async void SetFontSize(double val)
- {
- await Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
- {
- _textfontsize = val;
- if (val > DefaultValues.MaxFontWithZoom)
- {
- val = DefaultValues.MaxFontWithZoom;
- }
- else if (val < DefaultValues.MinFontWithZoom)
- {
- val = DefaultValues.MinFontWithZoom;
- }
-
- if (textbox != null)
- {
- textbox.FontSize = val;
- }
-
- var newZoomFactor = Math.Round(val * 100 / appsettings.GetSettingsAsInt("FontSize", DefaultValues.DefaultFontsize));
- if (Math.Abs(newZoomFactor - _zoomFactor) >= 1)
- {
- _zoomFactor = newZoomFactor;
- }
- if (TextLoaded)
- ZoomChangedEvent?.Invoke(this, newZoomFactor);
- });
- }
- private double _textfontsize = DefaultValues.DefaultFontsize;
- public new double FontSize
- {
- get { return _textfontsize; }
- set
- {
- SetFontSize(value);
- }
- }
- public double FontSizeWithoutZoom
- {
- set
- {
- if (value > DefaultValues.MaxFontWithZoom)
- {
- value = DefaultValues.MaxFontWithZoom;
- }
- else if (value < DefaultValues.MinFontWithZoom)
- {
- value = DefaultValues.MinFontWithZoom;
- }
- textbox.FontSize = value;
- }
- }
- public new FontFamily FontFamily
- {
- get { return textbox.FontFamily; }
- set
- {
- textbox.FontFamily = value;
-
- linenumbers.UpdateLinenumberRendering();
- }
- }
-
- public Rect GetSelectionRect()
- {
- textbox.Document.Selection.GetRect(Windows.UI.Text.PointOptions.ClientCoordinates,
- out Rect rect, out var _);
- return rect;
- }
-
- //Appearance:
- public Color TextColor
- {
- get
- {
- if (textbox.Foreground is SolidColorBrush colorBrush)
- {
- return colorBrush.Color;
- }
- else
- {
- return Color.FromArgb(255, 0, 0, 0);
- }
- }
- set
- {
- textbox.Foreground = new SolidColorBrush(value);
- }
- }
- public Color LineNumberBackground
- {
- get
- {
- if (LineNumberGrid != null)
- {
- return Convert.ToColor(LineNumberGrid.Background, Colors.Gray);
- }
- else
- {
- return Color.FromArgb(0, 0, 0, 0);
- }
- }
- set
- {
- if (LineNumberGrid != null)
- {
- LineNumberGrid.Background = new SolidColorBrush(value);
- }
-
- linenumbers.UpdateLinenumberRendering();
- }
- }
- private Color _LineNumberForeground;
- public Color LineNumberForeground
- {
- get { return _LineNumberForeground; }
- set
- {
- _LineNumberForeground = value;
- linenumbers.UpdateLinenumberRendering();
- }
- }
- public new Color Background
- {
- get => Convert.ToColor(textbox.Background, Colors.Gray);
- set
- {
- textbox.Background = new SolidColorBrush(value);
- if(markdowntextblock != null)
- markdowntextblock.Background = new SolidColorBrush(value);
- }
- }
- public Color TextSelectionColor
- {
- get => textbox.SelectionHighlightColor.Color;
- set
- {
- textbox.SelectionHighlightColor = new SolidColorBrush(value);
- textbox.SelectionHighlightColorWhenNotFocused = new SolidColorBrush(value);
- }
- }
- public double BackgroundOpacity
- {
- get { return textbox.Background.Opacity; }
- set { textbox.Background.Opacity = value; }
- }
- private bool _ShowLineNumbers { get; set; }
- public bool ShowLineNumbers
- {
- get { return _ShowLineNumbers; }
- set
- {
- _ShowLineNumbers = value;
- if (value == true)
- linenumbers.ShowLinenumbers();
- else
- linenumbers.HideLinenumbers();
- }
- }
- private Color _LineHighlighterForeground;
- public Color LineHighlighterForeground
- {
- get
- {
- return _LineHighlighterForeground;
- }
- set
- {
- _LineHighlighterForeground = value;
- if (LineHighlighterControl != null)
- LineHighlighterControl.BorderBrush = new SolidColorBrush(value);
- }
- }
- private Color _LineHighlighterBackground;
- public Color LineHighlighterBackground
- {
- get
- {
- return _LineHighlighterBackground;
- }
- set
- {
- _LineHighlighterBackground = value;
- if (LineHighlighterControl != null)
- LineHighlighterControl.Background = new SolidColorBrush(value);
- }
- }
-
- ///
- /// Update text, Linenumbers and Linehighlighter -rendering
- ///
- public void UpdateRendering()
- {
- UpdateLineHighlighter();
- UpdateLineNumber();
- }
-
- //Rightclickmenu
- public bool ShowSelectionFlyout
- {
- set
- {
- textbox.SelectionFlyout = value ? flyoutmenu.CreateSelectionFlyout() : null;
- }
- get => textbox.SelectionFlyout == null ? false : true;
- }
- public void UpdateContextFlyout()
- {
- textbox.ContextFlyout = flyoutmenu.CreateFlyout(false);
- }
-
- //Line highlighter
- public void UpdateLineHighlighterScroll()
- {
- if (MainContentScrollViewer == null || LineHighlighterControl == null)
- return;
-
- var selsize = GetSelectionRect();
- var MarginTop = selsize.Y - MainContentScrollViewer.VerticalOffset + LineHighlighterControl.Height*2;
- bool condition = MarginTop < 40 || MarginTop > textbox.ActualHeight + 10;
-
- LineHighlighterControl.Visibility = Convert.BoolToVisibility(!condition);
- }
- public void UpdateLineHighlighter()
- {
- if (!LineHighlighter || LineHighlighterCanvas == null || LineHighlighterControl == null)
- {
- return;
- }
-
- if (SelectionIsMultiline() && LineHighlighterControl.Visibility == Visibility.Visible)
- {
- LineHighlighterControl.Visibility = Visibility.Collapsed;
- }
- else if (LineHighlighterControl.Visibility == Visibility.Collapsed && SelectionLenght == 0)
- {
- LineHighlighterControl.Visibility = Visibility.Visible;
- }
-
- if (LineHighlighterControl.Visibility == Visibility.Visible)
- {
- LineHighlighterControl.BorderThickness = new Thickness((double)_zoomFactor / 50);
- LineHighlighterControl.Height = GetSingleLineHeight() + 4;
- LineHighlighterControl.Margin =
- new Thickness(LineNumberGrid.ActualWidth + 5, (GetSelectionRect().Y + textbox.Padding.Top - 2), 0, 0);
- int Width = (int)(textbox.ActualWidth - LineNumberGrid.ActualWidth - 5);
- LineHighlighterControl.Width = Width < 0 ? 0 : Width - (MainContentScrollViewer.ComputedVerticalScrollBarVisibility == Visibility.Visible ? 7 : 0);
- }
- }
- private bool _LineHighlighter = false;
- public bool LineHighlighter
- {
- set
- {
- if (value)
- {
- UpdateLineHighlighter();
- if(LineHighlighterControl != null && LineHighlighterCanvas != null)
- LineHighlighterControl.Visibility = LineHighlighterCanvas.Visibility = Visibility.Visible;
- }
- else
- {
- if(LineHighlighterControl != null)
- {
- LineHighlighterControl.Visibility = LineHighlighterCanvas.Visibility = Visibility.Collapsed;
- }
- }
- _LineHighlighter = value;
- }
- get => _LineHighlighter;
- }
-
- //Markdown
- public bool MarkdownPreview
- {
- get => markdowntextblock != null;
- set
- {
- tabdatafromdatabase.Markdown = value;
- if (value == true)
- {
- if (markdowntextblock == null || markdowntextblock_sv == null || Splittedview_Splitter == null)
- {
- markdowntextblock_sv = FindName("markdowntextblock_sv") as ScrollViewer;
- markdowntextblock = FindName("markdowntextblock") as MarkdownTextBlock;
- Splittedview_Splitter = FindName("Splittedview_Splitter") as GridSplitter;
-
- if (MarkdownPreview)
- {
- markdowntextblock.Text = GetText();
- progressring = FindName("progressring") as muxc.ProgressRing;
-
- markdowntextblock.Background = textbox.Background;
- MarkdownRoatation = tabdatafromdatabase.MarkdownIsColumn;
- Markdown_UpdateRotation();
-
- if (tabdatafromdatabase.MarkdownMode2) //left-right / top-bottom
- {
- if (tabdatafromdatabase.MarkdownIsColumn)
- {
- Grid.SetColumn(markdowntextblock_sv, 0);
- Grid.SetColumn(Splittedview_Splitter, 1);
- Grid.SetColumn(textbox, 2);
- }
- else
- {
- Grid.SetRow(textbox, 2);
- Grid.SetRow(Splittedview_Splitter, 1);
- Grid.SetRow(markdowntextblock_sv, 0);
- }
- }
- else
- {
- if (tabdatafromdatabase.MarkdownIsColumn)
- {
- Grid.SetColumn(markdowntextblock_sv, 2);
- Grid.SetColumn(Splittedview_Splitter, 1);
- Grid.SetColumn(textbox, 0);
- }
- else
- {
- Grid.SetRow(textbox, 0);
- Grid.SetRow(Splittedview_Splitter, 1);
- Grid.SetRow(markdowntextblock_sv, 2);
- }
- }
- UpdateMarkdownSize();
- }
-
- }
- }
- else
- {
- splittedgrid.ColumnDefinitions.Clear();
- splittedgrid.RowDefinitions.Clear();
- if(markdowntextblock_sv != null)
- UnloadObject(markdowntextblock_sv);
- if(markdowntextblock != null)
- UnloadObject(markdowntextblock);
- if(Splittedview_Splitter != null)
- UnloadObject(Splittedview_Splitter);
- }
- }
- }
- private void SetGridColumns()
- {
- if (splittedgrid.ColumnDefinitions.Count > 0)
- return;
- splittedgrid.RowDefinitions.Clear();
- splittedgrid.ColumnDefinitions.Add(new ColumnDefinition());
- splittedgrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(16)});
- splittedgrid.ColumnDefinitions.Add(new ColumnDefinition());
- }
- private void SetGridRows()
- {
- if (splittedgrid.RowDefinitions.Count > 0)
- return;
- splittedgrid.ColumnDefinitions.Clear();
- splittedgrid.RowDefinitions.Add(new RowDefinition());
- splittedgrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(16) });
- splittedgrid.RowDefinitions.Add(new RowDefinition());
- }
- private bool Markdown_Column()
- {
- SetGridColumns();
- bool res = false;
- if (Grid.GetColumn(markdowntextblock_sv) == 2)
- {
- Grid.SetColumn(markdowntextblock_sv, 0);
- Grid.SetColumn(textbox, 2);
- res = true;
- }
- else if (Grid.GetColumn(markdowntextblock_sv) == 0)
- {
- Grid.SetColumn(markdowntextblock_sv, 2);
- Grid.SetColumn(textbox, 0);
- }
- Grid.SetColumn(Splittedview_Splitter, 1);
- Markdown_Button_Rotation.Angle = 0;
- return res;
- }
- private bool Markdown_Row()
- {
- SetGridRows();
- bool res = false;
- if (Grid.GetRow(markdowntextblock_sv) == 2)
- {
- Grid.SetRow(markdowntextblock_sv, 0);
- Grid.SetRow(textbox, 2);
- res = true;
- }
- else if (Grid.GetRow(markdowntextblock_sv) == 0)
- {
- Grid.SetRow(markdowntextblock_sv, 2);
- Grid.SetRow(textbox, 0);
- }
- Grid.SetRow(Splittedview_Splitter, 1);
- Markdown_Button_Rotation.Angle = 90;
- return res;
- }
- private void Markdown_ToggleLeftRight()
- {
- if (!MarkdownPreview)
- return;
- bool res = false;
- //Markdowntextblock is column
- if (tabdatafromdatabase.MarkdownIsColumn)
- {
- res = Markdown_Column();
- }
- //Markdowntextblock is row
- else
- {
- res = Markdown_Row();
- }
- tabdatafromdatabase.MarkdownMode2 = res; //left right / top bottom
- tabdatafromdatabase.MarkdownIsColumn = tabdatafromdatabase.MarkdownIsColumn; //Is column
- }
- private void Markdown_UpdateRotation()
- {
- if (!MarkdownRoatation)
- {
- MarkdownRoatation = true;
- tabdatafromdatabase.MarkdownIsColumn = false;
- GridSplitter_GripperBar.Height = 5;
- GridSplitter_GripperBar.Width = 25;
- Markdown_Button_Rotation.Angle = 90;
- Markdown_Button_Rotation.CenterY = 0;
- SetGridRows();
- GridsplitterSettingsFlyout.Margin = new Thickness(100, 0, 0, 0);
- }
- else
- {
- MarkdownRoatation = false;
- tabdatafromdatabase.MarkdownIsColumn = true;
- GridSplitter_GripperBar.Height = 25;
- GridSplitter_GripperBar.Width = 5;
- Markdown_Button_Rotation.Angle = 0;
- Markdown_Button_Rotation.CenterY = 14;
- SetGridColumns();
- GridsplitterSettingsFlyout.Margin = new Thickness(0, -135, 0, 0);
- }
- }
- private void UpdateMarkdownSize()
- {
- if (MarkdownPreview)
- {
- if (tabdatafromdatabase.MarkdownIsColumn)
- {
- Splittedview_Splitter.Width = 16;
- Splittedview_Splitter.Height = this.ActualHeight;
- }
- else
- {
- Splittedview_Splitter.Height = 16;
- Splittedview_Splitter.Width = this.ActualWidth;
- }
- UpdateLineHighlighter();
- }
- }
- private void ToggleLeftRight_Markdown_Click(object sender, RoutedEventArgs e)
- {
- Markdown_ToggleLeftRight();
- UpdateMarkdownSize();
- }
- private void Rotate90Degree_Click(object sender, RoutedEventArgs e)
- {
- Markdown_UpdateRotation();
- Markdown_ToggleLeftRight();
- UpdateMarkdownSize();
- }
- private void CloseMarkdown_Click(object sender, RoutedEventArgs e)
- {
- MarkdownPreview = false;
- }
-
- //Selection:
- public string SelectedText
- {
- get { return textbox.Document.Selection.Text; }
- set { textbox.Document.Selection.Text = value; }
- }
- public int SelectionStart
- {
- get { return textbox.Document.Selection.StartPosition; }
- set { textbox.Document.Selection.StartPosition = value; }
- }
- public int SelectionLenght
- {
- get { return textbox.Document.Selection.Length; }
- }
- public void SetSelection(int StartIndex, int Lenght)
- {
- textbox.Document.Selection.SetRange(StartIndex, StartIndex + Lenght);
- }
- public void SelectAll()
- {
- SetSelection(0, GetText().Length);
- }
- public bool SelectionIsMultiline()
- {
- return textbox.Document.Selection.Text.Contains("\r") || textbox.Document.Selection.Text.Contains("\n");
- }
-
- //Zoom actions:
- private double __zoomFactor = 100;
- public double _zoomFactor { get => __zoomFactor; set { __zoomFactor = value; tabdatafromdatabase.ZoomFactor = value; } }
- public void SetFontZoomFactor(double ZoomFactor)
- {
- var fontZoomFactor = Math.Round(ZoomFactor);
- if (fontZoomFactor >= DefaultValues.MinZoom && fontZoomFactor <= DefaultValues.MaxZoom)
- {
- FontSize = fontZoomFactor / 100 * appsettings.GetSettingsAsInt("FontSize", DefaultValues.DefaultFontsize);
- _zoomFactor = ZoomFactor;
- }
- }
- public void ZoomIn(double Factor)
- {
- if (_zoomFactor < DefaultValues.MaxZoom)
- {
- if (_zoomFactor % 10 > 0)
- {
- SetFontZoomFactor(Math.Ceiling(_zoomFactor / 10) * 10);
- }
- else
- {
- FontSize += Factor * appsettings.GetSettingsAsInt("FontSize", DefaultValues.DefaultFontsize);
- }
- }
- }
- public void ZoomOut(double Factor)
- {
- if (_zoomFactor > DefaultValues.MinZoom)
- {
- if (_zoomFactor % 10 > 0)
- {
- SetFontZoomFactor(Math.Floor(_zoomFactor / 10) * 10);
- }
- else
- {
- FontSize -= Factor * appsettings.GetSettingsAsInt("FontSize", DefaultValues.DefaultFontsize);
- }
- }
- }
-
- //Cursorposition & Linenumbering
- public int GetCurrentLineNumber
- {
- get
- {
- return textbox.Document.Selection.GetIndex(TextRangeUnit.Paragraph);
- }
- }
- public int GetLinesCount
- {
- get
- {
- return GetText().Split('\r', '\n').Length;
- }
- }
- public string[] GetLineNumberContent
- {
- get
- {
- return GetText().Split('\r', '\n');
- }
- }
- public double GetSingleLineHeight()
- {
- textbox.Document.GetRange(0, 0).GetRect(PointOptions.ClientCoordinates, out var rect, out _);
- return rect.Height <= 0 ? 1.35 * textbox.FontSize : rect.Height;
- }
- public int CountWords(string text = null)
- {
- if (text == null)
- {
- text = GetText();
- }
-
- return text.Split(new char[] { '\n', ' ', '\r' }, StringSplitOptions.RemoveEmptyEntries).Length;
- }
-
- //Scrollbar-Positions
- public ScrollbarPositions GetScrollbarPositions()
- {
- if (MainContentScrollViewer != null)
- {
- return new ScrollbarPositions
- {
- ScrollbarPositionHorizontal = MainContentScrollViewer.HorizontalOffset,
- ScrollbarPositionVertical = MainContentScrollViewer.VerticalOffset
- };
- }
- else
- {
- return new ScrollbarPositions
- {
- ScrollbarPositionHorizontal = 0,
- ScrollbarPositionVertical = 0
- };
- }
- }
- public void SetScrollbarPositions(ScrollbarPositions pos, bool DisableAnimations = false)
- {
- if (MainContentScrollViewer != null)
- {
- MainContentScrollViewer.ChangeView(pos.ScrollbarPositionHorizontal, pos.ScrollbarPositionVertical, null, DisableAnimations);
- }
- }
- public void ScrollIntoView()
- {
- if (MainContentScrollViewer != null)
- {
- double vOffset = MainContentScrollViewer.VerticalOffset + this.ActualHeight / 2;
- MainContentScrollViewer.ChangeView(null, vOffset, null, true);
- }
- }
-
- //Undo-Redo
- public void Undo()
- {
- textbox.Document.Undo();
- }
- public void Redo()
- {
- textbox.Document.Redo();
- }
-
- //Basic Textediting:
- public void Copy()
- {
- void DoCopy(string text = null)
- {
- var dataPackage = new DataPackage();
- dataPackage.SetText(text == null ? textbox.Document.Selection.Text : text);
- Clipboard.SetContentWithOptions(
- dataPackage,
- new ClipboardContentOptions()
- {
- IsAllowedInHistory = true,
- IsRoamable = true
- });
- try
- {
- Clipboard.Flush();
- }
- catch (Exception e)
- {
- Debug.WriteLine("Exception in TextControlBox --> Copy:" + "\n" + e.Message);
- }
- }
- if (textbox.Document.Selection.Length == 0)
- {
- DoCopy(GetLineNumberContent[GetCurrentLineNumber-1]);
- }
- else
- {
- DoCopy();
- }
- }
- public void DuplicateLine()
- {
- if (textbox.Document.Selection.Length == 0)
- {
- textbox.Document.Selection.SetIndex(TextRangeUnit.Paragraph, GetCurrentLineNumber, false);
- string selectedtext = GetLineNumberContent[GetCurrentLineNumber-1];
- textbox.Document.Selection.Text = selectedtext + "\n";
- SetSelection(SelectionStart + (selectedtext.Length*2)+1, 0);
- }
- else
- {
- SetSelection(SelectionStart, 0);
- DuplicateLine();
- }
- }
- public async void Paste()
- {
- if (!IsReadOnly)
- {
- DataPackageView dataPackageView = Clipboard.GetContent();
- if (dataPackageView.Contains(StandardDataFormats.Text))
- {
- string text = await dataPackageView.GetTextAsync();
- if (SelectionLenght > 0)
- {
- textbox.Document.Selection.Text = "";
- }
-
- textbox.Document.Selection.Text = text;
- textbox.Document.Selection.SetRange(SelectionStart + text.Length, SelectionStart + text.Length);
- }
- }
- }
- public void Cut()
- {
- if (!IsReadOnly)
- {
- if (textbox.Document.Selection.Length == 0)
- {
- var CurrentSelStart = SelectionStart;
-
- SelectLine(GetCurrentLineNumber);
- textbox.Document.Selection.Cut();
- SetSelection(CurrentSelStart, 0);
-
- }
- else
- {
- textbox.Document.Selection.Cut();
- }
- }
- }
- public void SurroundSelectionBy(string surroundtext)
- {
- textbox.Document.Selection.Text = surroundtext + SelectedText + surroundtext;
- }
- public void SurroundSelectionBy(string surroundtext1, string surroundtext2)
- {
- textbox.Document.Selection.Text = surroundtext1 + SelectedText + surroundtext2;
- }
-
- //Info-Toast
- public void ShowInfoToast(bool ShowSavedMessage, string text = "")
- {
- ContentSavedInfo.IsOpen = true;
- ContentSavedInfo.Background = DefaultValues.ContentDialogBackgroundColor();
- ContentSavedInfo.Foreground = DefaultValues.ContentDialogForegroundColor();
- if (text.Length == 0 || ShowSavedMessage)
- {
- ContentSavedInfo.Title = appsettings.GetResourceString("Toast_SaveSucced/Text");
- }
- else
- {
- ContentSavedInfo.Title = text;
- }
-
- DispatcherTimer hidetoastTimer = new DispatcherTimer
- {
- Interval = new TimeSpan(0, 0, 0, DefaultValues.TextBoxInfoToast_Time)
- };
- hidetoastTimer.Stop();
- hidetoastTimer.Tick += delegate
- {
- hidetoastTimer.Stop();
- ContentSavedInfo.IsOpen = false;
- };
- hidetoastTimer.Start();
- }
-
- //Set & Get text
- ///
- /// Get the text of the textbox
- ///
- /// The text
- public string GetText()
- {
- if (!TextLoaded)
- {
- return TextBuffer;
- }
- textbox.Document.GetText(TextGetOptions.None, out string out1);
- if (out1.Length != 0)
- {
- out1 = out1.Remove(out1.Length - 1, 1);
- }
- if (out1 == null)
- return "";
- return out1;
- }
- ///
- /// Set text to textbox
- ///
- /// The text to set to
- public async Task SetText(string text, bool ismodified = false)
- {
- await this.Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
- {
- bool isreadonly = IsReadOnly;
- if (isreadonly)
- textbox.IsReadOnly = false;
-
- textbox.Document.SetText(TextSetOptions.None, text);
- TextBeforeLastSaved = GetText();
- IsModified = ismodified;
- textbox.TextDocument.ClearUndoRedoHistory();
- if (isreadonly == true)
- textbox.IsReadOnly = isreadonly;
- });
- }
- ///
- /// Overrides the whole text, but the modified state stays
- ///
- ///
- ///
- public async Task ChangeText(string text, TextSetOptions textSetOptions = TextSetOptions.None)
- {
- await this.Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
- {
- bool isreadonly = IsReadOnly;
- if (isreadonly)
- textbox.IsReadOnly = false;
-
- textbox.Document.SetText(textSetOptions, text);
-
- if (isreadonly == true)
- textbox.IsReadOnly = isreadonly;
- });
- }
-
- //Replace text
- public bool ReplaceInText(string Word, string ReplaceWord, bool Up, bool MatchCase, bool WholeWord)
- {
- if (Word.Length == 0)
- {
- return false;
- }
-
- bool res = FindInText(Word, Up, MatchCase, WholeWord);
- if (res)
- {
- SelectedText = ReplaceWord;
- }
-
- return res;
- }
- public bool ReplaceAll(string Word, string ReplaceWord, bool Up, bool MatchCase, bool WholeWord)
- {
-
- if (Word.Length == 0)
- {
- return false;
- }
-
- int selstart = SelectionStart, sellenght = SelectionLenght;
-
- if (!WholeWord)
- {
- SelectAll();
- if (MatchCase)
- {
- SelectedText = GetText().Replace(Word, ReplaceWord);
- }
- else
- {
- SelectedText = GetText().Replace(Word.ToLower(), ReplaceWord.ToLower());
- }
-
- return true;
- }
-
- SetSelection(0, 0);
- bool res = true;
- while (res)
- {
- res = ReplaceInText(Word, ReplaceWord, Up, MatchCase, WholeWord);
- }
-
- SetSelection(selstart, sellenght);
- return true;
- }
-
- ///
- /// Selects a word in the textbox text
- ///
- /// The Word to search for
- /// The searchdirection: Up / Down
- ///
- ///
- /// The Text to search in. If null it uses the textbox text
- ///
- public bool FindInText(string Word, bool Up, bool MatchCase, bool WholeWord)
- {
- string Text = GetText();
- bool NotFound()
- {
- if (Word.Length > 20)
- {
- Word = Word.Substring(0, 20) + "... ";
- }
- SetSelection(0, 0);
- ShowInfoToast(false, Word + " " + InfoBarMessages.SearchNotFound);
- return false;
- }
- //Search down:
- if (!Up)
- {
- if (!MatchCase)
- {
- Text = Text.ToLower();
- Word = Word.ToLower();
- }
- if (SelectionStart == -1)
- {
- SelectionStart = 0;
- }
-
- int startpos = SelectionStart;
- if (SelectionLenght > 0)
- {
- startpos = SelectionStart + SelectionLenght;
- }
- if (Word.Length + startpos > Text.Length)
- {
- return NotFound();
- }
-
- int index = WholeWord ? Extensions.StringBuilder.IndexOfWholeWord(Text, Word, startpos) : Text.IndexOf(Word, startpos);
- if (index == -1)
- {
- return NotFound();
- }
- SetSelection(index, Word.Length);
- textbox.Document.Selection.ScrollIntoView(PointOptions.Start);
- return true;
- }
- else
- {
- try
- {
- if (!MatchCase)
- {
- Text = Text.ToLower();
- Word = Word.ToLower();
- }
- if (SelectionStart == -1)
- {
- SelectionStart = 0;
- }
-
- string shortedText = Text.Substring(0, SelectionStart);
- int index = WholeWord ? Extensions.StringBuilder.LastIndexOfWholeWord(shortedText, Word) : shortedText.LastIndexOf(Word);
- if (index == -1)
- {
- SetSelection(Text.Length, 0);
- return NotFound();
- }
-
- SetSelection(index, Word.Length);
- textbox.Document.Selection.ScrollIntoView(PointOptions.Start);
- return true;
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Exception in TextControlBox --> FindInText:" + "\n" + ex.Message);
- return false;
- }
- }
- }
-
- //Go to line
- public bool GoToLine(int line)
- {
- if (appsettings.GetSettingsAsBool("SelectLineAfterGoingToIt", true))
- {
- SelectLine(line);
- }
- else
- {
- textbox.Document.Selection.SetIndex(TextRangeUnit.Paragraph, line, false);
- textbox.Focus(FocusState.Programmatic);
- }
- textbox.Document.Selection.ScrollIntoView(PointOptions.None);
- return true;
- }
- public void SelectLine(int Line)
- {
- textbox.Document.Selection.SetIndex(TextRangeUnit.Paragraph, Line, true);
- }
-
- //Other
- public new void Focus(FocusState focusstate)
- {
- textbox.Focus(focusstate);
- }
- private void UpdateLineNumber()
- {
- if (GetCurrentLineNumber != OldLineNumber)
- {
- if (SelectionLenght > 0)
- {
- int linenumber = GetCurrentLineNumber + textbox.Document.Selection.Text.Split(new char[] { '\n', '\r' }).Length;
- LineNumberchangedEvent?.Invoke(this, linenumber);
- }
- else
- LineNumberchangedEvent?.Invoke(this, GetCurrentLineNumber);
-
- OldLineNumber = GetCurrentLineNumber;
- }
- }
- public void ScrollWithArrowKeys(VerticalAxis axis)
- {
- if (MainContentScrollViewer == null)
- return;
-
- if (axis == VerticalAxis.Up)
- {
- MainContentScrollViewer.ChangeView(null, MainContentScrollViewer.VerticalOffset - 10, null, true);
- }
- if (axis == VerticalAxis.Down)
- {
- MainContentScrollViewer.ChangeView(null, MainContentScrollViewer.VerticalOffset + 10, null, true);
- }
- }
-
- //Events
- public delegate void TextChanged(TextControlBox sender);
- public delegate void KeyPressed(TextControlBox sender, KeyRoutedEventArgs e);
- public delegate void ZoomChanged(TextControlBox sender, double ZoomFactor);
- public delegate void LineNumberChanged(TextControlBox sender, int CurrentLine);
- public delegate void DocumentTitleChanged(TextControlBox sender, string Header);
- public delegate void Pointer_Pressed(TextControlBox sender, PointerRoutedEventArgs e);
- public delegate void Encoding_Changed(TextControlBox sender, Encoding e);
- public delegate void SaveStatusChanged(TextControlBox sender, bool IsModified);
- public delegate void WordCountChanged(TextControlBox sender, int Words);
- public event KeyPressed KeyPressedEvent;
- public event ZoomChanged ZoomChangedEvent;
- public event LineNumberChanged LineNumberchangedEvent;
- public event DocumentTitleChanged DocumentTitleChangedEvent;
- public event Pointer_Pressed Pointer_PressedEvent;
- public event Encoding_Changed EncodingChangedEvent;
- public event TextChanged TextChangedevent;
- public event WordCountChanged WordCountChangedEvent;
- public event SaveStatusChanged SaveStatusChangedEvent;
- }
- public class MyRichEditBox : RichEditBox
- {
- public DependencyObject FindDependencyObject(string name)
- {
- return this.GetTemplateChild(name);
- }
- //Override the OnKeyDown class to make custom shortcuts and disable defaults
- protected override void OnKeyDown(KeyRoutedEventArgs e)
- {
- var ctrl = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control);
- var shift = Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift);
- if (ctrl.HasFlag(CoreVirtualKeyStates.Down))
- {
- if (e.Key == VirtualKey.Back ||
- e.Key == VirtualKey.Delete ||
- e.Key == VirtualKey.Enter ||
- e.Key == VirtualKey.Right ||
- e.Key == VirtualKey.Left ||
- e.Key == VirtualKey.Up ||
- e.Key == VirtualKey.Down)
- {
- base.OnKeyDown(e);
- }
- else
- {
- return;
- }
- }
- else if (e.Key == VirtualKey.Enter && shift.HasFlag(CoreVirtualKeyStates.Down))
- {
- return;
- }
- else
- {
- base.OnKeyDown(e);
- }
- }
- }
- public class SelectionPoint
- {
- public int SelectionStart { get; set; }
- public int SelectionLenght { get; set; }
- }
- public class TextBoxDocument
- {
- public string FilePath { get; set; }
- public string DataBaseName { get; set; }
- public string Header { get; set; }
- public bool IsModified { get; set; }
- public bool IsHandWritingEnabled { get; set; }
- public TabSaveMode TabSaveMode { get; set; }
- public string FileToken { get; set; }
- public StorageFile Storagefile { get; set; }
- public TextWrapping WordWrap { get; set; }
- public string TempFile { get; set; }
- public Encoding Encoding { get; set; }
- public double ZoomFactor { get; set; }
- public bool IsReadonly { get; set; }
- public string InternalTabName { get; set; }
- }
-}
diff --git a/Fastedit/Controls/Textbox/TextControlBoxFlyoutMenu.cs b/Fastedit/Controls/Textbox/TextControlBoxFlyoutMenu.cs
deleted file mode 100644
index 2f805f6..0000000
--- a/Fastedit/Controls/Textbox/TextControlBoxFlyoutMenu.cs
+++ /dev/null
@@ -1,235 +0,0 @@
-using Fastedit.Dialogs;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using Windows.UI.Popups;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using muxc = Microsoft.UI.Xaml.Controls;
-
-namespace Fastedit.Controls.Textbox
-{
- public class TextControlBoxFlyoutMenu
- {
- private List buttons = null;
- private AppSettings appsettings = new AppSettings();
- private TextControlBox textbox = null;
-
- public TextControlBoxFlyoutMenu(TextControlBox textbox)
- {
- buttons = CreateButtons(textbox);
- this.textbox = textbox;
- }
-
- /*
- //Retrive from settings and create the flyout
- public List CreateListFromSettings()
- {
- try
- {
- List Items = new List();
-
- string Buttons = appsettings.GetSettingsAsString("TextControlBoxFlyout", "");
- if (Buttons.Length == 0)
- return null;
-
- var split = Buttons.Split("|", StringSplitOptions.RemoveEmptyEntries);
- for (int j = 0; j < split.Length; j++)
- {
- Items.Add(split[j]);
- }
- return Items;
- }
- catch(Exception e)
- {
- Debug.WriteLine("CreateListFromSettings : " + e.Message);
- return null;
- }
- }
- public MenuFlyout CreateFlyoutFromList(List items)
- {
- try
- {
- var flyout = new MenuFlyout();
- flyout.Placement = Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode.BottomEdgeAlignedLeft;
- flyout.ShowMode = Windows.UI.Xaml.Controls.Primitives.FlyoutShowMode.TransientWithDismissOnPointerMoveAway;
- if (items == null)
- return null;
-
- for (int i = 0; i < items.Count; i++)
- {
- if (items[i].Contains("Separator", System.StringComparison.Ordinal))
- {
- flyout.Items.Add(new MenuFlyoutSeparator());
- }
- else
- {
- flyout.Items.Add(GetButtonFromList(items[i]));
- }
- }
- return flyout;
- }
- catch (Exception e)
- {
- Debug.WriteLine("CreateFlyoutFromList : " + e.Message);
- return null;
- }
- }
- */
- public List CreateButtons(TextControlBox textbox)
- {
- List lst = new List();
- string CopyText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_Copy/Text");
- string PasteText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_Paste/Text");
- string CutText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_Cut/Text");
- string UndoText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_Undo/Text");
- string SelectAllText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_SelectAll/Text");
- var CopyBtn = new MenuFlyoutItem { Name = "Copy", Text = CopyText, Icon = new SymbolIcon { Symbol = Symbol.Copy } };
- var CutBtn = new MenuFlyoutItem { Name = "Cut", Text = CutText, Icon = new SymbolIcon { Symbol = Symbol.Cut } };
- var FindText = new MenuFlyoutItem { Name = "Find", Text = "Find", Icon = new SymbolIcon { Symbol = Symbol.Find } };
- var ShareText = new MenuFlyoutItem { Name = "Share", Text = "Share selected", Icon = new SymbolIcon { Symbol = Symbol.Share } };
- var PasteBtn = new MenuFlyoutItem { Name = "Paste", Text = PasteText, Icon = new SymbolIcon { Symbol = Symbol.Paste } };
- var UndoBtn = new MenuFlyoutItem { Name = "Undo", Text = UndoText, Icon = new SymbolIcon { Symbol = Symbol.Undo } };
- var Selectall = new MenuFlyoutItem { Name = "SelectAll", Text = SelectAllText, Icon = new SymbolIcon { Symbol = Symbol.SelectAll } };
- ToolTipService.SetToolTip(CopyBtn, CopyText);
- ToolTipService.SetToolTip(PasteBtn, PasteText);
- ToolTipService.SetToolTip(CutBtn, CutText);
- ToolTipService.SetToolTip(UndoBtn, UndoText);
- ToolTipService.SetToolTip(Selectall, SelectAllText);
- ToolTipService.SetToolTip(ShareText, "Share the selected text");
- lst.Add(CopyBtn);
- lst.Add(PasteBtn);
- lst.Add(CutBtn);
- lst.Add(UndoBtn);
- lst.Add(Selectall);
- lst.Add(ShareText);
- lst.Add(FindText);
- //Only create the buttons, without the events:
- //if (textbox == null)
- // return lst;
-
- CopyBtn.Click += delegate
- {
- textbox.Copy();
- };
- PasteBtn.Click += delegate
- {
- textbox.Paste();
- };
- CutBtn.Click += delegate
- {
- textbox.Cut();
- };
- UndoBtn.Click += delegate
- {
- textbox.Undo();
- };
- Selectall.Click += delegate
- {
- textbox.SelectAll();
- };
- ShareText.Click += delegate
- {
- ShareFile.ShareText(textbox.SelectedText);
- };
- FindText.Click += delegate
- {
- textbox.FindInText(textbox.SelectedText, false, false, false);
- };
- return lst;
- }
- public MenuFlyoutItem GetButtonFromList(string name)
- {
- return buttons.Find(item => item.Name == name);
- }
-
- public MenuFlyout CreateFlyout(bool SelectionFlyout)
- {
- if (textbox == null)
- return null;
-
- if (buttons == null)
- buttons = CreateButtons(textbox);
- var flyout = new MenuFlyout();
- flyout.Placement = Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode.BottomEdgeAlignedLeft;
- flyout.ShowMode = Windows.UI.Xaml.Controls.Primitives.FlyoutShowMode.TransientWithDismissOnPointerMoveAway;
- //if text is selected
- if (SelectionFlyout)
- {
- flyout.Items.Add(GetButtonFromList("Copy"));
- flyout.Items.Add(GetButtonFromList("Cut"));
- flyout.Items.Add(GetButtonFromList("Paste"));
- flyout.Items.Add(new MenuFlyoutSeparator());
- flyout.Items.Add(GetButtonFromList("Find"));
- flyout.Items.Add(GetButtonFromList("Share"));
- flyout.Items.Add(new MenuFlyoutSeparator());
- flyout.Items.Add(GetButtonFromList("Undo"));
- flyout.Items.Add(GetButtonFromList("SelectAll"));
- }
- else //if no text is selected
- {
- flyout.Items.Add(GetButtonFromList("Copy"));
- flyout.Items.Add(GetButtonFromList("Cut"));
- flyout.Items.Add(GetButtonFromList("Paste"));
- flyout.Items.Add(new MenuFlyoutSeparator());
- flyout.Items.Add(GetButtonFromList("Undo"));
- flyout.Items.Add(GetButtonFromList("SelectAll"));
- }
- return flyout;
- //return CreateFlyoutFromList(CreateListFromSettings());
- }
-
- public CommandBarFlyout CreateSelectionFlyout()
- {
- if (textbox == null)
- return null;
-
- if (buttons == null)
- buttons = CreateButtons(textbox);
-
- string CopyText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_Copy/Text");
- string PasteText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_Paste/Text");
- string CutText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_Cut/Text");
- string UndoText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_Undo/Text");
- string SelectAllText = AppSettings.GetResourceStringStatic("TextControlBoxFlyoutMenu_SelectAll/Text");
- var CopyBtn = new AppBarButton { Name = "Copy", Label = CopyText, Icon = new SymbolIcon { Symbol = Symbol.Copy }, LabelPosition = CommandBarLabelPosition.Collapsed };
- var CutBtn = new AppBarButton { Name = "Cut", Label = CutText, Icon = new SymbolIcon { Symbol = Symbol.Cut }, LabelPosition = CommandBarLabelPosition.Collapsed };
- var FindText = new AppBarButton { Name = "Find", Label = "Find", Icon = new SymbolIcon { Symbol = Symbol.Find }, LabelPosition = CommandBarLabelPosition.Collapsed };
- var ShareText = new AppBarButton { Name = "Share", Label = "Share selected", Icon = new SymbolIcon { Symbol = Symbol.Share }, LabelPosition =CommandBarLabelPosition.Collapsed };
- ToolTipService.SetToolTip(CopyBtn, CopyText);
- ToolTipService.SetToolTip(CutBtn, CutText);
- ToolTipService.SetToolTip(ShareText, "Share selected");
- ToolTipService.SetToolTip(FindText, "Find selected");
-
- ShareText.Click += delegate
- {
- ShareFile.ShareText(textbox.SelectedText);
- };
- FindText.Click += delegate
- {
- textbox.FindInText(textbox.SelectedText, false, false, false);
- };
- CutBtn.Click += delegate
- {
- textbox.Cut();
- };
- CopyBtn.Click += delegate
- {
- textbox.Copy();
- };
- var flyout = new CommandBarFlyout();
- flyout.PrimaryCommands.Add(CopyBtn);
- flyout.PrimaryCommands.Add(CutBtn);
- flyout.PrimaryCommands.Add(ShareText);
- flyout.PrimaryCommands.Add(FindText);
- return flyout;
- }
- }
- //public class TextControlBoxFlyout_Button
- //{
- // public string ButtonName { get; set; }
- // public string Text { get; set; } = "";
- // public bool IsOn { get; set; } = false;
- // public string CheckBoxName { get; set; } = "";
- //}
-}
diff --git a/Fastedit/Core/DefaultValues.cs b/Fastedit/Core/DefaultValues.cs
deleted file mode 100644
index 125b1aa..0000000
--- a/Fastedit/Core/DefaultValues.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-using System;
-using Windows.Storage;
-using Windows.UI;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Markup;
-using Windows.UI.Xaml.Media;
-
-namespace Fastedit.Core
-{
- public class DefaultValues
- {
- //MainPage
- public static string LocalFolderPath = ApplicationData.Current.LocalFolder.Path.ToString();
- public static int AutoSaveTempFileMinutes = 4;
- public static int AutoBackupDataBaseMinutes = 4;
- public static CornerRadius DefaultDialogCornerRadius = new CornerRadius(5);
- public static bool LoadRecentTabsOnStart = true;
- public static SolidColorBrush WrongInput_Color = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
- public static SolidColorBrush CorrectInput_Color = new SolidColorBrush(Color.FromArgb(255, 0, 255, 0));
- public static string DefaultThemeName = "Acrylic-Dark.fasteditdesign";
- public static string DefaultWindows11ThemeName = "Mica-Accentcolor.fasteditdesign";
- public static int TextBoxInfoToast_Time = 3; //How long the infotoast is displayed on the textbox until it gets closed
-
- //Tab Actions
- public static CornerRadius DefaultTabCornerRadius = new CornerRadius(5, 5, 0, 0);
- public static double DefaultZoomFactor = 0.2;
- public static int MaxZoom = 300;
- public static int MinZoom = 20;
- public static int MinFontWithZoom = 2;
- public static int MaxFontWithZoom = 120;
- public static string NewDocName = "Untitled.txt";
- public static bool HandWritingEnabled = false;
- public static string DefaultTabSize = "\t";
- public static string DefaultTabIconId = "\uE8A5";
-
- //SetttingsPage
- public static bool SpellCheckingEnabled = false;
- public static int DefaultFontsize = 16;
- public static int defaultTabSizeMode = 0; //0-2
- public static string DefaultFontFamily = "Consolas";
-
- public static string CustomDesigns_FolderName = "Designs";
- public static string Database_FolderName = "DataBase";
- public static string RecycleBin_FolderName = "RecycleBin";
- public static string Backup_FolderName = "Backup";
- public static string Extension_FasteditDesign = ".fasteditdesign";
-
- //Colors
- public static Color SystemAccentColor
- {
- get
- {
- return (Color)XamlBindingHelper.ConvertValue(typeof(Color), Application.Current.Resources["SystemAccentColor"].ToString());
- }
- }
- public static Color SystemAccentColorLight1
- {
- get
- {
- return (Color)XamlBindingHelper.ConvertValue(typeof(Color), Application.Current.Resources["SystemAccentColorLight1"].ToString());
- }
- }
- public static Color SystemAccentColorDark2
- {
- get
- {
- return (Color)XamlBindingHelper.ConvertValue(typeof(Color), Application.Current.Resources["SystemAccentColorDark2"].ToString());
- }
- }
- public static Color SystemAccentColorDark1
- {
- get
- {
- return (Color)XamlBindingHelper.ConvertValue(typeof(Color), Application.Current.Resources["SystemAccentColorDark1"].ToString());
- }
- }
- public static Color SystemAccentColorLight2
- {
- get
- {
- try
- {
- var color = Application.Current.Resources["SystemAccentColorLight2"];
- if (color != null)
- {
- return (Color)XamlBindingHelper.ConvertValue(typeof(Color), Application.Current.Resources["SystemAccentColorLight2"].ToString());
- }
- return Color.FromArgb(0, 0, 0, 0);
- }
- catch
- {
- return Color.FromArgb(0, 0, 0, 0);
- }
- }
- }
-
- public static Color SetColorTransparency(Color clr, int Transparency)
- {
- return Color.FromArgb((byte)Transparency, clr.R, clr.G, clr.B);
- }
-
- public static Color DefaultTextColor = SystemAccentColorLight2;
- public static Color DefaultTextSelectionColor = SystemAccentColor;
- public static Color DefaultTextBackgroundColor = Color.FromArgb(0, 0, 0, 0);
- public static Color DefaultCommandBarBackgroundColor = SystemAccentColorLight2;
- public static Color DefaultTabColorNotFocused = Color.FromArgb(0, 0, 0, 0);
- public static Color DefaultTabColorFocused
- {
- get
- {
- return Color.FromArgb(120, SystemAccentColorDark2.R, SystemAccentColorDark2.G, SystemAccentColorDark2.B); ;
- }
- }
-
- public static Color DefaultAppBackgroundColor = SystemAccentColor;
- public static Color DefaultTitleBarBackgroundColor = SystemAccentColor;
- public static Color DefaultLineNumberForegroundColor = Colors.LightGray;
- public static Color DefaultLineNumberBackgroundColor = Color.FromArgb(10, 0, 0, 0);
- public static Color DefaultDialogBackground = SystemAccentColor;
- public static Color DefaultStatusbarForegroundColor = Color.FromArgb(255, 255, 255, 255);
- public static Color DefaultStatusbarBackgroundColor = Color.FromArgb(100, 0, 0, 0);
-
- public static Brush ContentDialogBackgroundColor()
- {
- AppSettings appsettings = new AppSettings();
- return appsettings.CreateBrushWithOrWithoutAcrylic(
- appsettings.GetSettingsAsColorWithDefault("DialogBackgroundColor", DefaultDialogBackground));
- }
- public static SolidColorBrush ContentDialogForegroundColor()
- {
- AppSettings appsettings = new AppSettings();
- return new SolidColorBrush(Extensions.Convert.WhiteOrBlackFromColorBrightness(
- appsettings.GetSettingsAsColorWithDefault("DialogBackgroundColor", DefaultDialogBackground)
- ));
- }
- public static ElementTheme ContentDialogTheme()
- {
- AppSettings appsettings = new AppSettings();
- return (ElementTheme)Enum.Parse(typeof(ElementTheme), appsettings.GetSettingsAsInt("ThemeIndex", 0).ToString());
- }
- }
-}
diff --git a/Fastedit/Core/Tab/TabActions.cs b/Fastedit/Core/Tab/TabActions.cs
deleted file mode 100644
index f64588c..0000000
--- a/Fastedit/Core/Tab/TabActions.cs
+++ /dev/null
@@ -1,1320 +0,0 @@
-using Fastedit.Controls.Textbox;
-using Fastedit.Dialogs;
-using Fastedit.Extensions;
-using Fastedit.Helper;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Numerics;
-using System.Runtime.InteropServices.WindowsRuntime;
-using System.Text;
-using System.Threading.Tasks;
-using Windows.ApplicationModel.Activation;
-using Windows.Storage;
-using Windows.Storage.AccessCache;
-using Windows.Storage.Pickers;
-using Windows.UI.Popups;
-using Windows.UI.ViewManagement;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Shapes;
-using static System.Net.WebRequestMethods;
-using muxc = Microsoft.UI.Xaml.Controls;
-using Path = System.IO.Path;
-using StringBuilder = Fastedit.Extensions.StringBuilder;
-
-namespace Fastedit.Core.Tab
-{
- public class TabActions
- {
- //Class implementations
- private readonly muxc.TabView TextTabControl;
- private readonly static AppSettings appsettings = new AppSettings();
- private readonly static TabDataBase tabdatabase = new TabDataBase();
- private readonly MainPage mainpage = null;
- private readonly static TabPageHelper tabpagehelper = new TabPageHelper();
- private readonly static SaveFileHelper savefilehelper = new SaveFileHelper();
- private StorageFolder DatabaseFolder = null;
- //Other variables
- public muxc.TabViewItem SettingsTabPage = null;
- private readonly DispatcherTimer CloseTabsTimerToSaveDatabase = new DispatcherTimer
- {
- Interval = new TimeSpan(0, 0, 0, 5)
- };
-
- public void ShowInfobar(string Content, string Title = "", muxc.InfoBarSeverity severity = muxc.InfoBarSeverity.Warning, int Time = 5)
- {
- mainpage.ShowInfobar(Content, Title, severity, Time);
- }
- public void ShowInfobar(muxc.InfoBar infobar)
- {
- mainpage.ShowInfobar(infobar);
- }
-
- //Initialisation
- public TabActions(muxc.TabView TabControl, MainPage mainpage = null)
- {
- this.mainpage = mainpage;
- if (this.mainpage == null)
- this.mainpage = new MainPage();
-
- TextTabControl = TabControl;
- CloseTabsTimerToSaveDatabase.Tick += CloseTabsTimerToSaveDatabase_Tick;
- }
-
- public bool SettingsPageOpened()
- {
- return SettingsTabPage != null;
- }
- public int GetTabItemCount()
- {
- if (SettingsPageOpened())
- {
- return TextTabControl.TabItems.Count - 1;
- }
- else
- {
- return TextTabControl.TabItems.Count;
- }
- }
- public object[] GetTabItemArray()
- {
- if (SettingsPageOpened())
- {
- var lst = TextTabControl.TabItems.ToList();
- lst.Remove(SettingsTabPage);
- return lst.ToArray();
- }
- else
- {
- return TextTabControl.TabItems.ToArray();
- }
- }
- public IList