diff --git a/AvaloniaStyles/AvaloniaStyles.csproj b/AvaloniaStyles/AvaloniaStyles.csproj index 2190fc70d..578cc28fd 100644 --- a/AvaloniaStyles/AvaloniaStyles.csproj +++ b/AvaloniaStyles/AvaloniaStyles.csproj @@ -2,7 +2,7 @@ WinExe - net5.0;net6.0 + net6.0 Debug;Release AnyCPU enable diff --git a/LoaderAvalonia/LoaderAvalonia.csproj b/LoaderAvalonia/LoaderAvalonia.csproj index 177b47cfd..756542c0e 100644 --- a/LoaderAvalonia/LoaderAvalonia.csproj +++ b/LoaderAvalonia/LoaderAvalonia.csproj @@ -1,12 +1,14 @@ - Exe - net5.0;net6.0 + WinExe + net6.0 Debug;Release AnyCPU - + + ..\bin\$(Configuration)\ + @@ -57,7 +59,7 @@ - + diff --git a/LoaderAvalonia/Program.cs b/LoaderAvalonia/Program.cs index d44541121..92340fe13 100644 --- a/LoaderAvalonia/Program.cs +++ b/LoaderAvalonia/Program.cs @@ -4,6 +4,7 @@ public class Program { public static void Main(string[] args) { + WoWDatabaseEditorCore.Avalonia.Program.Main(args); } } } \ No newline at end of file diff --git a/LoaderWPF/LoaderWPF.csproj b/LoaderWPF/LoaderWPF.csproj deleted file mode 100644 index 6038d0da2..000000000 --- a/LoaderWPF/LoaderWPF.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - WinExe - net5.0-windows7.0 - true - Debug;Release - AnyCPU - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/LoaderWPF/Program.cs b/LoaderWPF/Program.cs deleted file mode 100644 index d4ce9282f..000000000 --- a/LoaderWPF/Program.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoaderWPF -{ - public class Program - { - public static void Main(string[] args) - { - } - } -} \ No newline at end of file diff --git a/README.md b/README.md index 16bed0b25..515528089 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,7 @@ Application has a built-in auto updater, so you do **not** have to redownload a ## Mac OS / Linux / Windows version -**To run the editor, you need [.NET 5 Runtime](https://dotnet.microsoft.com/download/dotnet/5.0) for your OS**. - -**Future versions will require [.NET 6 Runtime](https://dotnet.microsoft.com/download/dotnet/6.0), we recommend to install it now already**. +**To run the editor, you need [.NET 6 Runtime](https://dotnet.microsoft.com/download/dotnet/6.0) for your OS**. WoW Database Editor is compatibile with both MacOS, Linux and Windows. @@ -50,19 +48,19 @@ WoW Database Editor is using [git submodules](https://git-scm.com/book/en/v2/Git git submodule update --init --recursive ``` -Now you can open the solution in Visual Studio or other C#/.NET IDE and build. Start "WoWDatabaseCore.Avalonia" project +Now you can open the solution in Visual Studio or other C#/.NET IDE and build. Start **LoaderAvalonia** project (this part is important!) **To build a version to distribute:** ``` -- Windows version -dotnet publish -c Release --self-contained false -f net5.0 -o bin/wowdatabaseeditor-avalonia-win/ LoaderAvalonia/LoaderAvalonia.csproj -r win7-x64 +dotnet publish -c Release --self-contained false -f net6.0 -o bin/wowdatabaseeditor-avalonia-win/ LoaderAvalonia/LoaderAvalonia.csproj -r win7-x64 -- MacOS version -dotnet publish -c Release --self-contained false -f net5.0 -o bin/wowdatabaseeditor-avalonia-mac/ LoaderAvalonia/LoaderAvalonia.csproj -r osx-x64 +dotnet publish -c Release --self-contained false -f net6.0 -o bin/wowdatabaseeditor-avalonia-mac/ LoaderAvalonia/LoaderAvalonia.csproj -r osx-x64 -- Linux version -dotnet publish -c Release --self-contained false -f net5.0 -o bin/wowdatabaseeditor-avalonia-linux/ LoaderAvalonia/LoaderAvalonia.csproj -r linux-x64 +dotnet publish -c Release --self-contained false -f net6.0 -o bin/wowdatabaseeditor-avalonia-linux/ LoaderAvalonia/LoaderAvalonia.csproj -r linux-x64 ``` diff --git a/Rendering/OpenGLBindings/OpenGLBindings.csproj b/Rendering/OpenGLBindings/OpenGLBindings.csproj index 5efbd877b..eb2460e91 100644 --- a/Rendering/OpenGLBindings/OpenGLBindings.csproj +++ b/Rendering/OpenGLBindings/OpenGLBindings.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable enable diff --git a/Rendering/TheAvaloniaOpenGL/TheAvaloniaOpenGL.csproj b/Rendering/TheAvaloniaOpenGL/TheAvaloniaOpenGL.csproj index 126cd1267..08e6b35c3 100644 --- a/Rendering/TheAvaloniaOpenGL/TheAvaloniaOpenGL.csproj +++ b/Rendering/TheAvaloniaOpenGL/TheAvaloniaOpenGL.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable enable true diff --git a/Rendering/TheEngine/TheEngine.csproj b/Rendering/TheEngine/TheEngine.csproj index ee17eecde..df36d1145 100644 --- a/Rendering/TheEngine/TheEngine.csproj +++ b/Rendering/TheEngine/TheEngine.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable enable true diff --git a/Rendering/TheMaths/TheMaths.csproj b/Rendering/TheMaths/TheMaths.csproj index 22292f330..4e8188e94 100644 --- a/Rendering/TheMaths/TheMaths.csproj +++ b/Rendering/TheMaths/TheMaths.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable enable true diff --git a/Updater/Updater.csproj b/Updater/Updater.csproj index b2164204c..0801ddfb4 100644 --- a/Updater/Updater.csproj +++ b/Updater/Updater.csproj @@ -1,6 +1,6 @@ - net5.0;net6.0 + net6.0 Exe false enable diff --git a/WDE.AzerothCore/WDE.AzerothCore.csproj b/WDE.AzerothCore/WDE.AzerothCore.csproj index 3c53d6455..1ce068f02 100644 --- a/WDE.AzerothCore/WDE.AzerothCore.csproj +++ b/WDE.AzerothCore/WDE.AzerothCore.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library enable nullable diff --git a/WDE.Common.Avalonia/WDE.Common.Avalonia.csproj b/WDE.Common.Avalonia/WDE.Common.Avalonia.csproj index 742ee7f47..045e3db61 100644 --- a/WDE.Common.Avalonia/WDE.Common.Avalonia.csproj +++ b/WDE.Common.Avalonia/WDE.Common.Avalonia.csproj @@ -1,7 +1,7 @@  Library - net5.0 + net6.0 Debug;Release AnyCPU enable diff --git a/WDE.Common.WPF/AssemblyInfo.cs b/WDE.Common.WPF/AssemblyInfo.cs deleted file mode 100644 index cf0b89ecd..000000000 --- a/WDE.Common.WPF/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Windows; - -[assembly: ThemeInfo(ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] \ No newline at end of file diff --git a/WDE.Common.WPF/Attached/GongDragAndDrop.cs b/WDE.Common.WPF/Attached/GongDragAndDrop.cs deleted file mode 100644 index eb87f1340..000000000 --- a/WDE.Common.WPF/Attached/GongDragAndDrop.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Windows; -using CommonDrag = WDE.Common.Utils.DragDrop; -using GongDrag = GongSolutions.Wpf.DragDrop; -using DragDropEffects = System.Windows.DragDropEffects; - -namespace WDE.Common.WPF.Attached -{ - public static class GongDragAndDrop - { - public static readonly DependencyProperty WdeDropHandlerProperty = DependencyProperty.RegisterAttached("WdeDropHandler", - typeof(CommonDrag.IDropTarget), - typeof(GongDragAndDrop), - new FrameworkPropertyMetadata(null, OnWdeDropHandlerChanged)); - - public static object GetWdeDropHandler(DependencyObject d) - { - return d.GetValue(WdeDropHandlerProperty); - } - - public static void SetWdeDropHandler(DependencyObject d, object value) - { - d.SetValue(WdeDropHandlerProperty, value); - } - - private static void OnWdeDropHandlerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var adapter = new DragTargetAdapter((CommonDrag.IDropTarget)e.NewValue); - d.SetValue(GongDrag.DragDrop.DropHandlerProperty, adapter); - } - - internal static CommonDrag.RelativeInsertPosition ToCommon(this GongDrag.RelativeInsertPosition position) - { - CommonDrag.RelativeInsertPosition dest = CommonDrag.RelativeInsertPosition.None; - if (position.HasFlag(GongDrag.RelativeInsertPosition.AfterTargetItem)) - dest |= CommonDrag.RelativeInsertPosition.AfterTargetItem; - if (position.HasFlag(GongDrag.RelativeInsertPosition.BeforeTargetItem)) - dest |= CommonDrag.RelativeInsertPosition.BeforeTargetItem; - if (position.HasFlag(GongDrag.RelativeInsertPosition.TargetItemCenter)) - dest |= CommonDrag.RelativeInsertPosition.TargetItemCenter; - - return dest; - } - - internal static GongDrag.RelativeInsertPosition ToGong(this CommonDrag.RelativeInsertPosition position) - { - GongDrag.RelativeInsertPosition dest = GongDrag.RelativeInsertPosition.None; - if (position.HasFlag(CommonDrag.RelativeInsertPosition.AfterTargetItem)) - dest |= GongDrag.RelativeInsertPosition.AfterTargetItem; - if (position.HasFlag(CommonDrag.RelativeInsertPosition.BeforeTargetItem)) - dest |= GongDrag.RelativeInsertPosition.BeforeTargetItem; - if (position.HasFlag(CommonDrag.RelativeInsertPosition.TargetItemCenter)) - dest |= GongDrag.RelativeInsertPosition.TargetItemCenter; - - return dest; - } - - internal static Type ToGong(this CommonDrag.DropTargetAdorners adorner) - { - switch (adorner) - { - case CommonDrag.DropTargetAdorners.Highlight: - return GongDrag.DropTargetAdorners.Highlight; - case CommonDrag.DropTargetAdorners.Insert: - return GongDrag.DropTargetAdorners.Insert; - default: - throw new ArgumentOutOfRangeException(nameof(adorner), adorner, null); - } - } - - internal static CommonDrag.DragDropEffects ToCommon(this System.Windows.DragDropEffects effect) - { - switch (effect) - { - case DragDropEffects.Scroll: - return Common.Utils.DragDrop.DragDropEffects.Scroll; - case DragDropEffects.All: - return Common.Utils.DragDrop.DragDropEffects.All; - case DragDropEffects.None: - return Common.Utils.DragDrop.DragDropEffects.None; - case DragDropEffects.Copy: - return Common.Utils.DragDrop.DragDropEffects.Copy; - case DragDropEffects.Move: - return Common.Utils.DragDrop.DragDropEffects.Move; - case DragDropEffects.Link: - return Common.Utils.DragDrop.DragDropEffects.Link; - default: - throw new ArgumentOutOfRangeException(); - } - } - - internal static DragDropEffects ToWindows(this CommonDrag.DragDropEffects effect) - { - switch (effect) - { - case Common.Utils.DragDrop.DragDropEffects.Scroll: - return DragDropEffects.Scroll; - case Common.Utils.DragDrop.DragDropEffects.All: - return DragDropEffects.All; - case Common.Utils.DragDrop.DragDropEffects.None: - return DragDropEffects.None; - case Common.Utils.DragDrop.DragDropEffects.Copy: - return DragDropEffects.Copy; - case Common.Utils.DragDrop.DragDropEffects.Move: - return DragDropEffects.Move; - case Common.Utils.DragDrop.DragDropEffects.Link: - return DragDropEffects.Link; - default: - throw new ArgumentOutOfRangeException(); - } - } - - private class DragTargetAdapter : GongDrag.IDropTarget - { - private readonly CommonDrag.IDropTarget target; - - public DragTargetAdapter(CommonDrag.IDropTarget target) - { - this.target = target; - } - - public void DragOver(GongDrag.IDropInfo dropInfo) - { - var adapter = new DropInfoAdapter(dropInfo); - target.DragOver(adapter); - dropInfo.Effects = adapter.Effects.ToWindows(); - dropInfo.DropTargetAdorner = adapter.DropTargetAdorner.ToGong(); - } - - public void Drop(GongDrag.IDropInfo dropInfo) - { - var adapter = new DropInfoAdapter(dropInfo); - target.Drop(adapter); - } - } - - private class DropInfoAdapter : CommonDrag.IDropInfo - { - public DropInfoAdapter(GongDrag.IDropInfo dropInfo) - { - Data = dropInfo.Data; - TargetItem = dropInfo.TargetItem; - InsertIndex = dropInfo.InsertIndex; - if (dropInfo.DropTargetAdorner == GongDrag.DropTargetAdorners.Highlight) - DropTargetAdorner = CommonDrag.DropTargetAdorners.Highlight; - else if (dropInfo.DropTargetAdorner == GongDrag.DropTargetAdorners.Insert) - DropTargetAdorner = CommonDrag.DropTargetAdorners.Insert; - Effects = dropInfo.Effects.ToCommon(); - InsertPosition = dropInfo.InsertPosition.ToCommon(); - } - - public object Data { get; internal set; } - public object? TargetItem { get; internal set; } - public int InsertIndex { get; internal set; } - public CommonDrag.DropTargetAdorners DropTargetAdorner { get; set; } - public CommonDrag.DragDropEffects Effects { get; set; } - public CommonDrag.RelativeInsertPosition InsertPosition { get; set; } - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Attached/SmartFormattedText.cs b/WDE.Common.WPF/Attached/SmartFormattedText.cs deleted file mode 100644 index c0396ef19..000000000 --- a/WDE.Common.WPF/Attached/SmartFormattedText.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; - -namespace WDE.Common.WPF.Attached -{ - public class SmartFormattedText - { - public static string GetText(DependencyObject obj) => (string)obj.GetValue(TextProperty); - public static void SetText(DependencyObject obj, string value) => obj.SetValue(TextProperty, value); - public static readonly DependencyProperty TextProperty = - DependencyProperty.RegisterAttached("Text", typeof(string), typeof(SmartFormattedText), new PropertyMetadata("", AllowOnlyString)); - - public static Style GetParamStyle(DependencyObject obj) => (Style)obj.GetValue(ParamStyleProperty); - public static void SetParamStyle(DependencyObject obj, Style value) => obj.SetValue(ParamStyleProperty, value); - public static readonly DependencyProperty ParamStyleProperty = - DependencyProperty.RegisterAttached("ParamStyle", typeof(Style), typeof(SmartFormattedText), new PropertyMetadata(null, AllowOnlyString)); - - public static IList GetContextArray(DependencyObject obj) => (IList)obj.GetValue(ContextArrayProperty); - public static void SetContextArray(DependencyObject obj, IList value) => obj.SetValue(ContextArrayProperty, value); - public static readonly DependencyProperty ContextArrayProperty = - DependencyProperty.RegisterAttached("ContextArray", typeof(IList), typeof(SmartFormattedText), new PropertyMetadata(null, AllowOnlyString)); - - - public static Style GetSourceStyle(DependencyObject obj) => (Style)obj.GetValue(SourceStyleProperty); - public static void SetSourceStyle(DependencyObject obj, Style value) => obj.SetValue(SourceStyleProperty, value); - public static readonly DependencyProperty SourceStyleProperty = - DependencyProperty.RegisterAttached("SourceStyle", typeof(Style), typeof(SmartFormattedText), new PropertyMetadata(null, AllowOnlyString)); - - - private static void AllowOnlyString(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is TextBlock tb) - { - var text = GetText(d); - var paramStyle = GetParamStyle(d); - var sourceStyle = GetSourceStyle(d); - var contextArray = GetContextArray(d); - - tb.Inlines.Clear(); - if (text == null) - return; - - bool changeRun = false; - int start = 0; - State state = State.Text; - Styles currentStyle = Styles.Normal; - int currentContextIndex = -1; - Run? lastRun = null; - - void Append(string s) - { - if (lastRun != null && !changeRun) - { - lastRun.Text += s; - return; - } - - lastRun = new Run(s); - - if (contextArray != null && currentContextIndex >= 0 && currentContextIndex < contextArray.Count) - lastRun.DataContext = contextArray[currentContextIndex]; - else - lastRun.DataContext = null; - - if (currentStyle.HasFlag(Styles.Parameter) && paramStyle != null) - lastRun.Style = paramStyle; - - if (currentStyle.HasFlag(Styles.Source) && sourceStyle != null) - lastRun.Style = sourceStyle; - - changeRun = false; - - tb.Inlines.Add(lastRun); - } - - for (int i = 0; i < text.Length; i++) - { - char l = text[i]; - if (l == '\\' && state == State.Text) - { - Append(text.Substring(start, i - start)); - start = i + 1; - state = State.Slash; - } - else if (l == '[' && state == State.Text) - { - Append(text.Substring(start, i - start)); - changeRun = true; - currentContextIndex = -1; - start = i + 1; - state = State.OpeningTag; - } - else if (l == '/' && state == State.OpeningTag) - { - start = i + 1; - state = State.InClosingTag; - } - else if (l != ']' && state == State.OpeningTag) - { - state = State.InTag; - } - else if (l == ']' && state == State.InTag) - { - if (text[start] == 'p') - { - currentStyle = currentStyle | Styles.Parameter; - } - else if (text[start] == 's') - { - currentStyle = currentStyle | Styles.Source; - } - - if (text[start + 1] == '=' && char.IsDigit(text[start + 2])) - currentContextIndex = text[start + 2] - '0'; - - start = i + 1; - state = State.Text; - } - else if (l == ']' && state == State.InClosingTag) - { - if (text[start] == 'p') - currentStyle = currentStyle & ~Styles.Parameter; - else if (text[start] == 's') - currentStyle = currentStyle & ~Styles.Source; - - start = i + 1; - state = State.Text; - } - else if (state == State.Slash) - { - state = State.Text; - } - } - - if (state == State.Text) - Append(text.Substring(start)); - } - } - - enum State - { - Text, - Slash, - OpeningTag, - InTag, - InClosingTag - } - - [Flags] - enum Styles - { - Normal = 0, - Source = 1, - Parameter = 2 - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/CommonWpfModule.cs b/WDE.Common.WPF/CommonWpfModule.cs deleted file mode 100644 index 0fb1e2e23..000000000 --- a/WDE.Common.WPF/CommonWpfModule.cs +++ /dev/null @@ -1,9 +0,0 @@ -using WDE.Module; - -namespace WDE.Common.WPF -{ - public class CommonWpfModule : ModuleBase - { - - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Components/ParameterValueHolderView.cs b/WDE.Common.WPF/Components/ParameterValueHolderView.cs deleted file mode 100644 index e45dab083..000000000 --- a/WDE.Common.WPF/Components/ParameterValueHolderView.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace WDE.Common.WPF.Components -{ - public class ParameterValueHolderView : Control - { - public ICommand PickCommand - { - get => (ICommand)GetValue(PickCommandProperty); - set => SetValue(PickCommandProperty, value); - } - - public static readonly DependencyProperty PickCommandProperty = - DependencyProperty.Register("PickCommand", typeof(ICommand), typeof(ParameterValueHolderView)); - - static ParameterValueHolderView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(ParameterValueHolderView), new FrameworkPropertyMetadata(typeof(ParameterValueHolderView))); - } - } -} diff --git a/WDE.Common.WPF/Components/TeachingTip.cs b/WDE.Common.WPF/Components/TeachingTip.cs deleted file mode 100644 index bef591007..000000000 --- a/WDE.Common.WPF/Components/TeachingTip.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace WDE.Common.WPF.Components -{ - public class TeachingTip : Control - { - public static readonly DependencyProperty ContentProperty = - DependencyProperty.Register("Content", typeof(object), typeof(TeachingTip)); - - public object Content - { - get => GetValue(ContentProperty); - set => SetValue(ContentProperty, value); - } - - public static readonly DependencyProperty HeaderProperty = - DependencyProperty.Register("Header", typeof(string), typeof(TeachingTip)); - - public bool IsOpened - { - get => (bool)GetValue(IsOpenedProperty); - set => SetValue(IsOpenedProperty, value); - } - - public static readonly DependencyProperty IsOpenedProperty = - DependencyProperty.Register("IsOpened", typeof(bool), typeof(TeachingTip)); - - public string Header - { - get => (string)GetValue(HeaderProperty); - set => SetValue(HeaderProperty, value); - } - - public ICommand CloseCommand { get; } - - public TeachingTip() - { - CloseCommand = new DelegateCommand(() => - { - IsOpened = false; - }); - } - - static TeachingTip() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(TeachingTip), new FrameworkPropertyMetadata(typeof(TeachingTip))); - } - } - - internal class DelegateCommand : ICommand - { - private readonly Action action; - - public DelegateCommand(System.Action action) - { - this.action = action; - } - - public bool CanExecute(object? parameter) - { - return true; - } - - public void Execute(object? parameter) - { - action?.Invoke(); - } - - public event EventHandler? CanExecuteChanged; - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Components/WdeImage.cs b/WDE.Common.WPF/Components/WdeImage.cs deleted file mode 100644 index e44ceabc7..000000000 --- a/WDE.Common.WPF/Components/WdeImage.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media.Imaging; -using WDE.Common.Types; - -namespace WDE.Common.WPF.Components -{ - public class WdeImage : Image - { - // we are never releasing those intentionally - private static Dictionary cache = new(); - - public ImageUri Image - { - get => (ImageUri) GetValue(ImageProperty); - set => SetValue(ImageProperty, value); - } - - public static readonly DependencyProperty ImageProperty = - DependencyProperty.Register( - nameof(Image), - typeof(ImageUri), - typeof(WdeImage), - new FrameworkPropertyMetadata( - default(ImageUri), - FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, - new PropertyChangedCallback(OnSourceChanged), - null), - null); - - private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var img = (ImageUri)d.GetValue(ImageProperty); - if (!cache.TryGetValue(img, out var bitmap)) - { - bitmap = cache[img] = - new BitmapImage(new Uri(System.IO.Path.Combine(Environment.CurrentDirectory, img.Uri), UriKind.Absolute)); - } - d.SetValue(SourceProperty, bitmap); - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Converters/BoolToDoubleConverter.cs b/WDE.Common.WPF/Converters/BoolToDoubleConverter.cs deleted file mode 100644 index 9a0322bda..000000000 --- a/WDE.Common.WPF/Converters/BoolToDoubleConverter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace WDE.Common.WPF.Converters -{ - public class BoolToDoubleConverter : IValueConverter - { - public double WhenTrue { get; set; } = 1; - public double WhenFalse { get; set; } = 0; - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var flag = false; - if (value is bool) - flag = (bool) value; - return flag ? WhenTrue : WhenFalse; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is double d) - { - if (d == WhenTrue) - return true; - if (d == WhenFalse) - return false; - } - - return false; - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Converters/DataTimeToStringConverter.cs b/WDE.Common.WPF/Converters/DataTimeToStringConverter.cs deleted file mode 100644 index f22e38e27..000000000 --- a/WDE.Common.WPF/Converters/DataTimeToStringConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace WDE.Common.WPF.Converters -{ - public class DataTimeToStringConverter : IValueConverter - { - public string Format { get; set; } = "m"; - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is DateTime dt) - return dt.ToString(Format); - return "not a date"; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Converters/NativeTextDocumentConverter.cs b/WDE.Common.WPF/Converters/NativeTextDocumentConverter.cs deleted file mode 100644 index 04e462590..000000000 --- a/WDE.Common.WPF/Converters/NativeTextDocumentConverter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using ICSharpCode.AvalonEdit.Document; -using WDE.Common.WPF.Types; - -namespace WDE.Common.WPF.Converters -{ - public class NativeTextDocumentConverter : IValueConverter - { - public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is NativeTextDocument text) - return text.Native; - return null; - } - - public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is TextDocument doc) - return new NativeTextDocument(doc); - return null; - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Converters/NullConverter.cs b/WDE.Common.WPF/Converters/NullConverter.cs deleted file mode 100644 index 97e6f218c..000000000 --- a/WDE.Common.WPF/Converters/NullConverter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace WDE.Common.WPF.Converters -{ - public class NullConverter : IValueConverter - { - public bool Inverted { get; set; } - - public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var isNull = value == null; - return Inverted ? !isNull : isNull; - } - - public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new Exception(); - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Themes/Generic.xaml b/WDE.Common.WPF/Themes/Generic.xaml deleted file mode 100644 index 52e40be89..000000000 --- a/WDE.Common.WPF/Themes/Generic.xaml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - Do not worry, you won't see this tooltip again. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WDE.Common.WPF/Themes/ParameterDataTemplateSelector.cs b/WDE.Common.WPF/Themes/ParameterDataTemplateSelector.cs deleted file mode 100644 index 5b248ddff..000000000 --- a/WDE.Common.WPF/Themes/ParameterDataTemplateSelector.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using WDE.Parameters; -using WDE.Parameters.Models; - -namespace WDE.Common.WPF.Themes -{ - internal class ParameterDataTemplateSelector : DataTemplateSelector - { - public DataTemplate? Generic { get; set; } - public DataTemplate? BoolParameter { get; set; } - - public override DataTemplate SelectTemplate(object item, DependencyObject container) - { - if (item is ParameterValueHolder intParam && intParam.Parameter is BoolParameter boolParameter && BoolParameter != null) - return BoolParameter; - return Generic!; - } - } - -} diff --git a/WDE.Common.WPF/Types/NativeTextDocument.cs b/WDE.Common.WPF/Types/NativeTextDocument.cs deleted file mode 100644 index 988efb86b..000000000 --- a/WDE.Common.WPF/Types/NativeTextDocument.cs +++ /dev/null @@ -1,41 +0,0 @@ -using ICSharpCode.AvalonEdit.Document; -using WDE.Common.Types; -using WDE.Module.Attributes; -using WDE.MVVM; -using System; - -namespace WDE.Common.WPF.Types -{ - // no single instance! - [AutoRegister] - public class NativeTextDocument : INativeTextDocument - { - public TextDocument Native { get; } - - public IObservable Length => Native.ToObservable(n => n.TextLength); - - public NativeTextDocument() : this(new TextDocument()) { } - - public NativeTextDocument(TextDocument document) - { - Native = document; - } - - public void FromString(string str) - { - Native.Text = str; - } - - public void Append(string str) - { - Native.BeginUpdate(); - Native.Insert(Native.TextLength, str); - Native.EndUpdate(); - } - - public override string ToString() - { - return Native.Text; - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Utils/GridUtils.cs b/WDE.Common.WPF/Utils/GridUtils.cs deleted file mode 100644 index fae11ec6a..000000000 --- a/WDE.Common.WPF/Utils/GridUtils.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Controls; - -namespace WDE.Common.WPF.Utils -{ - public static class GridUtils - { - public static string GetRows(DependencyObject obj) => (string)obj.GetValue(RowsProperty); - public static void SetRows(DependencyObject obj, string value) => obj.SetValue(RowsProperty, value); - public static readonly DependencyProperty RowsProperty = - DependencyProperty.RegisterAttached("Rows", typeof(string), typeof(GridUtils), new PropertyMetadata("", UpdateRows)); - - public static string GetColumns(DependencyObject obj) => (string)obj.GetValue(ColumnsProperty); - public static void SetColumns(DependencyObject obj, string value) => obj.SetValue(ColumnsProperty, value); - public static readonly DependencyProperty ColumnsProperty = - DependencyProperty.RegisterAttached("Columns", typeof(string), typeof(GridUtils), new PropertyMetadata("", UpdateColumns)); - - private static void UpdateColumns(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (!(d is Grid grid)) - return; - - var columns = GetColumns(d).Split(","); - - for (int i = grid.ColumnDefinitions.Count; i < columns.Length; ++i) - grid.ColumnDefinitions.Add(new ColumnDefinition()); - - while (grid.ColumnDefinitions.Count > columns.Length) - grid.ColumnDefinitions.RemoveAt(grid.ColumnDefinitions.Count - 1); - - for (var index = 0; index < columns.Length; index++) - { - var column = columns[index]; - var length = ParseLength(column); - if (length != null) - grid.ColumnDefinitions[index].Width = length.Value; - } - } - - private static void UpdateRows(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (!(d is Grid grid)) - return; - - var rows = GetRows(d).Split(","); - - for (int i = grid.RowDefinitions.Count; i < rows.Length; ++i) - grid.RowDefinitions.Add(new RowDefinition()); - - while (grid.RowDefinitions.Count > rows.Length) - grid.RowDefinitions.RemoveAt(grid.RowDefinitions.Count - 1); - - for (var index = 0; index < rows.Length; index++) - { - var row = rows[index]; - var length = ParseLength(row); - if (length != null) - grid.RowDefinitions[index].Height = length.Value; - } - } - - private static GridLength? ParseLength(string text) - { - if (text == "auto") - return GridLength.Auto; - - if (text[^1] == '*') - { - if (double.TryParse(((ReadOnlySpan) text).Slice(0, text.Length - 1), NumberStyles.Any, CultureInfo.InvariantCulture, out var length )) - return new GridLength(length, GridUnitType.Auto); - } - else if (double.TryParse(text,NumberStyles.Any, CultureInfo.InvariantCulture, out var length)) - { - return new GridLength(length, GridUnitType.Pixel); - } - - return null; - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Utils/LoadingSpinner.xaml b/WDE.Common.WPF/Utils/LoadingSpinner.xaml deleted file mode 100644 index 96601f9f2..000000000 --- a/WDE.Common.WPF/Utils/LoadingSpinner.xaml +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WDE.Common.WPF/Utils/LoadingSpinner.xaml.cs b/WDE.Common.WPF/Utils/LoadingSpinner.xaml.cs deleted file mode 100644 index 93fc75b96..000000000 --- a/WDE.Common.WPF/Utils/LoadingSpinner.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace WDE.Common.WPF.Utils -{ - public partial class LoadingSpinner : UserControl - { - public LoadingSpinner() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/Utils/ViewBind.cs b/WDE.Common.WPF/Utils/ViewBind.cs deleted file mode 100644 index b6424bcd7..000000000 --- a/WDE.Common.WPF/Utils/ViewBind.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Linq; -using System.Windows; -using System.Windows.Markup; -using WDE.Common.Windows; - -namespace WDE.Common.WPF.Utils -{ - public class ViewBind - { - public static IViewLocator? AppViewLocator { get; set; } - - public static readonly DependencyProperty ModelProperty = DependencyProperty.RegisterAttached("Model", - typeof(object), - typeof(ViewBind), - new PropertyMetadata(null, OnModelChanged)); - - public static object GetModel(DependencyObject element) - { - return element.GetValue(ModelProperty); - } - - public static void SetModel(DependencyObject element, object value) - { - element.SetValue(ModelProperty, value); - } - - private static void OnModelChanged(DependencyObject targetLocation, DependencyPropertyChangedEventArgs args) - { - if (args.OldValue == args.NewValue) - return; - - if (AppViewLocator != null && AppViewLocator.TryResolve(args.NewValue?.GetType()!, out var viewType)) - { - object? view = Activator.CreateInstance(viewType); - SetContentProperty(targetLocation, view); - } - else - SetContentProperty(targetLocation, null); - } - - private static bool SetContentProperty(object targetLocation, object? view) - { - try - { - Type? type = targetLocation.GetType(); - ContentPropertyAttribute? contentProperty = type.GetCustomAttributes(typeof(ContentPropertyAttribute), true) - .OfType() - .FirstOrDefault() ?? new ContentPropertyAttribute("Content"); - - type.GetProperty(contentProperty?.Name ?? new ContentPropertyAttribute("Content").Name) - ?.SetValue(targetLocation, view, null); - - return true; - } - catch (Exception e) - { - throw e; - } - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/ViewHelpers/BoolToVisibilityConverter.cs b/WDE.Common.WPF/ViewHelpers/BoolToVisibilityConverter.cs deleted file mode 100644 index 6937d52ba..000000000 --- a/WDE.Common.WPF/ViewHelpers/BoolToVisibilityConverter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace WDE.Common.WPF.ViewHelpers -{ - public class BooleanToVisibilityConverter : IValueConverter - { - public Visibility WhenTrue { get; set; } = Visibility.Visible; - public Visibility WhenFalse { get; set; } = Visibility.Hidden; - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var flag = false; - if (value is bool) - flag = (bool) value; - return flag ? WhenTrue : WhenFalse; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is Visibility vis) - { - if (vis == WhenTrue) - return true; - if (vis == WhenFalse) - return false; - } - - return false; - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/ViewHelpers/GridViewColumns.cs b/WDE.Common.WPF/ViewHelpers/GridViewColumns.cs deleted file mode 100644 index 947608815..000000000 --- a/WDE.Common.WPF/ViewHelpers/GridViewColumns.cs +++ /dev/null @@ -1,327 +0,0 @@ -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.IO; -using System.Reflection; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Xml; -using WDE.Common.Types; -using XamlReader = System.Windows.Markup.XamlReader; - -#nullable disable -namespace WDE.Common.WPF.ViewHelpers -{ - //https://stackoverflow.com/questions/2643545/wpf-mvvm-how-to-bind-gridviewcolumn-to-viewmodel-collection - public static class GridViewColumns - { - // Using a DependencyProperty as the backing store for ColumnsSource. This enables animation, styling, binding, etc... - public static readonly DependencyProperty ColumnsSourceProperty = DependencyProperty.RegisterAttached("ColumnsSource", - typeof(object), - typeof(GridViewColumns), - new UIPropertyMetadata(null, ColumnsSourceChanged)); - - // Using a DependencyProperty as the backing store for HeaderTextMember. This enables animation, styling, binding, etc... - public static readonly DependencyProperty HeaderTextMemberProperty = - DependencyProperty.RegisterAttached("HeaderTextMember", - typeof(string), - typeof(GridViewColumns), - new UIPropertyMetadata(null)); - - // Using a DependencyProperty as the backing store for DisplayMember. This enables animation, styling, binding, etc... - public static readonly DependencyProperty DisplayMemberMemberProperty = - DependencyProperty.RegisterAttached("DisplayMemberMember", - typeof(string), - typeof(GridViewColumns), - new UIPropertyMetadata(null)); - - public static readonly DependencyProperty CheckboxMemberProperty = - DependencyProperty.RegisterAttached("CheckboxMember", - typeof(string), - typeof(GridViewColumns), - new UIPropertyMetadata(null)); - - public static readonly DependencyProperty ColumnHeadStyleNameProperty = - DependencyProperty.RegisterAttached("ColumnHeadStyleName", - typeof(string), - typeof(GridViewColumns), - new UIPropertyMetadata(null)); - - public static readonly DependencyProperty ColumnCellTemplateProperty = - DependencyProperty.RegisterAttached("ColumnCellTemplate", - typeof(DataTemplate), - typeof(GridViewColumns), - new UIPropertyMetadata(null)); - - private static readonly IDictionary> GridViewsByColumnsSource = - new Dictionary>(); - - [AttachedPropertyBrowsableForType(typeof(GridView))] - public static object GetColumnsSource(DependencyObject obj) - { - return obj.GetValue(ColumnsSourceProperty); - } - - public static void SetColumnsSource(DependencyObject obj, object value) - { - obj.SetValue(ColumnsSourceProperty, value); - } - - - [AttachedPropertyBrowsableForType(typeof(GridView))] - public static string GetHeaderTextMember(DependencyObject obj) - { - return (string) obj.GetValue(HeaderTextMemberProperty); - } - - public static void SetHeaderTextMember(DependencyObject obj, string value) - { - obj.SetValue(HeaderTextMemberProperty, value); - } - - - [AttachedPropertyBrowsableForType(typeof(GridView))] - public static string GetDisplayMemberMember(DependencyObject obj) - { - return (string) obj.GetValue(DisplayMemberMemberProperty); - } - - [AttachedPropertyBrowsableForType(typeof(GridView))] - public static string GetCheckboxMember(DependencyObject obj) - { - return (string) obj.GetValue(CheckboxMemberProperty); - } - - public static void SetDisplayMemberMember(DependencyObject obj, string value) - { - obj.SetValue(DisplayMemberMemberProperty, value); - } - - [AttachedPropertyBrowsableForType(typeof(GridView))] - public static string GetColumnHeadStyleName(DependencyObject obj) - { - return (string) obj.GetValue(ColumnHeadStyleNameProperty); - } - - public static void SetColumnHeadStyleName(DependencyObject obj, string value) - { - obj.SetValue(ColumnHeadStyleNameProperty, value); - } - - [AttachedPropertyBrowsableForType(typeof(GridView))] - public static DataTemplate GetColumnCellTemplate(DependencyObject obj) - { - return (DataTemplate) obj.GetValue(ColumnCellTemplateProperty); - } - - public static void SetColumnCellTemplate(DependencyObject obj, DataTemplate value) - { - obj.SetValue(ColumnCellTemplateProperty, value); - } - - private static void ColumnsSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) - { - GridView gridView = obj as GridView; - if (gridView != null) - { - gridView.Columns.Clear(); - - if (e.OldValue != null) - { - ICollectionView view = CollectionViewSource.GetDefaultView(e.OldValue); - //if (view != null) - //RemoveHandlers(gridView, view); - } - - if (e.NewValue != null) - { - ICollectionView view = CollectionViewSource.GetDefaultView(e.NewValue); - if (view != null) - { - //AddHandlers(gridView, view); - CreateColumns(gridView, view); - } - } - } - } - - private static List GetGridViewsForColumnSource(ICollectionView columnSource) - { - List gridViews; - if (!GridViewsByColumnsSource.TryGetValue(columnSource, out gridViews)) - { - gridViews = new List(); - GridViewsByColumnsSource.Add(columnSource, gridViews); - } - - return gridViews; - } - - private static void AddHandlers(GridView gridView, ICollectionView view) - { - GetGridViewsForColumnSource(view).Add(gridView); - view.CollectionChanged += ColumnsSource_CollectionChanged; - } - - private static void CreateColumns(GridView gridView, ICollectionView view) - { - foreach (object item in view) - { - GridViewColumn column = CreateColumn(gridView, item as ColumnDescriptor); - - gridView.Columns.Add(column); - } - } - - private static void RemoveHandlers(GridView gridView, ICollectionView view) - { - view.CollectionChanged -= ColumnsSource_CollectionChanged; - GetGridViewsForColumnSource(view).Remove(gridView); - } - - private static void ColumnsSource_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - ICollectionView view = sender as ICollectionView; - var gridViews = GetGridViewsForColumnSource(view); - if (gridViews == null || gridViews.Count == 0) - return; - - switch (e.Action) - { - case NotifyCollectionChangedAction.Add: - foreach (GridView gridView in gridViews) - { - for (var i = 0; i < e.NewItems.Count; i++) - { - GridViewColumn column = CreateColumn(gridView, e.NewItems[i] as ColumnDescriptor); - gridView.Columns.Insert(e.NewStartingIndex + i, column); - } - } - - break; - case NotifyCollectionChangedAction.Move: - foreach (GridView gridView in gridViews) - { - var columns = new List(); - for (var i = 0; i < e.OldItems.Count; i++) - { - GridViewColumn column = gridView.Columns[e.OldStartingIndex + i]; - columns.Add(column); - } - - for (var i = 0; i < e.NewItems.Count; i++) - { - GridViewColumn column = columns[i]; - gridView.Columns.Insert(e.NewStartingIndex + i, column); - } - } - - break; - case NotifyCollectionChangedAction.Remove: - foreach (GridView gridView in gridViews) - { - for (var i = 0; i < e.OldItems.Count; i++) - gridView.Columns.RemoveAt(e.OldStartingIndex); - } - - break; - case NotifyCollectionChangedAction.Replace: - foreach (GridView gridView in gridViews) - { - for (var i = 0; i < e.NewItems.Count; i++) - { - GridViewColumn column = CreateColumn(gridView, e.NewItems[i] as ColumnDescriptor); - gridView.Columns[e.NewStartingIndex + i] = column; - } - } - - break; - case NotifyCollectionChangedAction.Reset: - foreach (GridView gridView in gridViews) - { - gridView.Columns.Clear(); - CreateColumns(gridView, sender as ICollectionView); - } - - break; - } - } - - private static GridViewColumn CreateColumn(GridView gridView, ColumnDescriptor columnSource) - { - GridViewColumn column = new(); - - string headerTextMember = GetHeaderTextMember(gridView); - string displayMemberMember = GetDisplayMemberMember(gridView); - bool checkbox = columnSource.CheckboxMember; - string styleString = GetColumnHeadStyleName(gridView); - DataTemplate cellStyleTemplate = GetColumnCellTemplate(gridView); - column.Width = 90; - if (!string.IsNullOrEmpty(headerTextMember)) - column.Header = GetPropertyValue(columnSource, headerTextMember); - - if (!string.IsNullOrEmpty(displayMemberMember) && !checkbox) - { - var propertyName = GetPropertyValue(columnSource, displayMemberMember) as string; - var binding = new Binding(propertyName); - if (columnSource.OneTime) - binding.Mode = BindingMode.OneTime; - - if (cellStyleTemplate != null) - column.CellTemplate = CreateCellTemplate(cellStyleTemplate, binding); - else - column.DisplayMemberBinding = binding; - } - else if (checkbox) - { - var propertyName = GetPropertyValue(columnSource, displayMemberMember) as string; - StringReader stringReader = new(@" - - "); - XmlReader xmlReader = XmlReader.Create(stringReader); - column.CellTemplate = XamlReader.Load(xmlReader) as DataTemplate; - column.Width = 24; - } - - if (!string.IsNullOrEmpty(styleString)) - { - Style style = Application.Current.FindResource(styleString) as Style; - if (style != null) - column.HeaderContainerStyle = style; - } - - if (columnSource.PreferredWidth.HasValue) - column.Width = columnSource.PreferredWidth.Value; - else - { - // Set Widht to NaN in order to stretch it to match conent - column.Width = double.NaN; - } - - return column; - } - - private static object GetPropertyValue(object obj, string propertyName) - { - if (obj != null) - { - PropertyInfo prop = obj.GetType().GetProperty(propertyName); - if (prop != null) - return prop.GetValue(obj, null); - } - - return null; - } - - private static DataTemplate CreateCellTemplate(DataTemplate template, Binding binding) - { - var wrapper = new DataTemplate(); - var factory = new FrameworkElementFactory(typeof(ContentPresenter)); - factory.SetValue(ContentPresenter.ContentTemplateProperty, template); - factory.SetBinding(ContentPresenter.ContentProperty, binding); - wrapper.VisualTree = factory; - return wrapper; - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/ViewHelpers/IntInputValidationRule.cs b/WDE.Common.WPF/ViewHelpers/IntInputValidationRule.cs deleted file mode 100644 index 7acb1d7cd..000000000 --- a/WDE.Common.WPF/ViewHelpers/IntInputValidationRule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace WDE.Common.WPF.ViewHelpers -{ - public class IntInputValidationRule: ValidationRule - { - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - bool isValid = true; - if (value is string) - { - var strVal = (string)value; - var temp = 0; - isValid = Int32.TryParse(strVal, out temp); - } - else - isValid = false; - return new ValidationResult(isValid, "Violated int only input rule for input field!"); - } - } -} diff --git a/WDE.Common.WPF/ViewHelpers/InvertedBoolConverter.cs b/WDE.Common.WPF/ViewHelpers/InvertedBoolConverter.cs deleted file mode 100644 index 8f95847ee..000000000 --- a/WDE.Common.WPF/ViewHelpers/InvertedBoolConverter.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace WDE.Common.WPF.ViewHelpers -{ - public class InvertedBoolConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - bool val = (bool) value; - return !val; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/ViewHelpers/LongToBoolConverter.cs b/WDE.Common.WPF/ViewHelpers/LongToBoolConverter.cs deleted file mode 100644 index cbe0524d0..000000000 --- a/WDE.Common.WPF/ViewHelpers/LongToBoolConverter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace WDE.Common.WPF.ViewHelpers -{ - public class LongToBoolConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - try - { - var longVal = System.Convert.ToInt64(value); - return longVal > 0; - } - catch (Exception e) - { - return false; - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - try - { - bool boolVal = System.Convert.ToBoolean(value); - return boolVal ? 1 : 0; - } - catch (Exception e) - { - return false; - } - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/ViewHelpers/NullToVisibilityConverter.cs b/WDE.Common.WPF/ViewHelpers/NullToVisibilityConverter.cs deleted file mode 100644 index 5f4b70198..000000000 --- a/WDE.Common.WPF/ViewHelpers/NullToVisibilityConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace WDE.Common.WPF.ViewHelpers -{ - public class NullToVisibilityConverter : IValueConverter - { - public Visibility WhenNull { get; set; } = Visibility.Hidden; - public Visibility WhenNotNull { get; set; } = Visibility.Visible; - - public object Convert(object? value, Type targetType, object parameter, CultureInfo culture) - { - return value == null ? WhenNull : WhenNotNull; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/WDE.Common.WPF/ViewHelpers/StretchedTreeView.cs b/WDE.Common.WPF/ViewHelpers/StretchedTreeView.cs deleted file mode 100644 index c07fb214b..000000000 --- a/WDE.Common.WPF/ViewHelpers/StretchedTreeView.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Windows; -using System.Windows.Controls; - -namespace WDE.Common.WPF.ViewHelpers -{ - // https://stackoverflow.com/a/35557401 - public class StretchedTreeView: TreeView - { - protected override DependencyObject GetContainerForItemOverride() - { - return new StretchedTreeViewItem(); - } - - protected override bool IsItemItsOwnContainerOverride(object item) - { - return item is StretchedTreeViewItem; - } - } - - public class StretchedTreeViewItem: TreeViewItem - { - public StretchedTreeViewItem() - { - this.Loaded += new RoutedEventHandler(StretchingTreeViewItem_Loaded); - } - - private void StretchingTreeViewItem_Loaded(object sender, RoutedEventArgs e) - { - // The purpose of this code is to stretch the Header Content all the way accross the TreeView. - if (this.VisualChildrenCount > 0) - { - Grid? grid = this.GetVisualChild(0) as Grid; - if (grid != null && grid.ColumnDefinitions.Count == 3) - { - // Remove the middle column which is set to Auto and let it get replaced with the - // last column that is set to Star. - grid.ColumnDefinitions.RemoveAt(1); - } - } - } - - protected override DependencyObject GetContainerForItemOverride() - { - return new StretchedTreeViewItem(); - } - - protected override bool IsItemItsOwnContainerOverride(object item) - { - return item is StretchedTreeViewItem; - } - } -} diff --git a/WDE.Common.WPF/ViewHelpers/ViewItemDoubleClickCommand.cs b/WDE.Common.WPF/ViewHelpers/ViewItemDoubleClickCommand.cs deleted file mode 100644 index 4815fc6a3..000000000 --- a/WDE.Common.WPF/ViewHelpers/ViewItemDoubleClickCommand.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace WDE.Common.WPF.ViewHelpers -{ - public sealed class ViewItemDoubleClickCommand - { - public static readonly DependencyProperty CommandProperty = DependencyProperty.RegisterAttached( - "Command", typeof(ICommand), typeof(ViewItemDoubleClickCommand), new PropertyMetadata(default(ICommand), OnComandChanged)); - - public static void SetCommand(DependencyObject element, ICommand value) - { - element.SetValue(CommandProperty, value); - } - - public static ICommand GetCommand(DependencyObject element) - { - return (ICommand)element.GetValue(CommandProperty); - } - - public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.RegisterAttached( - "CommandParameter", typeof(object), typeof(ViewItemDoubleClickCommand), new PropertyMetadata(default(object))); - - public static void SetCommandParameter(DependencyObject element, object value) - { - element.SetValue(CommandParameterProperty, value); - } - - public static object GetCommandParameter(DependencyObject element) - { - return (object)element.GetValue(CommandParameterProperty); - } - - private static void OnComandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var c = d as Control; - if (c == null) - throw new InvalidOperationException($"can only be attached to {nameof(Control)}"); - c.MouseDoubleClick -= OnDoubleClick; - if (GetCommand(c) != null) - c.MouseDoubleClick += OnDoubleClick; - } - - private static void OnDoubleClick(object sender, MouseButtonEventArgs e) - { - var d = sender as DependencyObject; - if (d == null) - return; - var command = GetCommand(d); - if (command == null) - return; - var parameter = GetCommandParameter(d); - if (!command.CanExecute(parameter)) - return; - command.Execute(parameter); - } - } -} diff --git a/WDE.Common.WPF/WDE.Common.WPF.csproj b/WDE.Common.WPF/WDE.Common.WPF.csproj deleted file mode 100644 index 9efafe7ca..000000000 --- a/WDE.Common.WPF/WDE.Common.WPF.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net5.0-windows7.0 - Library - true - enable - nullable - Debug;Release - AnyCPU - - - - - - - - 6.1.0-preview1 - - - 2.3.2 - - - - diff --git a/WDE.CommonViews.Avalonia/WDE.CommonViews.Avalonia.csproj b/WDE.CommonViews.Avalonia/WDE.CommonViews.Avalonia.csproj index b4e3d22d0..63f780ed3 100644 --- a/WDE.CommonViews.Avalonia/WDE.CommonViews.Avalonia.csproj +++ b/WDE.CommonViews.Avalonia/WDE.CommonViews.Avalonia.csproj @@ -1,7 +1,7 @@  Library - net5.0 + net6.0 Debug;Release AnyCPU enable diff --git a/WDE.CommonViews.WPF/AssemblyInfo.cs b/WDE.CommonViews.WPF/AssemblyInfo.cs deleted file mode 100644 index cf0b89ecd..000000000 --- a/WDE.CommonViews.WPF/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Windows; - -[assembly: ThemeInfo(ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] \ No newline at end of file diff --git a/WDE.CommonViews.WPF/CommonViewsModule.cs b/WDE.CommonViews.WPF/CommonViewsModule.cs deleted file mode 100644 index 4272ef3c5..000000000 --- a/WDE.CommonViews.WPF/CommonViewsModule.cs +++ /dev/null @@ -1,49 +0,0 @@ -using WDE.Common.Windows; -using WDE.CommonViews.WPF.RemoteSOAP.Views; -using WDE.CommonViews.WPF.Updater; -using WDE.DbcStore.ViewModels; -using WDE.DbcStore.Views; -using WDE.HistoryWindow.ViewModels; -using WDE.HistoryWindow.Views; -using WDE.Module; -using WDE.MySqlDatabaseCommon.Tools; -using WDE.Parameters.ViewModels; -using WDE.Parameters.Views; -using WDE.RemoteSOAP.ViewModels; -using WDE.Solutions.Explorer.ViewModels; -using WDE.Solutions.Explorer.Views; -using WDE.SQLEditor.ViewModels; -using WDE.SQLEditor.Views; -using WDE.TrinityMySqlDatabase.Tools; -using WDE.TrinityMySqlDatabase.ViewModels; -using WDE.TrinityMySqlDatabase.Views; -using WDE.Updater.ViewModels; - -namespace WDE.CommonViews.WPF -{ - public class CommonViewsModule : ModuleBase - { - public override void RegisterViews(IViewLocator viewLocator) - { - // database - viewLocator.Bind(); - viewLocator.Bind(); - viewLocator.Bind(); - // solutions - viewLocator.Bind(); - // parameters - viewLocator.Bind(); - // history - viewLocator.Bind(); - // dbc store - viewLocator.Bind(); - // sql editor - viewLocator.Bind(); - // updater - viewLocator.Bind(); - viewLocator.Bind(); - // remote soap - viewLocator.Bind(); - } - } -} \ No newline at end of file diff --git a/WDE.CommonViews.WPF/DbcStore/Views/DBCConfigView.xaml b/WDE.CommonViews.WPF/DbcStore/Views/DBCConfigView.xaml deleted file mode 100644 index 64a0dea80..000000000 --- a/WDE.CommonViews.WPF/DbcStore/Views/DBCConfigView.xaml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WDE.CommonViews.WPF/DbcStore/Views/DBCConfigView.xaml.cs b/WDE.CommonViews.WPF/DbcStore/Views/DBCConfigView.xaml.cs deleted file mode 100644 index c7697934a..000000000 --- a/WDE.CommonViews.WPF/DbcStore/Views/DBCConfigView.xaml.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Controls; - -namespace WDE.DbcStore.Views -{ - /// - /// Interaction logic for DBCConfigView.xaml - /// - public partial class DBCConfigView : UserControl - { - public DBCConfigView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WDE.CommonViews.WPF/History/Views/HistoryView.xaml b/WDE.CommonViews.WPF/History/Views/HistoryView.xaml deleted file mode 100644 index 652de2508..000000000 --- a/WDE.CommonViews.WPF/History/Views/HistoryView.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WDE.CommonViews.WPF/History/Views/HistoryView.xaml.cs b/WDE.CommonViews.WPF/History/Views/HistoryView.xaml.cs deleted file mode 100644 index aa987a9c8..000000000 --- a/WDE.CommonViews.WPF/History/Views/HistoryView.xaml.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Controls; - -namespace WDE.HistoryWindow.Views -{ - /// - /// Interaction logic for HistoryView.xaml - /// - public partial class HistoryView : UserControl - { - public HistoryView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WDE.CommonViews.WPF/Parameters/Views/ParametersView.xaml b/WDE.CommonViews.WPF/Parameters/Views/ParametersView.xaml deleted file mode 100644 index 238cb5826..000000000 --- a/WDE.CommonViews.WPF/Parameters/Views/ParametersView.xaml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WDE.CommonViews.WPF/Parameters/Views/ParametersView.xaml.cs b/WDE.CommonViews.WPF/Parameters/Views/ParametersView.xaml.cs deleted file mode 100644 index cee432116..000000000 --- a/WDE.CommonViews.WPF/Parameters/Views/ParametersView.xaml.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Controls; - -namespace WDE.Parameters.Views -{ - /// - /// Interaction logic for ParametersView - /// - public partial class ParametersView : UserControl - { - public ParametersView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WDE.CommonViews.WPF/RemoteSOAP/Views/SoapConfigView.xaml b/WDE.CommonViews.WPF/RemoteSOAP/Views/SoapConfigView.xaml deleted file mode 100644 index 9333ac471..000000000 --- a/WDE.CommonViews.WPF/RemoteSOAP/Views/SoapConfigView.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WDE.CommonViews.WPF/TrinityMySqlDatabase/Tools/DebugQueryToolView.xaml.cs b/WDE.CommonViews.WPF/TrinityMySqlDatabase/Tools/DebugQueryToolView.xaml.cs deleted file mode 100644 index a9855a723..000000000 --- a/WDE.CommonViews.WPF/TrinityMySqlDatabase/Tools/DebugQueryToolView.xaml.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using WDE.MySqlDatabaseCommon.Tools; - -namespace WDE.TrinityMySqlDatabase.Tools -{ - public partial class DebugQueryToolView : UserControl - { - public DebugQueryToolView() - { - InitializeComponent(); - Loaded += OnLoaded; - Unloaded += OnUnloaded; - } - - private void OnUnloaded(object sender, RoutedEventArgs e) - { - if (DataContext is ICodeEditorViewModel codeEditorViewModel) - { - codeEditorViewModel.Clear -= CodeEditorViewModelOnClear; - codeEditorViewModel.ScrollToEnd -= CodeEditorViewModelOnScrollToEnd; - } - } - - private void OnLoaded(object sender, RoutedEventArgs e) - { - if (DataContext is ICodeEditorViewModel codeEditorViewModel){ - - codeEditorViewModel.Clear += CodeEditorViewModelOnClear; - codeEditorViewModel.ScrollToEnd += CodeEditorViewModelOnScrollToEnd; - } - } - - private void CodeEditorViewModelOnClear() - { - if (MyAvalonEdit?.Document == null || MyAvalonEdit?.TextArea == null) - return; - - MyAvalonEdit.Clear(); - } - - private void CodeEditorViewModelOnScrollToEnd() - { - if (MyAvalonEdit?.Document == null || MyAvalonEdit?.TextArea == null) - return; - - MyAvalonEdit.CaretOffset = MyAvalonEdit.Document.TextLength; - MyAvalonEdit.TextArea.Caret.BringCaretToView(); - } - } -} \ No newline at end of file diff --git a/WDE.CommonViews.WPF/TrinityMySqlDatabase/Views/DatabaseConfigView.xaml b/WDE.CommonViews.WPF/TrinityMySqlDatabase/Views/DatabaseConfigView.xaml deleted file mode 100644 index b7865770e..000000000 --- a/WDE.CommonViews.WPF/TrinityMySqlDatabase/Views/DatabaseConfigView.xaml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WDE.CommonViews.WPF/TrinityMySqlDatabase/Views/DatabaseConfigView.xaml.cs b/WDE.CommonViews.WPF/TrinityMySqlDatabase/Views/DatabaseConfigView.xaml.cs deleted file mode 100644 index 35933133d..000000000 --- a/WDE.CommonViews.WPF/TrinityMySqlDatabase/Views/DatabaseConfigView.xaml.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Controls; - -namespace WDE.TrinityMySqlDatabase.Views -{ - /// - /// Interaction logic for DatabaseConfigView - /// - public partial class DatabaseConfigView : UserControl - { - public DatabaseConfigView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WDE.CommonViews.WPF/Updater/ChangeLogView.xaml b/WDE.CommonViews.WPF/Updater/ChangeLogView.xaml deleted file mode 100644 index 20665258c..000000000 --- a/WDE.CommonViews.WPF/Updater/ChangeLogView.xaml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WDE.CommonViews.WPF/Updater/ChangeLogView.xaml.cs b/WDE.CommonViews.WPF/Updater/ChangeLogView.xaml.cs deleted file mode 100644 index 66210c894..000000000 --- a/WDE.CommonViews.WPF/Updater/ChangeLogView.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace WDE.CommonViews.WPF.Updater -{ - public partial class ChangeLogView : UserControl - { - public ChangeLogView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WDE.CommonViews.WPF/Updater/UpdaterConfigurationView.xaml b/WDE.CommonViews.WPF/Updater/UpdaterConfigurationView.xaml deleted file mode 100644 index 09be383f7..000000000 --- a/WDE.CommonViews.WPF/Updater/UpdaterConfigurationView.xaml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/WDE.CommonViews.WPF/Updater/UpdaterConfigurationView.xaml.cs b/WDE.CommonViews.WPF/Updater/UpdaterConfigurationView.xaml.cs deleted file mode 100644 index b8a18d0f9..000000000 --- a/WDE.CommonViews.WPF/Updater/UpdaterConfigurationView.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace WDE.CommonViews.WPF.Updater -{ - public partial class UpdaterConfigurationView : UserControl - { - public UpdaterConfigurationView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WDE.CommonViews.WPF/WDE.CommonViews.WPF.csproj b/WDE.CommonViews.WPF/WDE.CommonViews.WPF.csproj deleted file mode 100644 index 1740c61e2..000000000 --- a/WDE.CommonViews.WPF/WDE.CommonViews.WPF.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - - net5.0-windows7.0 - true - Debug;Release - AnyCPU - - - - ..\bin\$(Configuration)\ - - - - - - - - - - - - - - - - - - - - 7.2.0.1422 - - - 6.1.0-preview1 - - - 3.1.0 - - - 2.3.2 - - - 1.1.31 - - - - diff --git a/WDE.Conditions.Avalonia/WDE.Conditions.Avalonia.csproj b/WDE.Conditions.Avalonia/WDE.Conditions.Avalonia.csproj index bf1550b59..9a8779c4a 100644 --- a/WDE.Conditions.Avalonia/WDE.Conditions.Avalonia.csproj +++ b/WDE.Conditions.Avalonia/WDE.Conditions.Avalonia.csproj @@ -1,6 +1,6 @@ - net5.0 + net6.0 0.0.0.0 0.0.0.0 Debug;Release diff --git a/WDE.Conditions.WPF/ConditionsWpfModule.cs b/WDE.Conditions.WPF/ConditionsWpfModule.cs deleted file mode 100644 index 41b1567ec..000000000 --- a/WDE.Conditions.WPF/ConditionsWpfModule.cs +++ /dev/null @@ -1,9 +0,0 @@ -using WDE.Module; - -namespace WDE.Conditions.WPF -{ - public class ConditionsWpfModule : ModuleBase - { - - } -} \ No newline at end of file diff --git a/WDE.Conditions.WPF/Properties/AssemblyInfo.cs b/WDE.Conditions.WPF/Properties/AssemblyInfo.cs deleted file mode 100644 index 89581ceef..000000000 --- a/WDE.Conditions.WPF/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.InteropServices; - -[assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] - -// In SDK-style projects such as this one, several assembly attributes that were historically -// defined in this file are now automatically added during build and populated with -// values defined in project properties. For details of which attributes are included -// and how to customise this process see: https://aka.ms/assembly-info-properties - - -// Setting ComVisible to false makes the types in this assembly not visible to COM -// components. If you need to access a type in this assembly from COM, set the ComVisible -// attribute to true on that type. - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM. - -[assembly: Guid("d7b9a8b5-b840-4455-b1ca-0c82364d59c9")] diff --git a/WDE.Conditions.WPF/Themes/Generic.xaml b/WDE.Conditions.WPF/Themes/Generic.xaml deleted file mode 100644 index ba78f7daf..000000000 --- a/WDE.Conditions.WPF/Themes/Generic.xaml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/WDE.Conditions.WPF/Views/ConditionsEditorView.xaml b/WDE.Conditions.WPF/Views/ConditionsEditorView.xaml deleted file mode 100644 index 2a9985356..000000000 --- a/WDE.Conditions.WPF/Views/ConditionsEditorView.xaml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WDE.Conditions.WPF/Views/ConditionsEditorView.xaml.cs b/WDE.Conditions.WPF/Views/ConditionsEditorView.xaml.cs deleted file mode 100644 index b0345c061..000000000 --- a/WDE.Conditions.WPF/Views/ConditionsEditorView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace WDE.Conditions.WPF.Views -{ - /// - /// Interaction logic for ConditionsEditorView.xaml - /// - public partial class ConditionsEditorView : UserControl - { - public ConditionsEditorView() - { - InitializeComponent(); - } - } -} diff --git a/WDE.Conditions.WPF/Views/DefinitionEditor/ConditionEditorView.xaml b/WDE.Conditions.WPF/Views/DefinitionEditor/ConditionEditorView.xaml deleted file mode 100644 index da0962541..000000000 --- a/WDE.Conditions.WPF/Views/DefinitionEditor/ConditionEditorView.xaml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Search: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WDE.DatabaseEditors.WPF/Views/Template/TemplateDbTableEditorView.xaml.cs b/WDE.DatabaseEditors.WPF/Views/Template/TemplateDbTableEditorView.xaml.cs deleted file mode 100644 index b7bbd2e0a..000000000 --- a/WDE.DatabaseEditors.WPF/Views/Template/TemplateDbTableEditorView.xaml.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Windows.Controls; -using System.Windows.Input; -using Prism.Commands; - -namespace WDE.DatabaseEditors.WPF.Views.Template -{ - public partial class TemplateDbTableEditorView : UserControl - { - public TemplateDbTableEditorView() - { - InitializeComponent(); - InputBindings.Add(new KeyBinding(new DelegateCommand(() => - { - TextBox tb = FindName("SearchTextBox") as TextBox; - tb?.Focus(); - }), new KeyGesture(Key.F, ModifierKeys.Control))); - } - } -} \ No newline at end of file diff --git a/WDE.DatabaseEditors.WPF/WDE.DatabaseEditors.WPF.csproj b/WDE.DatabaseEditors.WPF/WDE.DatabaseEditors.WPF.csproj deleted file mode 100644 index e69497895..000000000 --- a/WDE.DatabaseEditors.WPF/WDE.DatabaseEditors.WPF.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net5.0-windows7.0 - true - Debug;Release - AnyCPU - enable - - - - ..\bin\$(Configuration)\ - - - - - - - - - - - - 7.2.0.1422 - - - diff --git a/WDE.DatabaseEditors/WDE.DatabaseEditors.csproj b/WDE.DatabaseEditors/WDE.DatabaseEditors.csproj index 44788b210..f27236274 100644 --- a/WDE.DatabaseEditors/WDE.DatabaseEditors.csproj +++ b/WDE.DatabaseEditors/WDE.DatabaseEditors.csproj @@ -1,6 +1,6 @@ - net5.0 + net6.0 Library false Debug;Release diff --git a/WDE.MPQ/WDE.MPQ.csproj b/WDE.MPQ/WDE.MPQ.csproj index c03f5b1bf..7a6eb7b6a 100644 --- a/WDE.MPQ/WDE.MPQ.csproj +++ b/WDE.MPQ/WDE.MPQ.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable enable nullable diff --git a/WDE.MVVM/WDE.MVVM.csproj b/WDE.MVVM/WDE.MVVM.csproj index e6451e363..ac94d4ecd 100644 --- a/WDE.MVVM/WDE.MVVM.csproj +++ b/WDE.MVVM/WDE.MVVM.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library enable nullable diff --git a/WDE.MapRenderer/WDE.MapRenderer.csproj b/WDE.MapRenderer/WDE.MapRenderer.csproj index f2e49ab7b..ed459b295 100644 --- a/WDE.MapRenderer/WDE.MapRenderer.csproj +++ b/WDE.MapRenderer/WDE.MapRenderer.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable enable true diff --git a/WDE.MpqReader/WDE.MpqReader.csproj b/WDE.MpqReader/WDE.MpqReader.csproj index a51b02f9f..7054f9e7b 100644 --- a/WDE.MpqReader/WDE.MpqReader.csproj +++ b/WDE.MpqReader/WDE.MpqReader.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable enable true diff --git a/WDE.MySqlDatabaseCommon/WDE.MySqlDatabaseCommon.csproj b/WDE.MySqlDatabaseCommon/WDE.MySqlDatabaseCommon.csproj index e9a646332..0975f651c 100644 --- a/WDE.MySqlDatabaseCommon/WDE.MySqlDatabaseCommon.csproj +++ b/WDE.MySqlDatabaseCommon/WDE.MySqlDatabaseCommon.csproj @@ -1,6 +1,6 @@ - net5.0 + net6.0 Library false enable diff --git a/WDE.PacketViewer.Avalonia/WDE.PacketViewer.Avalonia.csproj b/WDE.PacketViewer.Avalonia/WDE.PacketViewer.Avalonia.csproj index 8cd46e177..15926e103 100644 --- a/WDE.PacketViewer.Avalonia/WDE.PacketViewer.Avalonia.csproj +++ b/WDE.PacketViewer.Avalonia/WDE.PacketViewer.Avalonia.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 0.0.0.0 0.0.0.0 Debug;Release diff --git a/WDE.PacketViewer/WDE.PacketViewer.csproj b/WDE.PacketViewer/WDE.PacketViewer.csproj index e6d131ed1..47fb8e552 100644 --- a/WDE.PacketViewer/WDE.PacketViewer.csproj +++ b/WDE.PacketViewer/WDE.PacketViewer.csproj @@ -1,7 +1,7 @@ - net5.0;net6.0 + net6.0 Library false enable diff --git a/WDE.Parameters/WDE.Parameters.csproj b/WDE.Parameters/WDE.Parameters.csproj index bc16de0c3..bf3984e8e 100644 --- a/WDE.Parameters/WDE.Parameters.csproj +++ b/WDE.Parameters/WDE.Parameters.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library false Debug;Release diff --git a/WDE.ProjectSkyFire/WDE.ProjectSkyFire.csproj b/WDE.ProjectSkyFire/WDE.ProjectSkyFire.csproj index 3c53d6455..1ce068f02 100644 --- a/WDE.ProjectSkyFire/WDE.ProjectSkyFire.csproj +++ b/WDE.ProjectSkyFire/WDE.ProjectSkyFire.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library enable nullable diff --git a/WDE.RemoteSOAP/WDE.RemoteSOAP.csproj b/WDE.RemoteSOAP/WDE.RemoteSOAP.csproj index 4087a9a15..49379ce9d 100644 --- a/WDE.RemoteSOAP/WDE.RemoteSOAP.csproj +++ b/WDE.RemoteSOAP/WDE.RemoteSOAP.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library false Debug;Release diff --git a/WDE.SQLEditor/WDE.SQLEditor.csproj b/WDE.SQLEditor/WDE.SQLEditor.csproj index 9f07df9d1..1a52bf74d 100644 --- a/WDE.SQLEditor/WDE.SQLEditor.csproj +++ b/WDE.SQLEditor/WDE.SQLEditor.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library false Debug;Release diff --git a/WDE.SmartScriptEditor.Avalonia/WDE.SmartScriptEditor.Avalonia.csproj b/WDE.SmartScriptEditor.Avalonia/WDE.SmartScriptEditor.Avalonia.csproj index 8d92bb112..38c87f281 100644 --- a/WDE.SmartScriptEditor.Avalonia/WDE.SmartScriptEditor.Avalonia.csproj +++ b/WDE.SmartScriptEditor.Avalonia/WDE.SmartScriptEditor.Avalonia.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 0.0.0.0 0.0.0.0 Debug;Release diff --git a/WDE.SmartScriptEditor.WPF/AssemblyInfo.cs b/WDE.SmartScriptEditor.WPF/AssemblyInfo.cs deleted file mode 100644 index cf0b89ecd..000000000 --- a/WDE.SmartScriptEditor.WPF/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Windows; - -[assembly: ThemeInfo(ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/Helpers/FocusBehavior.cs b/WDE.SmartScriptEditor.WPF/Editor/Helpers/FocusBehavior.cs deleted file mode 100644 index 39a0783d2..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/Helpers/FocusBehavior.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace WDE.SmartScriptEditor.WPF.Editor.Helpers -{ - public static class FocusBehavior - { - public static readonly DependencyProperty FocusFirstProperty = DependencyProperty.RegisterAttached("FocusFirst", - typeof(bool), - typeof(FocusBehavior), - new PropertyMetadata(false, OnFocusFirstPropertyChanged)); - - public static bool GetFocusFirst(Control control) - { - return (bool) control.GetValue(FocusFirstProperty); - } - - public static void SetFocusFirst(Control control, bool value) - { - control.SetValue(FocusFirstProperty, value); - } - - private static void OnFocusFirstPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) - { - Control control = obj as Control; - if (control == null || !(args.NewValue is bool)) - return; - - if ((bool) args.NewValue) - control.Loaded += (sender, e) => control.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/Helpers/InputBindingsBehavior.cs b/WDE.SmartScriptEditor.WPF/Editor/Helpers/InputBindingsBehavior.cs deleted file mode 100644 index 84d111c0d..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/Helpers/InputBindingsBehavior.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Linq; -using System.Windows; -using System.Windows.Input; - -namespace WDE.SmartScriptEditor.WPF.Editor.Helpers -{ - // https://stackoverflow.com/questions/12941707/keybinding-in-usercontrol-doesnt-work-when-textbox-has-the-focus - public class InputBindingsBehavior - { - public static readonly DependencyProperty TakesInputBindingPrecedenceProperty = - DependencyProperty.RegisterAttached("TakesInputBindingPrecedence", - typeof(bool), - typeof(InputBindingsBehavior), - new UIPropertyMetadata(false, OnTakesInputBindingPrecedenceChanged)); - - public static bool GetTakesInputBindingPrecedence(UIElement obj) - { - return (bool) obj.GetValue(TakesInputBindingPrecedenceProperty); - } - - public static void SetTakesInputBindingPrecedence(UIElement obj, bool value) - { - obj.SetValue(TakesInputBindingPrecedenceProperty, value); - } - - private static void OnTakesInputBindingPrecedenceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((UIElement) d).PreviewKeyDown += InputBindingsBehavior_PreviewKeyDown; - } - - private static void InputBindingsBehavior_PreviewKeyDown(object sender, KeyEventArgs e) - { - UIElement uielement = (UIElement) sender; - - KeyBinding? foundBinding = uielement.InputBindings.OfType() - .FirstOrDefault(kb => kb.Key == e.Key && kb.Modifiers == e.KeyboardDevice.Modifiers); - - if (foundBinding != null) - { - e.Handled = true; - if (foundBinding.Command.CanExecute(foundBinding.CommandParameter)) - foundBinding.Command.Execute(foundBinding.CommandParameter); - } - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/Helpers/IsNullConverter.cs b/WDE.SmartScriptEditor.WPF/Editor/Helpers/IsNullConverter.cs deleted file mode 100644 index ffbac61ef..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/Helpers/IsNullConverter.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace WDE.SmartScriptEditor.WPF.Editor.Helpers -{ - public class IsNullConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return value == null; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new InvalidOperationException("IsNullConverter can only be used OneWay."); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/Helpers/NullToVisibilityConverter.cs b/WDE.SmartScriptEditor.WPF/Editor/Helpers/NullToVisibilityConverter.cs deleted file mode 100644 index 53816fbdb..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/Helpers/NullToVisibilityConverter.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace WDE.SmartScriptEditor.WPF.Editor.Helpers -{ - public class NullToVisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return value == null ? Visibility.Hidden : Visibility.Visible; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/README.md b/WDE.SmartScriptEditor.WPF/Editor/README.md deleted file mode 100644 index b3ee9ea83..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/README.md +++ /dev/null @@ -1 +0,0 @@ -Code in this folder is absolutely against any good WPF and MVVM practises, if you know how to write editor in a better way - any refactor (or rather - writing from the scratch) is welcome! \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/ActionDataTemplateSelector.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/ActionDataTemplateSelector.cs deleted file mode 100644 index 7e867aab3..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/ActionDataTemplateSelector.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using WDE.SmartScriptEditor.Models; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - public class ActionDataTemplateSelector : DataTemplateSelector - { - public DataTemplate ActionTemplate { get; set; } - public DataTemplate CommentTemplate { get; set; } - - public override DataTemplate SelectTemplate(object item, DependencyObject container) - { - if (item is SmartAction {Id: SmartConstants.ActionComment}) - return CommentTemplate; - - return ActionTemplate; - } - } - - public class SmartEventFlagPhaseDataSelector : DataTemplateSelector - { - public DataTemplate FlagTemplate { get; set; } - public DataTemplate PhaseTemplate { get; set; } - - public override DataTemplate SelectTemplate(object item, DependencyObject container) - { - if (item is SmartEventFlagsView.IconViewModel {IsPhaseFlag: true}) - return PhaseTemplate; - - return FlagTemplate; - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/GlobalVaraiableView.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/GlobalVaraiableView.cs deleted file mode 100644 index 5ff5aa36b..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/GlobalVaraiableView.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using WDE.SmartScriptEditor.Models; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - /// - /// Interaction logic for SmartActionView.xaml - /// - public class GlobalVariableView : Control - { - public static DependencyProperty IsSelectedProperty = DependencyProperty.Register(nameof(IsSelected), - typeof(bool), - typeof(GlobalVariableView), - new PropertyMetadata(false)); - - public static DependencyProperty DeselectAllRequestProperty = - DependencyProperty.Register(nameof(DeselectAllRequest), typeof(ICommand), typeof(GlobalVariableView)); - - public static DependencyProperty DeselectAllButGlobalVariablesRequestProperty = - DependencyProperty.Register(nameof(DeselectAllButGlobalVariablesRequest), typeof(ICommand), typeof(GlobalVariableView)); - - public static DependencyProperty EditGlobalVariableCommandProperty = - DependencyProperty.Register(nameof(EditGlobalVariableCommand), typeof(ICommand), typeof(GlobalVariableView)); - - static GlobalVariableView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(GlobalVariableView), new FrameworkPropertyMetadata(typeof(GlobalVariableView))); - } - - public bool IsSelected - { - get => (bool) GetValue(IsSelectedProperty); - set => SetValue(IsSelectedProperty, value); - } - - public ICommand DeselectAllRequest - { - get => (ICommand) GetValue(DeselectAllRequestProperty); - set => SetValue(DeselectAllRequestProperty, value); - } - - public ICommand DeselectAllButGlobalVariablesRequest - { - get => (ICommand) GetValue(DeselectAllButGlobalVariablesRequestProperty); - set => SetValue(DeselectAllButGlobalVariablesRequestProperty, value); - } - - public ICommand EditGlobalVariableCommand - { - get => (ICommand) GetValue(EditGlobalVariableCommandProperty); - set => SetValue(EditGlobalVariableCommandProperty, value); - } - - - protected override void OnMouseDown(MouseButtonEventArgs e) - { - base.OnMouseDown(e); - if (e.ClickCount == 1) - { - DeselectAllButGlobalVariablesRequest?.Execute(null); - - if (!IsSelected) - { - if (!Keyboard.IsKeyDown(Key.LeftCtrl)) - DeselectAllRequest?.Execute(null); - IsSelected = true; - } - } - else if (e.ClickCount == 2) - EditGlobalVariableCommand?.Execute(DataContext); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/MiniEventIcon.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/MiniEventIcon.cs deleted file mode 100644 index 4410e2caa..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/MiniEventIcon.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Windows; -using System.Windows.Controls; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - public class MiniEventIcon : Control - { - public static DependencyProperty TextProperty = - DependencyProperty.Register(nameof(Text), typeof(string), typeof(MiniEventIcon)); - - static MiniEventIcon() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(MiniEventIcon), new FrameworkPropertyMetadata(typeof(MiniEventIcon))); - } - - public string Text - { - get => (string) GetValue(TextProperty); - set => SetValue(TextProperty, value); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartActionView.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartActionView.cs deleted file mode 100644 index d5cd31a34..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartActionView.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using WDE.SmartScriptEditor.Models; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - /// - /// Interaction logic for SmartActionView.xaml - /// - public class SmartActionView : Control - { - public static DependencyProperty IsSelectedProperty = DependencyProperty.Register(nameof(IsSelected), - typeof(bool), - typeof(SmartActionView), - new PropertyMetadata(false)); - - public static DependencyProperty DeselectAllRequestProperty = - DependencyProperty.Register(nameof(DeselectAllRequest), typeof(ICommand), typeof(SmartActionView)); - - public static DependencyProperty DeselectAllButActionsRequestProperty = - DependencyProperty.Register(nameof(DeselectAllButActionsRequest), typeof(ICommand), typeof(SmartActionView)); - - public static DependencyProperty EditActionCommandProperty = - DependencyProperty.Register(nameof(EditActionCommand), typeof(ICommand), typeof(SmartActionView)); - - public static DependencyProperty DirectEditParameterProperty = - DependencyProperty.Register(nameof(DirectEditParameter), typeof(ICommand), typeof(SmartActionView)); - - static SmartActionView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(SmartActionView), new FrameworkPropertyMetadata(typeof(SmartActionView))); - } - - public bool IsSelected - { - get => (bool) GetValue(IsSelectedProperty); - set => SetValue(IsSelectedProperty, value); - } - - public ICommand DeselectAllRequest - { - get => (ICommand) GetValue(DeselectAllRequestProperty); - set => SetValue(DeselectAllRequestProperty, value); - } - - public ICommand DeselectAllButActionsRequest - { - get => (ICommand) GetValue(DeselectAllButActionsRequestProperty); - set => SetValue(DeselectAllButActionsRequestProperty, value); - } - - public ICommand EditActionCommand - { - get => (ICommand) GetValue(EditActionCommandProperty); - set => SetValue(EditActionCommandProperty, value); - } - - public ICommand DirectEditParameter - { - get => (ICommand) GetValue(DirectEditParameterProperty); - set => SetValue(DirectEditParameterProperty, value); - } - - protected override void OnMouseDown(MouseButtonEventArgs e) - { - base.OnMouseDown(e); - if (e.ClickCount == 1) - { - if (DirectEditParameter != null) - { - if (e.OriginalSource is Run originalRun && originalRun.DataContext != null && - originalRun.DataContext != DataContext) - { - DirectEditParameter.Execute(originalRun.DataContext); - return; - } - } - - DeselectAllButActionsRequest?.Execute(null); - - if (!IsSelected) - { - if (!Keyboard.IsKeyDown(Key.LeftCtrl)) - DeselectAllRequest?.Execute(null); - IsSelected = true; - } - } - else if (e.ClickCount == 2) - EditActionCommand?.Execute(DataContext); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartConditionView.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartConditionView.cs deleted file mode 100644 index 973d63178..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartConditionView.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - /// - /// Interaction logic for SmartActionView.xaml - /// - public class SmartConditionView : Control - { - public static DependencyProperty IsSelectedProperty = DependencyProperty.Register(nameof(IsSelected), - typeof(bool), - typeof(SmartConditionView), - new PropertyMetadata(false)); - - public static DependencyProperty DeselectAllRequestProperty = - DependencyProperty.Register(nameof(DeselectAllRequest), typeof(ICommand), typeof(SmartConditionView)); - - public static DependencyProperty DeselectAllButConditionsRequestProperty = - DependencyProperty.Register(nameof(DeselectAllButConditionsRequest), typeof(ICommand), typeof(SmartConditionView)); - - public static DependencyProperty EditConditionCommandProperty = - DependencyProperty.Register(nameof(EditConditionCommand), typeof(ICommand), typeof(SmartConditionView)); - - public static DependencyProperty DirectEditParameterProperty = - DependencyProperty.Register(nameof(DirectEditParameter), typeof(ICommand), typeof(SmartConditionView)); - - static SmartConditionView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(SmartConditionView), new FrameworkPropertyMetadata(typeof(SmartConditionView))); - } - - public bool IsSelected - { - get => (bool) GetValue(IsSelectedProperty); - set => SetValue(IsSelectedProperty, value); - } - - public ICommand DeselectAllRequest - { - get => (ICommand) GetValue(DeselectAllRequestProperty); - set => SetValue(DeselectAllRequestProperty, value); - } - - public ICommand DeselectAllButConditionsRequest - { - get => (ICommand) GetValue(DeselectAllButConditionsRequestProperty); - set => SetValue(DeselectAllButConditionsRequestProperty, value); - } - - public ICommand EditConditionCommand - { - get => (ICommand) GetValue(EditConditionCommandProperty); - set => SetValue(EditConditionCommandProperty, value); - } - - public ICommand DirectEditParameter - { - get => (ICommand) GetValue(DirectEditParameterProperty); - set => SetValue(DirectEditParameterProperty, value); - } - - protected override void OnMouseDown(MouseButtonEventArgs e) - { - base.OnMouseDown(e); - if (e.ClickCount == 1) - { - if (DirectEditParameter != null) - { - if (e.OriginalSource is Run originalRun && originalRun.DataContext != null && - originalRun.DataContext != DataContext) - { - DirectEditParameter.Execute(originalRun.DataContext); - return; - } - } - - DeselectAllButConditionsRequest?.Execute(null); - if (!IsSelected) - { - if (!Keyboard.IsKeyDown(Key.LeftCtrl)) - DeselectAllRequest?.Execute(null); - IsSelected = true; - } - } - else if (e.ClickCount == 2) - EditConditionCommand?.Execute(DataContext); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartEventFlagsView.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartEventFlagsView.cs deleted file mode 100644 index cf6827760..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartEventFlagsView.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; -using System.Windows; -using System.Windows.Controls; -using WDE.MVVM; -using WDE.MVVM.Observable; -using WDE.SmartScriptEditor.Models; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - public class SmartEventFlagsView : Control - { - private System.IDisposable? flagsDisposable; - - public static DependencyProperty FlagsProperty = - DependencyProperty.Register(nameof(Flags), typeof(ObservableCollection), typeof(SmartEventFlagsView)); - - static SmartEventFlagsView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(SmartEventFlagsView), new FrameworkPropertyMetadata(typeof(SmartEventFlagsView))); - } - - public SmartEventFlagsView() - { - Flags = new(); - Loaded += OnLoaded; - Unloaded += OnUnloaded; - DataContextChanged += OnDataContextChanged; - } - - private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) - { - UpdatedDataContext(); - } - - private void OnUnloaded(object sender, RoutedEventArgs e) - { - flagsDisposable?.Dispose(); - flagsDisposable = null; - } - - private void OnLoaded(object sender, RoutedEventArgs e) - { - UpdatedDataContext(); - } - - public ObservableCollection Flags - { - get => (ObservableCollection) GetValue(FlagsProperty); - set => SetValue(FlagsProperty, value); - } - - protected void UpdatedDataContext() - { - flagsDisposable?.Dispose(); - flagsDisposable = null; - if (DataContext is SmartEvent se) - { - var flagsObservable = se.Flags.ToObservable(t => t.Value); - var phasesObservable = se.Phases.ToObservable(t => t.Value); - var combined = flagsObservable.CombineLatest(phasesObservable, (flags, phases) => (flags, phases)); - flagsDisposable = combined.SubscribeAction(tuple => - { - Flags.Clear(); - var (eventFlagsNum, eventPhasesNum) = tuple; - - if (eventFlagsNum > 0 && se.Flags.Parameter.HasItems) - { - foreach (var item in se.Flags.Parameter.Items!) - { - if (item.Key == 0) - continue; - - if ((eventFlagsNum & item.Key) > 0) - Flags.Add(new IconViewModel(FlagToIconTextSymbol(item.Key), item.Value.Name, item.Value.Description)); - } - } - - if (eventPhasesNum > 0 && se.Phases.Parameter.HasItems) - { - int totalPhases = se.Phases.Parameter.Items! - .Count(item => (eventPhasesNum & item.Key) > 0); - - var currentPhases = se.Phases.Parameter.Items! - .Where(item => item.Key != 0 && (eventPhasesNum & item.Key) > 0) - .Select(item => PhaseMaskToPhase((int) item.Key)); - - if (totalPhases > 3) - { - Flags.Add(new IconViewModel(currentPhases)); - } - else - { - foreach (var phase in currentPhases) - Flags.Add(new IconViewModel(phase)); - } - } - }); - } - } - - private static string FlagToIconTextSymbol(long flag) - { - SmartEventFlag f = (SmartEventFlag) flag; - if (f == SmartEventFlag.NotRepeatable) - return "I"; - if (f == SmartEventFlag.DebugOnly) - return "d"; - if (f == SmartEventFlag.WhileCharmed) - return "c"; - if (f == SmartEventFlag.DontReset) - return "r"; - if (f == SmartEventFlag.Difficulty0) - return "A"; - if (f == SmartEventFlag.Difficulty1) - return "B"; - if (f == SmartEventFlag.Difficulty2) - return "C"; - if (f == SmartEventFlag.Difficulty3) - return "D"; - return "?"; - } - - private static int PhaseMaskToPhase(int phaseMask) - { - for (int i = 0; i < 12; ++i) - { - if (((1 << i) & phaseMask) > 0) - return i + 1; - } - - return 0; - } - - public struct IconViewModel - { - public bool IsPhaseFlag { get; set; } - public string Text { get; set; } - public string ToolTip { get; set; } - - public IconViewModel(long phase) - { - IsPhaseFlag = true; - Text = phase.ToString(); - ToolTip = "Event will only activate in script phase " + phase; - } - - public IconViewModel(IEnumerable phases) - { - IsPhaseFlag = true; - Text = "..."; - ToolTip = "Event will only activate in script phases: " + string.Join(", ", phases); - } - - public IconViewModel(string text, string flagName, string? tooltip) - { - Text = text; - ToolTip = tooltip != null ? $"Event flag {flagName}: {tooltip}" : $"Event flag {flagName}"; - IsPhaseFlag = false; - } - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartEventView.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartEventView.cs deleted file mode 100644 index f2e5f2da9..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartEventView.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using WDE.SmartScriptEditor.Models; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - /// - /// Interaction logic for SmartEventView.xaml - /// - public class SmartEventView : Control - { - public static DependencyProperty EditEventCommandProperty = - DependencyProperty.Register("EditEventCommand", typeof(ICommand), typeof(SmartEventView)); - - public static DependencyProperty DeselectAllRequestProperty = - DependencyProperty.Register(nameof(DeselectAllRequest), typeof(ICommand), typeof(SmartEventView)); - - public static DependencyProperty DeselectActionsOfDeselectedEventsRequestProperty = - DependencyProperty.Register(nameof(DeselectActionsOfDeselectedEventsRequest), typeof(ICommand), typeof(SmartEventView)); - - public static DependencyProperty DirectEditParameterProperty = - DependencyProperty.Register(nameof(DirectEditParameter), typeof(ICommand), typeof(SmartEventView)); - - public static DependencyProperty IsSelectedProperty = DependencyProperty.Register(nameof(IsSelected), - typeof(bool), - typeof(SmartEventView), - new PropertyMetadata(false)); - - static SmartEventView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(SmartEventView), new FrameworkPropertyMetadata(typeof(SmartEventView))); - } - - public ICommand EditEventCommand - { - get => (ICommand) GetValue(EditEventCommandProperty); - set => SetValue(EditEventCommandProperty, value); - } - - public ICommand DeselectAllRequest - { - get => (ICommand) GetValue(DeselectAllRequestProperty); - set => SetValue(DeselectAllRequestProperty, value); - } - - public ICommand DeselectActionsOfDeselectedEventsRequest - { - get => (ICommand) GetValue(DeselectActionsOfDeselectedEventsRequestProperty); - set => SetValue(DeselectActionsOfDeselectedEventsRequestProperty, value); - } - - public ICommand DirectEditParameter - { - get => (ICommand) GetValue(DirectEditParameterProperty); - set => SetValue(DirectEditParameterProperty, value); - } - - public bool IsSelected - { - get => (bool) GetValue(IsSelectedProperty); - set => SetValue(IsSelectedProperty, value); - } - - protected override void OnPreviewMouseDown(MouseButtonEventArgs e) - { - if (e.ClickCount == 1) - { - if (DirectEditParameter != null) - { - if (e.OriginalSource is Run originalRun && originalRun.DataContext != null && - originalRun.DataContext != DataContext) - { - DirectEditParameter.Execute(originalRun.DataContext); - return; - } - } - - DeselectActionsOfDeselectedEventsRequest?.Execute(null); - - if (!IsSelected) - { - if (!Keyboard.IsKeyDown(Key.LeftCtrl)) - DeselectAllRequest?.Execute(null); - IsSelected = true; - } - e.Handled = true; - } - else if (e.ClickCount == 2) - { - EditEventCommand?.Execute(DataContext); - e.Handled = true; - } - base.OnPreviewMouseDown(e); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptPanelLayout.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptPanelLayout.cs deleted file mode 100644 index a0239b996..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptPanelLayout.cs +++ /dev/null @@ -1,809 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; -using System.Windows.Media; -using WDE.Common.Managers; -using WDE.SmartScriptEditor.Editor.UserControls; -using WDE.SmartScriptEditor.Editor.ViewModels; -using WDE.SmartScriptEditor.Models; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - internal class SmartScriptPanelLayout : Panel - { - private readonly List<(float y, float height, int actionIndex, int eventIndex)> actionHeights = new(); - private readonly List<(float y, float height, int conditionIndex, int eventIndex)> conditionHeights = new(); - - private readonly List eventHeights = new(); - private readonly Dictionary actionToPresenter = new(); - private readonly Dictionary eventToPresenter = new(); - private readonly Dictionary conditionToPresenter = new(); - private readonly Dictionary presenterToCondition = new(); - private readonly Dictionary presenterToAction = new(); - private readonly Dictionary presenterToEvent = new(); - private readonly Dictionary variableToPresenter = new(); - private readonly Dictionary presenterToVariable = new(); - - private ContentPresenter addActionPresenter; - private NewActionViewModel addActionViewModel; - - private ContentPresenter addConditionPresenter; - private NewConditionViewModel addConditionViewModel; - private bool draggingActions; - private bool draggingEvents; - private bool draggingConditions; - - private Point mouseStartPosition; - private float mouseY; - - private (float y, float height, int conditionIndex, int eventIndex) overIndexCondition; - private (float y, float height, int actionIndex, int eventIndex) overIndexAction; - - private static float PaddingLeft = 20; - private float EventWidth => Math.Min(Math.Max((float) ActualWidth - 50, PaddingLeft + 10), 250); - - private float ConditionWidth => Math.Max(EventWidth - 22 - PaddingLeft, 0); - - protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved) - { - base.OnVisualChildrenChanged(visualAdded, visualRemoved); - if (visualAdded is ContentPresenter visualAddedPresenter) - visualAddedPresenter.Loaded += OnLoadVisualChild; - - if (visualRemoved is ContentPresenter visualRemovedPresenter) - { - visualRemovedPresenter.Loaded -= OnLoadVisualChild; - if (visualRemovedPresenter.Content is SmartEvent @event) - { - presenterToEvent.Remove(visualRemovedPresenter); - eventToPresenter.Remove(@event); - } - else if (visualRemovedPresenter.Content is SmartAction action) - { - presenterToAction.Remove(visualRemovedPresenter); - actionToPresenter.Remove(action); - } - else if (visualRemovedPresenter.Content is SmartCondition condition) - { - presenterToCondition.Remove(visualRemovedPresenter); - conditionToPresenter.Remove(condition); - } - else if (visualRemovedPresenter.Content is GlobalVariable globalVariable) - { - presenterToVariable.Remove(visualRemovedPresenter); - variableToPresenter.Remove(globalVariable); - } - else if (visualRemovedPresenter.Content is NewActionViewModel) - { - addActionPresenter = null; - addActionViewModel = null; - } - else if (visualRemovedPresenter.Content is NewConditionViewModel) - { - addConditionPresenter = null; - addConditionViewModel = null; - } - } - - InvalidateArrange(); - InvalidateVisual(); - InvalidateMeasure(); - } - - private void OnLoadVisualChild(object sender, RoutedEventArgs e) - { - ContentPresenter visualAddedPresenter = sender as ContentPresenter; - if (visualAddedPresenter.Content is SmartEvent @event) - { - presenterToEvent[visualAddedPresenter] = @event; - eventToPresenter[@event] = visualAddedPresenter; - } - else if (visualAddedPresenter.Content is SmartAction action) - { - presenterToAction[visualAddedPresenter] = action; - actionToPresenter[action] = visualAddedPresenter; - } - else if (visualAddedPresenter.Content is SmartCondition condition) - { - presenterToCondition[visualAddedPresenter] = condition; - conditionToPresenter[condition] = visualAddedPresenter; - } - else if (visualAddedPresenter.Content is GlobalVariable globalVariable) - { - presenterToVariable[visualAddedPresenter] = globalVariable; - variableToPresenter[globalVariable] = visualAddedPresenter; - } - else if (visualAddedPresenter.Content is NewActionViewModel vm) - { - addActionPresenter = visualAddedPresenter; - addActionViewModel = vm; - } else if (visualAddedPresenter.Content is NewConditionViewModel cvm) - { - addConditionPresenter = visualAddedPresenter; - addConditionViewModel = cvm; - } - - InvalidateArrange(); - InvalidateVisual(); - InvalidateMeasure(); - } - - private IEnumerable Events() - { - foreach (ContentPresenter child in InternalChildren) - { - if (child.Content is SmartEvent) - yield return child; - } - } - - private IEnumerable GlobalVariables() - { - foreach (ContentPresenter child in InternalChildren) - { - if (child.Content is GlobalVariable) - yield return child; - } - } - - private Size MeasureGlobalVariables(Size availableSize) - { - double totalDesiredSize = EventSpacing; - foreach (ContentPresenter globalVariablePresenter in GlobalVariables()) - { - globalVariablePresenter.Measure(new Size(ActualWidth - PaddingLeft, availableSize.Height)); - totalDesiredSize += globalVariablePresenter.DesiredSize.Height + 2; - } - - return new Size(availableSize.Width, totalDesiredSize); - } - - protected override Size MeasureOverride(Size availableSize) - { - Size s = base.MeasureOverride(availableSize); - float totalDesiredHeight = (float)MeasureGlobalVariables(availableSize).Height; - foreach (ContentPresenter eventPresenter in Events()) - { - eventPresenter.Measure(new Size(EventWidth - PaddingLeft, availableSize.Height)); - - float actionsHeight = 26; - float conditionsHeight = 26; - - if (!presenterToEvent.ContainsKey(eventPresenter)) - continue; - - SmartEvent @event = presenterToEvent[eventPresenter]; - foreach (SmartAction action in @event.Actions) - { - if (!actionToPresenter.TryGetValue(action, out var actionPresenter)) - continue; - - actionPresenter.Measure(new Size(ActualWidth - EventWidth, availableSize.Height)); - - actionsHeight += (float) actionPresenter.DesiredSize.Height + ActionSpacing; - } - foreach (SmartCondition condition in @event.Conditions) - { - if (!conditionToPresenter.TryGetValue(condition, out var conditionPresenter)) - continue; - - conditionPresenter.Measure(new Size(ConditionWidth, availableSize.Height)); - - conditionsHeight += (float) conditionPresenter.DesiredSize.Height + ConditionSpacing; - } - - totalDesiredHeight += Math.Max(actionsHeight, (float) eventPresenter.DesiredSize.Height + conditionsHeight) + EventSpacing; - } - - return new Size(s.Width, Math.Max(0, totalDesiredHeight)); - } - - protected override void OnMouseDown(MouseButtonEventArgs e) - { - base.OnMouseDown(e); - if (e.LeftButton == MouseButtonState.Pressed) - { - if (!(e.Source is SmartEventView) && !(e.Source is SmartActionView)) - { - foreach (ContentPresenter @event in Events()) - SetSelected(@event, false); - } - - mouseStartPosition = e.GetPosition(this); - } - } - - protected override void OnMouseUp(MouseButtonEventArgs e) - { - base.OnMouseUp(e); - StopDragging(); - } - - private void StopDragging() - { - ReleaseMouseCapture(); - if (draggingEvents) - DropItems?.Execute(OverIndexEvent); - else if (draggingActions) - { - DropActions?.Execute(new DropActionsConditionsArgs - {EventIndex = overIndexAction.eventIndex, ActionIndex = overIndexAction.actionIndex}); - } - else if (draggingConditions) - { - DropConditions?.Execute(new DropActionsConditionsArgs - {EventIndex = overIndexCondition.eventIndex, ActionIndex = overIndexCondition.conditionIndex}); - } - - draggingEvents = false; - draggingActions = false; - draggingConditions = false; - InvalidateArrange(); - InvalidateVisual(); - } - - private static FormattedText? vvvvError; - private static FormattedText? vvvvWarning; - - private void DrawProblem(DrawingContext dc, int line, double yPos) - { - if (vvvvError == null) - { - vvvvError = new FormattedText("vvvv", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface("Calibri"), 7, Brushes.Red); - vvvvWarning = new FormattedText("vvvv", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface("Calibri"), 7, Brushes.Orange); - } - - if (Problems != null && Problems.TryGetValue(line, out var severity)) - { - dc.DrawText(severity == DiagnosticSeverity.Error ? vvvvError : vvvvWarning, new Point(0, yPos + 5 + 10)); - } - } - - protected override void OnRender(DrawingContext dc) - { - base.OnRender(dc); - if (draggingActions) - { - float x = EventWidth; - float y = overIndexAction.y - overIndexAction.height / 2 - 1; - dc.DrawLine(new Pen(Brushes.Gray, 1), new Point(x, y), new Point(x + 200, y)); - } - else if (draggingConditions) - { - float x = 1; - float y = overIndexCondition.y - overIndexCondition.height / 2 - 1; - dc.DrawLine(new Pen(Brushes.Gray, 1), new Point(x, y), new Point(x + ConditionWidth, y)); - } - - - int index = 1; - double yPos = 0; - foreach (var e in Script.Events) - { - if (e.Actions.Count == 0) - { - if (!eventToPresenter.TryGetValue(e, out var eventPresenter)) - continue; - yPos = eventPresenter.TransformToAncestor(this).Transform(new Point(0, 0)).Y; - - var ft = NumberCache.Get(index); - dc.DrawText(ft, new Point(0, yPos + 5)); - DrawProblem(dc, index, yPos); - index++; - } - else - { - foreach (var a in e.Actions) - { - if (!actionToPresenter.TryGetValue(a, out var actionPresenter)) - continue; - - yPos = actionPresenter.TransformToAncestor(this).Transform(new Point(0, 0)).Y; - - var ft = NumberCache.Get(index); - dc.DrawText(ft, new Point(0, yPos + 5)); - DrawProblem(dc, index, yPos); - - index++; - } - } - } - } - - - private static FormattedTextNumberCache NumberCache = new(); - public class FormattedTextNumberCache - { - private FormattedText[] cache = new FormattedText[0]; - - public FormattedTextNumberCache() - { - - } - - public FormattedText Get(int index) - { - if (cache.Length <= index) - EnsureCache(index + 1); - return cache[index]; - } - - private void EnsureCache(int size) - { - int old = cache.Length; - size = Math.Max(size, cache.Length * 2 + 1); - Array.Resize(ref cache, size); - for (int i = old; i < size; ++i) - { - cache[i] = new FormattedText(i.ToString(), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface("Calibri"), 10, Brushes.DarkGray); - } - } - } - - - private bool AnyActionSelected() - { - return actionToPresenter.Keys.Any(a => a.IsSelected); - } - - private bool AnyEventSelected() - { - return eventToPresenter.Keys.Any(a => a.IsSelected); - } - - private bool mouseStartPositionValid = false; - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - mouseY = (float) e.GetPosition(this).Y; - if (e.LeftButton != MouseButtonState.Pressed) - { - mouseStartPosition = e.GetPosition(this); - mouseStartPositionValid = true; - } - if (mouseStartPositionValid && - e.LeftButton == MouseButtonState.Pressed && - !draggingActions && !draggingEvents && !draggingConditions) - { - var dist = (float) Point.Subtract(mouseStartPosition, e.GetPosition(this)).Length; - if (dist > 10) - { - if (e.GetPosition(this).X < EventWidth) - { - if (AnyEventSelected()) - draggingEvents = true; - else - draggingConditions = true; - } - else - draggingActions = AnyActionSelected(); - - if (draggingEvents || draggingActions || draggingConditions) - { - mouseStartPositionValid = false; - CaptureMouse(); - } - } - } - - if (draggingEvents) - { - var eventIndex = 0; - var found = false; - foreach (float f in eventHeights) - { - if (f > mouseY) - { - OverIndexEvent = eventIndex; - found = true; - break; - } - - eventIndex++; - } - - if (!found) - { - OverIndexEvent = eventHeights.Count > 0 && mouseY > eventHeights[^1] - ? eventHeights.Count - 1 - : 0; - } - } - else if (draggingActions) - { - foreach ((float y, float height, int actionIndex, int eventIndex) tuple in actionHeights) - { - if (tuple.y > mouseY) - { - overIndexAction = tuple; - break; - } - } - InvalidateVisual(); - } - else if (draggingConditions) - { - foreach ((float y, float height, int conditionIndex, int eventIndex) tuple in conditionHeights) - { - if (tuple.y > mouseY) - { - overIndexCondition = tuple; - break; - } - } - InvalidateVisual(); - } - - InvalidateArrange(); - } - - protected override void OnMouseLeave(MouseEventArgs e) - { - base.OnMouseLeave(e); - mouseStartPositionValid = false; - } - - private Size ArrangeGlobalVariables(Size finalSize) - { - double totalHeight = EventSpacing; - foreach (GlobalVariable gv in Script.GlobalVariables) - { - if (!variableToPresenter.TryGetValue(gv, out var variablePresenter)) - continue; - - variablePresenter.Arrange(new Rect(PaddingLeft, totalHeight, finalSize.Width - PaddingLeft, variablePresenter.DesiredSize.Height)); - - totalHeight += variablePresenter.DesiredSize.Height + 2; - } - - return new Size(finalSize.Width, totalHeight); - } - - protected override Size ArrangeOverride(Size finalSize) - { - eventHeights.Clear(); - actionHeights.Clear(); - conditionHeights.Clear(); - Size globalVariablesArrangement = ArrangeGlobalVariables(finalSize); - float y = (float)globalVariablesArrangement.Height; - - float selectedHeight = 0; - foreach (SmartEvent ev in Script.Events) - { - if (!eventToPresenter.TryGetValue(ev, out var eventPresenter)) - continue; - - float height = Math.Max(MeasureActions(eventPresenter), (float) eventPresenter.DesiredSize.Height + MeasureConditions(eventPresenter)); - eventHeights.Add(y + (height + EventSpacing) / 2); - y += height + EventSpacing; - - if (!draggingEvents || !GetSelected(eventPresenter)) - continue; - selectedHeight += height + EventSpacing; - } - - eventHeights.Add(y); - - y = (float)globalVariablesArrangement.Height; - float start = 0; - if (OverIndexEvent == 0) - { - start = y; - y += selectedHeight; - } - - var eventIndex = 0; - if (addActionViewModel != null) - addActionViewModel.Event = null; - if (addConditionViewModel != null) - addConditionViewModel.Event = null; - - foreach (SmartEvent ev in Script.Events) - { - if (!eventToPresenter.TryGetValue(ev, out var eventPresenter)) - continue; - - var height = (float) eventPresenter.DesiredSize.Height; - if (!draggingEvents || !GetSelected(eventPresenter)) - { - float actionHeight = ArrangeActions(eventIndex, 0, finalSize, eventPresenter, y, height); - float conditionsHeight = ArrangeConditions(eventIndex, PaddingLeft, finalSize, eventPresenter, y, height); - float eventsConditionsHeight = height + conditionsHeight; - height = Math.Max(eventsConditionsHeight, actionHeight); - eventPresenter.Arrange(new Rect(PaddingLeft, y, EventWidth - PaddingLeft, height)); - - if (mouseY > y && mouseY < y + height && !draggingActions && !draggingEvents) - { - if (presenterToEvent.TryGetValue(eventPresenter, out SmartEvent smartEvent)) - { - if (addActionViewModel != null) - addActionViewModel.Event = smartEvent; - - if (addConditionViewModel != null) - addConditionViewModel.Event = smartEvent; - } - - addActionPresenter.Arrange(new Rect(EventWidth, - y + actionHeight - 26, - Math.Max(finalSize.Width - EventWidth, 0), - 24)); - - addConditionPresenter.Arrange(new Rect(PaddingLeft + 25, - y + eventsConditionsHeight - 26, - ConditionWidth, - 24)); - } - - y += height + EventSpacing; - } - - eventIndex++; - if (eventIndex == OverIndexEvent) - { - start = y; - y += selectedHeight; - } - } - - eventIndex = 0; - foreach (SmartEvent ev in Script.Events) - { - if (!eventToPresenter.TryGetValue(ev, out var eventPresenter)) - continue; - var height = (float) eventPresenter.DesiredSize.Height; - if (draggingEvents && GetSelected(eventPresenter)) - { - float conditionsHeight = ArrangeConditions(eventIndex, 20 + PaddingLeft, finalSize, eventPresenter, start, height); - height = Math.Max(height + conditionsHeight, ArrangeActions(eventIndex, 20, finalSize, eventPresenter, start, height)); - eventPresenter.Arrange(new Rect(20 + PaddingLeft, start, EventWidth - PaddingLeft, height)); - start += height + EventSpacing; - } - - eventIndex++; - } - - return finalSize; - } - - private float ArrangeActions(int eventIndex, - float x, - Size totalSize, - ContentPresenter eveentPresenter, - float y, - float eventHeight) - { - float totalHeight = 26; - if (!presenterToEvent.TryGetValue(eveentPresenter, out SmartEvent @event)) - return totalHeight; - - var actionIndex = 0; - foreach (SmartAction action in @event.Actions) - { - if (!actionToPresenter.TryGetValue(action, out ContentPresenter actionPresenter)) - continue; - - var height = (float) actionPresenter.DesiredSize.Height; - actionPresenter.Arrange(new Rect(EventWidth + x, y, Math.Max(totalSize.Width - EventWidth, 0), height)); - actionHeights.Add((y + (height + ActionSpacing) / 2, height + ActionSpacing, actionIndex, eventIndex)); - y += height + ActionSpacing; - - totalHeight += height + ActionSpacing; - actionIndex++; - } - - float rest = Math.Max(26, eventHeight - (totalHeight - 26)); - - actionHeights.Add((y + (rest + ActionSpacing) / 2, rest, actionIndex, eventIndex)); - - return totalHeight; - } - - private float MeasureActions(ContentPresenter eventPresenter) - { - float totalHeight = 26; - if (!presenterToEvent.TryGetValue(eventPresenter, out SmartEvent @event)) - return totalHeight; - - foreach (SmartAction action in @event.Actions) - { - if (!actionToPresenter.TryGetValue(action, out ContentPresenter actionPresenter)) - continue; - - var height = (float) actionPresenter.DesiredSize.Height; - totalHeight += height + ActionSpacing; - } - - return totalHeight; - } - - private float MeasureConditions(ContentPresenter eventPresenter) - { - float totalHeight = 26; - if (!presenterToEvent.TryGetValue(eventPresenter, out SmartEvent @event)) - return totalHeight; - - foreach (SmartCondition condition in @event.Conditions) - { - if (!conditionToPresenter.TryGetValue(condition, out ContentPresenter actionPresenter)) - continue; - - var height = (float) actionPresenter.DesiredSize.Height; - totalHeight += height + ConditionSpacing; - } - - return totalHeight; - } - - private float ArrangeConditions(int eventIndex, - float x, - Size totalSize, - ContentPresenter eveentPresenter, - float y, - float eventHeight) - { - float totalHeight = 26; - if (!presenterToEvent.TryGetValue(eveentPresenter, out SmartEvent @event)) - return totalHeight; - - var conditionIndex = 0; - y += eventHeight; - foreach (SmartCondition condition in @event.Conditions) - { - if (!conditionToPresenter.TryGetValue(condition, out ContentPresenter conditionPresenter)) - continue; - - var height = (float) conditionPresenter.DesiredSize.Height; - conditionPresenter.Arrange(new Rect(x + 21, y, ConditionWidth, height)); - conditionHeights.Add((y + (height + ConditionSpacing) / 2, height + ConditionSpacing, conditionIndex, eventIndex)); - y += height + ConditionSpacing; - - totalHeight += height + ConditionSpacing; - conditionIndex++; - } - - float rest = 5; - - conditionHeights.Add((y + (rest + ActionSpacing) / 2, rest, conditionIndex, eventIndex)); - - return totalHeight; - } - - protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) - { - base.OnRenderSizeChanged(sizeInfo); - InvalidateMeasure(); - InvalidateArrange(); - } - - #region Properties - - public static readonly DependencyProperty SelectedProperty = DependencyProperty.RegisterAttached("Selected", - typeof(bool), - typeof(SmartScriptPanelLayout), - new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsParentArrange)); - - [AttachedPropertyBrowsableForChildren] - public static bool GetSelected(UIElement element) - { - if (element == null) - throw new ArgumentNullException("element"); - - return (bool) element.GetValue(SelectedProperty); - } - - [AttachedPropertyBrowsableForChildren] - public static void SetSelected(UIElement element, bool length) - { - if (element == null) - throw new ArgumentNullException("element"); - - element.SetValue(SelectedProperty, length); - } - - public int OverIndexEvent - { - get => (int) GetValue(OverIndexEventProperty); - set => SetValue(OverIndexEventProperty, value); - } - - public static readonly DependencyProperty OverIndexEventProperty = DependencyProperty.Register(nameof(OverIndexEvent), - typeof(int), - typeof(SmartScriptPanelLayout), - new PropertyMetadata(0)); - - - public SmartScript Script - { - get => (SmartScript) GetValue(ScriptProperty); - set => SetValue(ScriptProperty, value); - } - - public static readonly DependencyProperty ScriptProperty = DependencyProperty.Register(nameof(Script), - typeof(SmartScript), - typeof(SmartScriptPanelLayout), - new PropertyMetadata(null)); - - public Dictionary? Problems - { - get => (Dictionary?)GetValue(ProblemsProperty); - set => SetValue(ProblemsProperty, value); - } - - public static readonly DependencyProperty ProblemsProperty = DependencyProperty.Register(nameof(Problems), - typeof(Dictionary), - typeof(SmartScriptPanelLayout), - new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender)); - - public float EventSpacing - { - get => (float) GetValue(EventSpacingProperty); - set => SetValue(EventSpacingProperty, value); - } - - public static readonly DependencyProperty EventSpacingProperty = DependencyProperty.Register(nameof(EventSpacing), - typeof(float), - typeof(SmartScriptPanelLayout), - new PropertyMetadata(10f)); - - public float ConditionSpacing - { - get => (float) GetValue(ConditionSpacingProperty); - set => SetValue(ConditionSpacingProperty, value); - } - - public static readonly DependencyProperty ConditionSpacingProperty = DependencyProperty.Register(nameof(ConditionSpacing), - typeof(float), - typeof(SmartScriptPanelLayout), - new PropertyMetadata(1f)); - - public float ActionSpacing - { - get => (float) GetValue(ActionSpacingProperty); - set => SetValue(ActionSpacingProperty, value); - } - - public static readonly DependencyProperty ActionSpacingProperty = DependencyProperty.Register(nameof(ActionSpacing), - typeof(float), - typeof(SmartScriptPanelLayout), - new PropertyMetadata(2f)); - - public static readonly DependencyProperty DropItemsProperty = DependencyProperty.Register(nameof(DropItems), - typeof(ICommand), - typeof(SmartScriptPanelLayout), - new UIPropertyMetadata(null)); - - public ICommand DropItems - { - get => (ICommand) GetValue(DropItemsProperty); - set => SetValue(DropItemsProperty, value); - } - - public static readonly DependencyProperty DropActionsProperty = DependencyProperty.Register(nameof(DropActions), - typeof(ICommand), - typeof(SmartScriptPanelLayout), - new UIPropertyMetadata(null)); - - public ICommand DropActions - { - get => (ICommand) GetValue(DropActionsProperty); - set => SetValue(DropActionsProperty, value); - } - - public static readonly DependencyProperty DropConditionsProperty = DependencyProperty.Register(nameof(DropConditions), - typeof(ICommand), - typeof(SmartScriptPanelLayout), - new UIPropertyMetadata(null)); - - public ICommand DropConditions - { - get => (ICommand) GetValue(DropConditionsProperty); - set => SetValue(DropConditionsProperty, value); - } - - #endregion - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptView.xaml b/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptView.xaml deleted file mode 100644 index fe3527380..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptView.xaml +++ /dev/null @@ -1,179 +0,0 @@ - - - - False - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptView.xaml.cs b/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptView.xaml.cs deleted file mode 100644 index 9f1e23357..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/UserControls/SmartScriptView.xaml.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace WDE.SmartScriptEditor.WPF.Editor.UserControls -{ - /// - /// Interaction logic for SmartScriptView.xaml - /// - public partial class SmartScriptView : UserControl - { - public static DependencyProperty DeleteEventCommandProperty = - DependencyProperty.Register("DeleteEventCommand", typeof(ICommand), typeof(SmartScriptView)); - - public SmartScriptView() - { - InitializeComponent(); - } - - public ICommand DeleteEventCommand - { - get => (ICommand) GetValue(DeleteEventCommandProperty); - set => SetValue(DeleteEventCommandProperty, value); - } - - private void EventSetter_OnHandler(object sender, MouseButtonEventArgs e) - { - } - - private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e) - { - } - - private void UIElement_OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Delete) - DeleteEventCommand?.Execute(this); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/Views/Editing/ParameterEditorView.cs b/WDE.SmartScriptEditor.WPF/Editor/Views/Editing/ParameterEditorView.cs deleted file mode 100644 index fe42ceb0e..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/Views/Editing/ParameterEditorView.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace WDE.SmartScriptEditor.WPF.Editor.Views.Editing -{ - /// - /// Interaction logic for ParameterEditorView - /// - public class ParameterEditorView : Control - { - static ParameterEditorView() - { - FocusableProperty.OverrideMetadata(typeof(ParameterEditorView), new FrameworkPropertyMetadata(false)); - KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(ParameterEditorView), new FrameworkPropertyMetadata(KeyboardNavigationMode.Local)); - DefaultStyleKeyProperty.OverrideMetadata(typeof(ParameterEditorView), new FrameworkPropertyMetadata(typeof(ParameterEditorView))); - } - } -} \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/Editor/Views/Editing/ParametersEditView.xaml b/WDE.SmartScriptEditor.WPF/Editor/Views/Editing/ParametersEditView.xaml deleted file mode 100644 index c48696c36..000000000 --- a/WDE.SmartScriptEditor.WPF/Editor/Views/Editing/ParametersEditView.xaml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WDE.SmartScriptEditor.WPF/WDE.SmartScriptEditor.WPF.csproj b/WDE.SmartScriptEditor.WPF/WDE.SmartScriptEditor.WPF.csproj deleted file mode 100644 index c354dae9b..000000000 --- a/WDE.SmartScriptEditor.WPF/WDE.SmartScriptEditor.WPF.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - net5.0-windows7.0 - true - 0.0.0.0 - 0.0.0.0 - Debug;Release - AnyCPU - - - - - - - - - - - 1.1.31 - - - 7.2.0.1422 - - - - ..\bin\$(Configuration)\ - - - - - diff --git a/WDE.SmartScriptEditor/WDE.SmartScriptEditor.csproj b/WDE.SmartScriptEditor/WDE.SmartScriptEditor.csproj index 0aeabb3a8..4e808036a 100644 --- a/WDE.SmartScriptEditor/WDE.SmartScriptEditor.csproj +++ b/WDE.SmartScriptEditor/WDE.SmartScriptEditor.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library false Debug;Release diff --git a/WDE.Solutions/WDE.Solutions.csproj b/WDE.Solutions/WDE.Solutions.csproj index ed3edcfd7..86feb0f44 100644 --- a/WDE.Solutions/WDE.Solutions.csproj +++ b/WDE.Solutions/WDE.Solutions.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library false Debug;Release diff --git a/WDE.SourceCodeIntegrationEditor/WDE.SourceCodeIntegrationEditor.csproj b/WDE.SourceCodeIntegrationEditor/WDE.SourceCodeIntegrationEditor.csproj index 335a496e2..79f95ce4e 100644 --- a/WDE.SourceCodeIntegrationEditor/WDE.SourceCodeIntegrationEditor.csproj +++ b/WDE.SourceCodeIntegrationEditor/WDE.SourceCodeIntegrationEditor.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 0.0.0.0 0.0.0.0 Debug;Release diff --git a/WDE.Spells/WDE.Spells.csproj b/WDE.Spells/WDE.Spells.csproj index a5031fddd..591e846e2 100644 --- a/WDE.Spells/WDE.Spells.csproj +++ b/WDE.Spells/WDE.Spells.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library false Debug;Release diff --git a/WDE.SqlInterpreter/WDE.SqlInterpreter.csproj b/WDE.SqlInterpreter/WDE.SqlInterpreter.csproj index 3b14d832d..5e52aadb3 100644 --- a/WDE.SqlInterpreter/WDE.SqlInterpreter.csproj +++ b/WDE.SqlInterpreter/WDE.SqlInterpreter.csproj @@ -1,6 +1,6 @@ - net5.0 + net6.0 Library false enable diff --git a/WDE.SqlQueryGenerator/WDE.SqlQueryGenerator.csproj b/WDE.SqlQueryGenerator/WDE.SqlQueryGenerator.csproj index d5d4bad5e..684ce9af6 100644 --- a/WDE.SqlQueryGenerator/WDE.SqlQueryGenerator.csproj +++ b/WDE.SqlQueryGenerator/WDE.SqlQueryGenerator.csproj @@ -1,6 +1,6 @@ - net5.0 + net6.0 Library false enable diff --git a/WDE.ThemeChanger/App.config b/WDE.ThemeChanger/App.config deleted file mode 100644 index 917b33441..000000000 --- a/WDE.ThemeChanger/App.config +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/WDE.ThemeChanger/Data/ThemeSettings.cs b/WDE.ThemeChanger/Data/ThemeSettings.cs deleted file mode 100644 index 095532ea5..000000000 --- a/WDE.ThemeChanger/Data/ThemeSettings.cs +++ /dev/null @@ -1,14 +0,0 @@ -using WDE.Common.Services; - -namespace WDE.ThemeChanger.Data -{ - public struct ThemeSettings : ISettings - { - public string Name { get; } - - public ThemeSettings(string name) - { - Name = name; - } - } -} \ No newline at end of file diff --git a/WDE.ThemeChanger/Properties/AssemblyInfo.cs b/WDE.ThemeChanger/Properties/AssemblyInfo.cs deleted file mode 100644 index 6cce24fe1..000000000 --- a/WDE.ThemeChanger/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WDE.ThemeChanger")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WDE.ThemeChanger")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo(ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/WDE.ThemeChanger/Properties/Resources.Designer.cs b/WDE.ThemeChanger/Properties/Resources.Designer.cs deleted file mode 100644 index cb2592f9c..000000000 --- a/WDE.ThemeChanger/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WDE.ThemeChanger.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WDE.ThemeChanger.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/WDE.ThemeChanger/Properties/Resources.resx b/WDE.ThemeChanger/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/WDE.ThemeChanger/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/WDE.ThemeChanger/Properties/Settings.Designer.cs b/WDE.ThemeChanger/Properties/Settings.Designer.cs deleted file mode 100644 index ac0a2d4db..000000000 --- a/WDE.ThemeChanger/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WDE.ThemeChanger.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/WDE.ThemeChanger/Properties/Settings.settings b/WDE.ThemeChanger/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/WDE.ThemeChanger/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/WDE.ThemeChanger/Providers/IThemeSettingsProvider.cs b/WDE.ThemeChanger/Providers/IThemeSettingsProvider.cs deleted file mode 100644 index 34ee6b969..000000000 --- a/WDE.ThemeChanger/Providers/IThemeSettingsProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -using WDE.Common.Managers; -using WDE.ThemeChanger.Data; - -namespace WDE.ThemeChanger.Providers -{ - public interface IThemeSettingsProvider - { - ThemeSettings GetSettings(); - void UpdateSettings(Theme themeName); - } -} \ No newline at end of file diff --git a/WDE.ThemeChanger/Providers/ThemeSettingsProvider.cs b/WDE.ThemeChanger/Providers/ThemeSettingsProvider.cs deleted file mode 100644 index 8a6b3a712..000000000 --- a/WDE.ThemeChanger/Providers/ThemeSettingsProvider.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.IO; -using Newtonsoft.Json; -using WDE.Common.Managers; -using WDE.Common.Services; -using WDE.Module.Attributes; -using WDE.ThemeChanger.Data; - -namespace WDE.ThemeChanger.Providers -{ - [AutoRegister] - [SingleInstance] - public class ThemeSettingsProvider : IThemeSettingsProvider - { - private readonly IUserSettings userSettings; - - public ThemeSettingsProvider(IUserSettings userSettings) - { - this.userSettings = userSettings; - Settings = userSettings.Get(); - } - - private ThemeSettings Settings { get; set; } - - public ThemeSettings GetSettings() - { - return Settings; - } - - public void UpdateSettings(Theme theme) - { - userSettings.Update(new ThemeSettings(theme.Name)); - } - } -} \ No newline at end of file diff --git a/WDE.ThemeChanger/ThemeChangerModule.cs b/WDE.ThemeChanger/ThemeChangerModule.cs deleted file mode 100644 index f7993d098..000000000 --- a/WDE.ThemeChanger/ThemeChangerModule.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Prism.Ioc; -using WDE.Common.Managers; -using WDE.Module; -using WDE.Module.Attributes; - -namespace WDE.ThemeChanger -{ - [AutoRegister] - [SingleInstance] - public class ThemeChangerModule : ModuleBase - { - public override void OnInitialized(IContainerProvider containerProvider) - { - containerProvider.Resolve(); - } - } -} \ No newline at end of file diff --git a/WDE.ThemeChanger/ThemeManager.cs b/WDE.ThemeChanger/ThemeManager.cs deleted file mode 100644 index b98e32450..000000000 --- a/WDE.ThemeChanger/ThemeManager.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows; -using WDE.Common.Managers; -using WDE.Module.Attributes; -using WDE.ThemeChanger.Providers; - -namespace WDE.ThemeChanger -{ - [AutoRegister] - [SingleInstance] - public class ThemeManager : IThemeManager - { - private readonly Theme defaultTheme = new("BlueTheme"); - - public ThemeManager(IThemeSettingsProvider themeSettings) - { - string currentThemeName = themeSettings.GetSettings().Name; - - Theme theme = new(currentThemeName); - - if (!IsValidTheme(theme)) - theme = defaultTheme; - - SetTheme(theme); - } - - private List themes => new() {new("DarkTheme"), new("BlueTheme")}; - - public Theme CurrentTheme { get; private set; } - - public IEnumerable Themes => themes; - - public void SetTheme(Theme theme) - { - if (!IsValidTheme(theme)) - return; - - var curentTheme = Application.Current.Resources.MergedDictionaries[1].Source.ToString(); - string compareStr = "/" + theme.Name + ".xaml"; - - if (!curentTheme.Contains(compareStr)) - { - Application.Current.Resources.MergedDictionaries.Clear(); - Uri uriOne = new("pack://application:,,,/AvalonDock.Themes.VS2013;component/" + theme.Name + ".xaml"); - Uri uriTwo = new("Themes/" + theme.Name + ".xaml", UriKind.RelativeOrAbsolute); - Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary {Source = uriOne}); - Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary {Source = uriTwo}); - } - - CurrentTheme = theme; - } - - private bool IsValidTheme(Theme theme) - { - return !string.IsNullOrEmpty(theme.Name) && themes.Select(t => t.Name).Contains(theme.Name); - } - } -} \ No newline at end of file diff --git a/WDE.ThemeChanger/ViewModels/ThemeConfigViewModel.cs b/WDE.ThemeChanger/ViewModels/ThemeConfigViewModel.cs deleted file mode 100644 index 5485f7d2b..000000000 --- a/WDE.ThemeChanger/ViewModels/ThemeConfigViewModel.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Input; -using Prism.Commands; -using Prism.Mvvm; -using WDE.Common; -using WDE.Common.Managers; -using WDE.Module.Attributes; -using WDE.ThemeChanger.Providers; - -namespace WDE.ThemeChanger.ViewModels -{ - [AutoRegister] - public class ThemeConfigViewModel : BindableBase, IConfigurable - { - private Theme name; - private List themes; - - public ThemeConfigViewModel(IThemeSettingsProvider settings, IThemeManager themeManager) - { - name = themeManager.CurrentTheme; - themes = themeManager.Themes.ToList(); - - Save = new DelegateCommand(() => - { - themeManager.SetTheme(ThemeName); - settings.UpdateSettings(ThemeName); - IsModified = false; - }); - } - - public Theme ThemeName - { - get => name; - set - { - IsModified = true; - SetProperty(ref name, value); - } - } - - public List Themes - { - get => themes; - set => SetProperty(ref themes, value); - } - - public ICommand Save { get; } - public string Name => "Appearance"; - public string ShortDescription => null; - public bool IsRestartRequired => false; - - private bool isModified; - public bool IsModified - { - get => isModified; - private set => SetProperty(ref isModified, value); - } - } -} \ No newline at end of file diff --git a/WDE.ThemeChanger/Views/ThemeConfigView.xaml b/WDE.ThemeChanger/Views/ThemeConfigView.xaml deleted file mode 100644 index 106eab1fd..000000000 --- a/WDE.ThemeChanger/Views/ThemeConfigView.xaml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/WDE.ThemeChanger/Views/ThemeConfigView.xaml.cs b/WDE.ThemeChanger/Views/ThemeConfigView.xaml.cs deleted file mode 100644 index 7661355b0..000000000 --- a/WDE.ThemeChanger/Views/ThemeConfigView.xaml.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Controls; - -namespace WDE.ThemeChanger.Views -{ - /// - /// Interaction logic for ThemeConfigView.xaml - /// - public partial class ThemeConfigView : UserControl - { - public ThemeConfigView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WDE.ThemeChanger/WDE.ThemeChanger.csproj b/WDE.ThemeChanger/WDE.ThemeChanger.csproj deleted file mode 100644 index f96140d9a..000000000 --- a/WDE.ThemeChanger/WDE.ThemeChanger.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - net5.0-windows7.0 - Library - false - true - Debug;Release - AnyCPU - - - ..\bin\$(Configuration)\ - - - - - - - - - - - 2.0.5 - - - 12.0.3 - - - 7.2.0.1422 - - - 5.11.6 - - - 5.11.10 - - - 5.11.1 - - - \ No newline at end of file diff --git a/WDE.Trinity/WDE.Trinity.csproj b/WDE.Trinity/WDE.Trinity.csproj index 4543a6f26..59ca2dd41 100644 --- a/WDE.Trinity/WDE.Trinity.csproj +++ b/WDE.Trinity/WDE.Trinity.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 Library enable nullable diff --git a/WDE.TrinitySmartScriptEditor/WDE.TrinitySmartScriptEditor.csproj b/WDE.TrinitySmartScriptEditor/WDE.TrinitySmartScriptEditor.csproj index fcc15a1b2..e2fee83a2 100644 --- a/WDE.TrinitySmartScriptEditor/WDE.TrinitySmartScriptEditor.csproj +++ b/WDE.TrinitySmartScriptEditor/WDE.TrinitySmartScriptEditor.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library false Debug;Release diff --git a/WDE.Updater/WDE.Updater.csproj b/WDE.Updater/WDE.Updater.csproj index 40c1a7282..e8679e273 100644 --- a/WDE.Updater/WDE.Updater.csproj +++ b/WDE.Updater/WDE.Updater.csproj @@ -1,6 +1,6 @@ - net5.0 + net6.0 Library false enable diff --git a/WDE.WoWHeadConnector/WDE.WoWHeadConnector.csproj b/WDE.WoWHeadConnector/WDE.WoWHeadConnector.csproj index c83fddc66..393e6d320 100644 --- a/WDE.WoWHeadConnector/WDE.WoWHeadConnector.csproj +++ b/WDE.WoWHeadConnector/WDE.WoWHeadConnector.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable enable diff --git a/WDE.WorldMap/WDE.WorldMap.csproj b/WDE.WorldMap/WDE.WorldMap.csproj index 6d1c896bb..8c5d98e80 100644 --- a/WDE.WorldMap/WDE.WorldMap.csproj +++ b/WDE.WorldMap/WDE.WorldMap.csproj @@ -2,7 +2,7 @@ Library - net5.0 + net6.0 Debug;Release AnyCPU enable diff --git a/WoWDatabaseEditor.Common/WDE.Common/WDE.Common.csproj b/WoWDatabaseEditor.Common/WDE.Common/WDE.Common.csproj index f02671ad4..507039398 100644 --- a/WoWDatabaseEditor.Common/WDE.Common/WDE.Common.csproj +++ b/WoWDatabaseEditor.Common/WDE.Common/WDE.Common.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library false Debug;Release diff --git a/WoWDatabaseEditor.Common/WDE.DbcStore/WDE.DbcStore.csproj b/WoWDatabaseEditor.Common/WDE.DbcStore/WDE.DbcStore.csproj index 277dc7c67..1f21c4001 100644 --- a/WoWDatabaseEditor.Common/WDE.DbcStore/WDE.DbcStore.csproj +++ b/WoWDatabaseEditor.Common/WDE.DbcStore/WDE.DbcStore.csproj @@ -1,6 +1,6 @@ - net5.0 + net6.0 Library false Debug;Release diff --git a/WoWDatabaseEditor.Common/WDE.History/WDE.History.csproj b/WoWDatabaseEditor.Common/WDE.History/WDE.History.csproj index 60bd5cf5a..cf8019a4b 100644 --- a/WoWDatabaseEditor.Common/WDE.History/WDE.History.csproj +++ b/WoWDatabaseEditor.Common/WDE.History/WDE.History.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library false Debug;Release diff --git a/WoWDatabaseEditor.Common/WDE.SkyFireMySqlDatabase/WDE.SkyFireMySqlDatabase.csproj b/WoWDatabaseEditor.Common/WDE.SkyFireMySqlDatabase/WDE.SkyFireMySqlDatabase.csproj index 2abf17f45..138e9f5a3 100644 --- a/WoWDatabaseEditor.Common/WDE.SkyFireMySqlDatabase/WDE.SkyFireMySqlDatabase.csproj +++ b/WoWDatabaseEditor.Common/WDE.SkyFireMySqlDatabase/WDE.SkyFireMySqlDatabase.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library false enable diff --git a/WoWDatabaseEditor.Common/WDE.TrinityMySqlDatabase/WDE.TrinityMySqlDatabase.csproj b/WoWDatabaseEditor.Common/WDE.TrinityMySqlDatabase/WDE.TrinityMySqlDatabase.csproj index 2abf17f45..138e9f5a3 100644 --- a/WoWDatabaseEditor.Common/WDE.TrinityMySqlDatabase/WDE.TrinityMySqlDatabase.csproj +++ b/WoWDatabaseEditor.Common/WDE.TrinityMySqlDatabase/WDE.TrinityMySqlDatabase.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library false enable diff --git a/WoWDatabaseEditor.sln b/WoWDatabaseEditor.sln index 27890b765..0c58ba176 100644 --- a/WoWDatabaseEditor.sln +++ b/WoWDatabaseEditor.sln @@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29728.190 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoaderAvalonia", "LoaderAvalonia\LoaderAvalonia.csproj", "{8B25EEAE-2DDD-4D62-A426-619FE21D2711}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WoWDatabaseEditorCore", "WoWDatabaseEditor\WoWDatabaseEditorCore.csproj", "{99C9E82C-C594-446D-AA59-8FFBC43AD226}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WDE.SmartScriptEditor", "WDE.SmartScriptEditor\WDE.SmartScriptEditor.csproj", "{B060C7F1-97B0-4A26-B7A8-E47C9AF08D07}" @@ -21,14 +23,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WDE.SQLEditor", "WDE.SQLEdi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WDE.TrinityMySqlDatabase", "WoWDatabaseEditor.Common\WDE.TrinityMySqlDatabase\WDE.TrinityMySqlDatabase.csproj", "{C6BE1E01-CF2F-4FE5-A67C-AC783EB9D3F7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WDE.Blueprints", "WDE.Blueprints\WDE.Blueprints.csproj", "{4A11961B-85AD-464E-B881-C90F8CAC5647}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeminiGraphEditor", "GeminiGraphEditor\GeminiGraphEditor.csproj", "{99F6C079-A4C1-4167-992C-B02EBAA70219}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WDE.QuestChainEditor", "WDE.QuestChainEditor\WDE.QuestChainEditor.csproj", "{F9373E23-7E19-44D2-8EC9-E638ED1243AA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QuestChainTest", "QuestChainTest\QuestChainTest.csproj", "{8F5E8C3A-422A-47C6-AFC3-4A62997E5D27}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WDE.Conditions", "WDE.Conditions\WDE.Conditions.csproj", "{A55A533C-AE21-44BB-867B-1AD5BFFCCCBA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WDE.MVVM", "WDE.MVVM\WDE.MVVM.csproj", "{0913A384-D1CD-4531-8077-E53C2B15C193}" @@ -62,62 +56,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution Items", "Solution appveyor.yml = appveyor.yml Directory.Build.props = Directory.Build.props Avalonia.props = Avalonia.props + README.md = README.md EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WoWDatabaseEditorCore.Avalonia", "WoWDatabaseEditorCore.Avalonia\WoWDatabaseEditorCore.Avalonia.csproj", "{D38826BA-F862-4895-80DB-32CB5821ED67}" - ProjectSection(ProjectDependencies) = postProject - {99C9E82C-C594-446D-AA59-8FFBC43AD226} = {99C9E82C-C594-446D-AA59-8FFBC43AD226} - {B060C7F1-97B0-4A26-B7A8-E47C9AF08D07} = {B060C7F1-97B0-4A26-B7A8-E47C9AF08D07} - {ACD1C8BC-B91A-40E8-865D-D6826758E7CC} = {ACD1C8BC-B91A-40E8-865D-D6826758E7CC} - {3CD1E251-D9BF-4061-A8D5-4AC65106C896} = {3CD1E251-D9BF-4061-A8D5-4AC65106C896} - {A6109F89-0148-4C39-8631-206FFEFBA055} = {A6109F89-0148-4C39-8631-206FFEFBA055} - {BC7E0845-C750-4DAF-8869-9170211465E6} = {BC7E0845-C750-4DAF-8869-9170211465E6} - {7E0DE187-A45C-406B-AAAE-608F40237CE6} = {7E0DE187-A45C-406B-AAAE-608F40237CE6} - {C6BE1E01-CF2F-4FE5-A67C-AC783EB9D3F7} = {C6BE1E01-CF2F-4FE5-A67C-AC783EB9D3F7} - {A55A533C-AE21-44BB-867B-1AD5BFFCCCBA} = {A55A533C-AE21-44BB-867B-1AD5BFFCCCBA} - {AD615AB8-1CE6-474F-BC6C-8BF0D0C7AFBF} = {AD615AB8-1CE6-474F-BC6C-8BF0D0C7AFBF} - {4A5E9E2A-DBC9-4290-ACEB-B108FA458F0E} = {4A5E9E2A-DBC9-4290-ACEB-B108FA458F0E} - {0913A384-D1CD-4531-8077-E53C2B15C193} = {0913A384-D1CD-4531-8077-E53C2B15C193} - {5647D3F5-EDF9-4D44-AAB9-678B31D57E6C} = {5647D3F5-EDF9-4D44-AAB9-678B31D57E6C} - {480A1F45-1C08-45AA-9268-CEC3468D7570} = {480A1F45-1C08-45AA-9268-CEC3468D7570} - {7ACFACDD-9DE8-4DF3-B283-171639FD9E1E} = {7ACFACDD-9DE8-4DF3-B283-171639FD9E1E} - {C238232F-57F1-465D-A251-578224F8EA25} = {C238232F-57F1-465D-A251-578224F8EA25} - {A094F0F9-C067-4B66-8FCA-ECA3747C6A4C} = {A094F0F9-C067-4B66-8FCA-ECA3747C6A4C} - {FF98ED22-0FFC-4C53-8946-437F5B84441F} = {FF98ED22-0FFC-4C53-8946-437F5B84441F} - {506C7413-6FD7-472C-99AA-A0580B4D2E3B} = {506C7413-6FD7-472C-99AA-A0580B4D2E3B} - {DCD5F40C-139E-4404-8EF0-DC85DD595E44} = {DCD5F40C-139E-4404-8EF0-DC85DD595E44} - {1879936C-7EB8-4A2F-9791-4EF49ED2B6B5} = {1879936C-7EB8-4A2F-9791-4EF49ED2B6B5} - {93427DB8-F7A4-43B2-9BCB-AF13544CE1DC} = {93427DB8-F7A4-43B2-9BCB-AF13544CE1DC} - {7DDB9C5A-AA34-42AB-99E3-1280D1E0311F} = {7DDB9C5A-AA34-42AB-99E3-1280D1E0311F} - {2B3DFEB9-808F-4EC4-B848-3C2533B40B39} = {2B3DFEB9-808F-4EC4-B848-3C2533B40B39} - {B0F1E33D-8CD2-4839-8F87-E8835F5F8D0B} = {B0F1E33D-8CD2-4839-8F87-E8835F5F8D0B} - {B421A454-BCA5-4B10-B0BD-BBEB5AAD3294} = {B421A454-BCA5-4B10-B0BD-BBEB5AAD3294} - {34D133BE-D86C-49F7-8536-45E202E1EE7B} = {34D133BE-D86C-49F7-8536-45E202E1EE7B} - {96B60B17-8A72-40B5-9D2E-09BF256D7B07} = {96B60B17-8A72-40B5-9D2E-09BF256D7B07} - {6E0C8CDD-031A-4318-B612-9F1A575163AC} = {6E0C8CDD-031A-4318-B612-9F1A575163AC} - {5AE7D201-A541-49F3-A980-3935D3FCA48D} = {5AE7D201-A541-49F3-A980-3935D3FCA48D} - - # WPP - {9C185B8A-052F-4240-9EC3-729496124402} = {9C185B8A-052F-4240-9EC3-729496124402} - {A0CD6DDC-E2B3-400E-ACB7-E2339B74FCF9} = {A0CD6DDC-E2B3-400E-ACB7-E2339B74FCF9} - {733875B9-E2B9-4EF5-8B5C-B8E98AF25975} = {733875B9-E2B9-4EF5-8B5C-B8E98AF25975} - {A072A641-D60D-4765-B8BD-F00F727B4F89} = {A072A641-D60D-4765-B8BD-F00F727B4F89} - {0330F689-A57E-4609-8F95-E766C0B8FFEC} = {0330F689-A57E-4609-8F95-E766C0B8FFEC} - {AA0F45A4-467B-41AF-AA00-843D013E0156} = {AA0F45A4-467B-41AF-AA00-843D013E0156} - {8C9313FD-A37C-45A2-9003-E84747E36188} = {8C9313FD-A37C-45A2-9003-E84747E36188} - {F12A19FD-BCA3-426D-A4DA-7DE75EB9E39E} = {F12A19FD-BCA3-426D-A4DA-7DE75EB9E39E} - {34CB52B4-2CB9-4E44-AF77-9F12C546775F} = {34CB52B4-2CB9-4E44-AF77-9F12C546775F} - {39A20758-BC18-4925-B22C-C16CF8943131} = {39A20758-BC18-4925-B22C-C16CF8943131} - {FB301202-68DD-4048-8734-C82E6FF42302} = {FB301202-68DD-4048-8734-C82E6FF42302} - {24D556A8-025D-4031-AB19-B87815750190} = {24D556A8-025D-4031-AB19-B87815750190} - {315B1ACB-A34C-4541-A547-E6701688874A} = {315B1ACB-A34C-4541-A547-E6701688874A} - {2FD96AE7-74EA-4608-8071-CAFE6948FB6D} = {2FD96AE7-74EA-4608-8071-CAFE6948FB6D} - {0A932EF2-830E-4409-AE4F-78A9C110E21F} = {0A932EF2-830E-4409-AE4F-78A9C110E21F} - {0643A92F-D13C-493C-AE87-37EE67B17EF6} = {0643A92F-D13C-493C-AE87-37EE67B17EF6} - # WPP end - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoaderAvalonia", "LoaderAvalonia\LoaderAvalonia.csproj", "{8B25EEAE-2DDD-4D62-A426-619FE21D2711}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WDE.DatabaseEditors", "WDE.DatabaseEditors\WDE.DatabaseEditors.csproj", "{1879936C-7EB8-4A2F-9791-4EF49ED2B6B5}" EndProject @@ -149,8 +91,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WDE.SmartScriptEditor.Test" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docking", "Docking", "{AE8F68E4-310D-4A59-9B78-5B44CAB1DBF6}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Legacy", "Legacy", "{84D7A851-140E-4077-9060-826F9D990C5B}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cores", "Cores", "{0DA53E9B-250E-4D88-A456-35436FEA60F5}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{6C7361F8-036F-4C9A-8002-A94B71005DDB}" @@ -291,14 +231,6 @@ Global {C6BE1E01-CF2F-4FE5-A67C-AC783EB9D3F7}.Debug|Any CPU.Build.0 = Debug|Any CPU {C6BE1E01-CF2F-4FE5-A67C-AC783EB9D3F7}.Release|Any CPU.ActiveCfg = Release|Any CPU {C6BE1E01-CF2F-4FE5-A67C-AC783EB9D3F7}.Release|Any CPU.Build.0 = Release|Any CPU - {4A11961B-85AD-464E-B881-C90F8CAC5647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A11961B-85AD-464E-B881-C90F8CAC5647}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99F6C079-A4C1-4167-992C-B02EBAA70219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99F6C079-A4C1-4167-992C-B02EBAA70219}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9373E23-7E19-44D2-8EC9-E638ED1243AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9373E23-7E19-44D2-8EC9-E638ED1243AA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F5E8C3A-422A-47C6-AFC3-4A62997E5D27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F5E8C3A-422A-47C6-AFC3-4A62997E5D27}.Release|Any CPU.ActiveCfg = Release|Any CPU {A55A533C-AE21-44BB-867B-1AD5BFFCCCBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A55A533C-AE21-44BB-867B-1AD5BFFCCCBA}.Debug|Any CPU.Build.0 = Debug|Any CPU {A55A533C-AE21-44BB-867B-1AD5BFFCCCBA}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -601,9 +533,6 @@ Global {80EDB0DB-C085-4AAD-BF82-EACC1EB30F44} = {AE8F68E4-310D-4A59-9B78-5B44CAB1DBF6} {F435BC90-7D12-4BDC-B337-F83A26EB77FD} = {AE8F68E4-310D-4A59-9B78-5B44CAB1DBF6} {5395540E-4AA8-4CC2-93E3-FF3AA02C1EB8} = {AE8F68E4-310D-4A59-9B78-5B44CAB1DBF6} - {99F6C079-A4C1-4167-992C-B02EBAA70219} = {84D7A851-140E-4077-9060-826F9D990C5B} - {8F5E8C3A-422A-47C6-AFC3-4A62997E5D27} = {84D7A851-140E-4077-9060-826F9D990C5B} - {4A11961B-85AD-464E-B881-C90F8CAC5647} = {84D7A851-140E-4077-9060-826F9D990C5B} {4A5E9E2A-DBC9-4290-ACEB-B108FA458F0E} = {0DA53E9B-250E-4D88-A456-35436FEA60F5} {AD615AB8-1CE6-474F-BC6C-8BF0D0C7AFBF} = {0DA53E9B-250E-4D88-A456-35436FEA60F5} {9D1A4E14-2FE1-403A-A042-ED7E49DB0438} = {6C7361F8-036F-4C9A-8002-A94B71005DDB} @@ -611,7 +540,6 @@ Global {5647D3F5-EDF9-4D44-AAB9-678B31D57E6C} = {6C7361F8-036F-4C9A-8002-A94B71005DDB} {0913A384-D1CD-4531-8077-E53C2B15C193} = {6C7361F8-036F-4C9A-8002-A94B71005DDB} {978E01E8-6BCF-4866-9567-301E7B6E6988} = {6C7361F8-036F-4C9A-8002-A94B71005DDB} - {F9373E23-7E19-44D2-8EC9-E638ED1243AA} = {84D7A851-140E-4077-9060-826F9D990C5B} {1879936C-7EB8-4A2F-9791-4EF49ED2B6B5} = {106EEB05-E9AB-453A-ADD0-96505F405D76} {DCD5F40C-139E-4404-8EF0-DC85DD595E44} = {106EEB05-E9AB-453A-ADD0-96505F405D76} {B060C7F1-97B0-4A26-B7A8-E47C9AF08D07} = {106EEB05-E9AB-453A-ADD0-96505F405D76} diff --git a/WoWDatabaseEditor/WoWDatabaseEditorCore.csproj b/WoWDatabaseEditor/WoWDatabaseEditorCore.csproj index d52ba1ff7..0d54e5eb8 100644 --- a/WoWDatabaseEditor/WoWDatabaseEditorCore.csproj +++ b/WoWDatabaseEditor/WoWDatabaseEditorCore.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 Library enable nullable diff --git a/WoWDatabaseEditorCore.Avalonia/Program.cs b/WoWDatabaseEditorCore.Avalonia/Program.cs index 0e26c53a6..c54aef841 100644 --- a/WoWDatabaseEditorCore.Avalonia/Program.cs +++ b/WoWDatabaseEditorCore.Avalonia/Program.cs @@ -15,7 +15,7 @@ namespace WoWDatabaseEditorCore.Avalonia { - class Program + public class Program { // Initialization code. Don't use any Avalonia, third-party APIs or any // SynchronizationContext-reliant code before AppMain is called: things aren't initialized diff --git a/WoWDatabaseEditorCore.Avalonia/WoWDatabaseEditorCore.Avalonia.csproj b/WoWDatabaseEditorCore.Avalonia/WoWDatabaseEditorCore.Avalonia.csproj index af478647e..1ab43e3f9 100644 --- a/WoWDatabaseEditorCore.Avalonia/WoWDatabaseEditorCore.Avalonia.csproj +++ b/WoWDatabaseEditorCore.Avalonia/WoWDatabaseEditorCore.Avalonia.csproj @@ -1,7 +1,7 @@  WinExe - net5.0;net6.0 + net6.0 Debug;Release AnyCPU Icon.ico diff --git a/WoWDatabaseEditorCore.WPF/App.xaml b/WoWDatabaseEditorCore.WPF/App.xaml deleted file mode 100644 index 957acc18a..000000000 --- a/WoWDatabaseEditorCore.WPF/App.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/WoWDatabaseEditorCore.WPF/App.xaml.cs b/WoWDatabaseEditorCore.WPF/App.xaml.cs deleted file mode 100644 index 0a1c7b715..000000000 --- a/WoWDatabaseEditorCore.WPF/App.xaml.cs +++ /dev/null @@ -1,312 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.Loader; -using System.Windows; -using Prism.Events; -using Prism.Ioc; -using Prism.Modularity; -using Prism.Unity; -using Prism.Unity.Ioc; -using Unity; -using Unity.RegistrationByConvention; -using WDE.Common.Events; -using WDE.Common.Managers; -using WDE.Common.Services; -using WDE.Common.Services.MessageBox; -using WDE.Common.Tasks; -using WDE.Common.Windows; -using WDE.Common.WPF; -using WDE.Common.WPF.Utils; -using WDE.Module; -using WDE.Module.Attributes; -using WoWDatabaseEditorCore.CoreVersion; -using WoWDatabaseEditorCore.ModulesManagement; -using WoWDatabaseEditorCore.ViewModels; -using WoWDatabaseEditorCore.WPF.Managers; -using WoWDatabaseEditorCore.WPF.Views; -using WoWDatabaseEditorCore.CoreVersion; -using WoWDatabaseEditorCore.Services.FileSystemService; -using WoWDatabaseEditorCore.Services.UserSettingsService; - -namespace WoWDatabaseEditorCore.WPF -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : PrismApplication - { - private IModulesManager? modulesManager; - private SplashScreenView? splash; - - public App() - { - System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; - /* - * .net core (and .net 5) changed the way assembly and type resolving work. - * Preferred way to implement "plugins" is using custom AssemblyLoadContext per plugin - * however, current Prism implementation is not AssemblyLoadContext friendly - * Therefore this workaround make assembly loading work more or less like in .net framework - * All assemblies are loaded to the default context and any type can be found via Type.GetType() - * - * The disadvantage is that assemblies cannot conflict with each other. If using AssemblyLoadContext - * there would be no problem with for instance different versions of a package. - */ - Dictionary assemblyToRequesting = new(); - string? executingAssemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => - { - if (args.Name.EndsWith("resources") || args.RequestingAssembly == null) - return null; - - AssemblyName? name = new(args.Name); - - string? requestingAssemblyPath = executingAssemblyLocation + "/" + args.RequestingAssembly.GetName().Name + ".dll"; - - if (!File.Exists(requestingAssemblyPath)) - { - if (!assemblyToRequesting.TryGetValue(args.RequestingAssembly.GetName().Name ?? "", out requestingAssemblyPath)) - return null; - } - - assemblyToRequesting.Add(name.Name ?? "", requestingAssemblyPath); - - AssemblyDependencyResolver? dependencyPathResolver = new(requestingAssemblyPath); - string? path = dependencyPathResolver.ResolveAssemblyToPath(name); - - if (path == null) - return null; - - if (AssemblyLoadContext.Default.Assemblies.FirstOrDefault(t => t.GetName() == name) != null) - return AssemblyLoadContext.Default.Assemblies.FirstOrDefault(t => t.GetName() == name); - - return AssemblyLoadContext.Default.LoadFromAssemblyPath(path); - }; - - - if (ProgramBootstrap.TryLaunchUpdaterIfNeeded()) - Current.Shutdown(); - } - - protected override IContainerExtension CreateContainerExtension() - { - var unity = new UnityContainer().AddExtension(new Diagnostic()); - var container = new UnityContainerExtension(unity); - var mainScope = new ScopedContainer(container, unity); - container.RegisterInstance(mainScope); - return container; - } - - protected override Window CreateShell() - { - splash = Container.Resolve(); - - splash.Show(); - - return splash; - } - - protected override void RegisterTypes(IContainerRegistry containerRegistry) - { - containerRegistry.RegisterInstance(Container); - var vfs = new VirtualFileSystem(); - var fs = new FileSystem(vfs); - var userSettings = new UserSettings(fs, new DummyStatusBar()); - var currentCoreSettings = new CurrentCoreSettings(userSettings); - modulesManager = new ModulesManager(currentCoreSettings); - var mainThread = new MainThread(); - GlobalApplication.InitializeApplication(mainThread, GlobalApplication.AppBackend.WPF); - containerRegistry.RegisterInstance(mainThread); - containerRegistry.RegisterInstance(modulesManager); - } - - private class DummyStatusBar : IStatusBar - { - public void PublishNotification(INotification notification) { } - } - - protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry) - { - base.RegisterRequiredTypes(containerRegistry); - containerRegistry.RegisterSingleton(); - - containerRegistry.RegisterSingleton(); - } - - protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) - { - base.ConfigureModuleCatalog(moduleCatalog); - moduleCatalog.AddModule(typeof(MainModule)); - moduleCatalog.AddModule(typeof(CommonWpfModule)); - moduleCatalog.AddModule(typeof(MainModuleWPF)); - - List allAssemblies = GetPluginDlls() - .Select(AssemblyLoadContext.Default.LoadFromAssemblyPath) - .ToList(); - - allAssemblies.Sort(Comparer.Create((a, b) => - { - var aRequires = a.GetCustomAttributes(typeof(ModuleRequiresCoreAttribute), false); - var bRequires = b.GetCustomAttributes(typeof(ModuleRequiresCoreAttribute), false); - return bRequires.Length.CompareTo(aRequires.Length); - })); - - List loadAssemblies = allAssemblies - .Where(modulesManager!.ShouldLoad) - .ToList(); - - var conflicts = DetectConflicts(loadAssemblies); - - foreach (var conflict in conflicts) - { - MessageBox.Show( - $"Module {conflict.ConflictingAssembly.GetName().Name} conflicts with module {conflict.FirstAssembly.GetName().Name}. They provide same functionality. This is not allowed. Disablig {conflict.ConflictingAssembly.GetName().Name}"); - modulesManager!.AddConflicted(conflict.ConflictingAssembly, conflict.FirstAssembly); - allAssemblies.Remove(conflict.ConflictingAssembly); - } - - AddMoulesFromLoadedAssemblies(moduleCatalog, allAssemblies); - } - - private IEnumerable GetPluginDlls() - { - string? path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - if (path == null) - return ArraySegment.Empty; - return Directory.GetFiles(path, "WDE*.dll").Where(path => !path.Contains("Test.dll") && !path.Contains("WDE.Common.WPF")); - } - - private IList DetectConflicts(List allAssemblies) - { - Dictionary> providedInterfaces = new(); - - List conflictingAssemblies = new(); - - foreach (var assembly in allAssemblies) - { - var implementedInterfaces = AllClasses.FromAssemblies(assembly) - .Where(t => t.IsDefined(typeof(AutoRegisterAttribute), true)) - .SelectMany(t => t.GetInterfaces()) - .Where(t => t.IsDefined(typeof(UniqueProviderAttribute))) - .ToList(); - - if (!implementedInterfaces.Any()) - continue; - - foreach (var otherAssembly in providedInterfaces) - { - var intersection = otherAssembly.Value.Intersect(implementedInterfaces).ToList(); - - if (intersection.Count > 0) - conflictingAssemblies.Add(new Conflict(assembly, otherAssembly.Key)); - } - - providedInterfaces.Add(assembly, implementedInterfaces.ToList()); - } - - return conflictingAssemblies; - } - - private void AddMoulesFromLoadedAssemblies(IModuleCatalog moduleCatalog, List allAssemblies) - { - var modules = AllClasses.FromAssemblies(allAssemblies).Where(t => t.GetInterfaces().Contains(typeof(IModule))).ToList(); - - foreach (var module in modules) - { - bool load = modulesManager!.AddModule(module.Assembly); - if (load) - moduleCatalog.AddModule(new ModuleInfo - { - ModuleName = module.Name, - ModuleType = module.AssemblyQualifiedName, - Ref = "file://" + module.Assembly.Location - }); - } - } - - protected override IModuleCatalog CreateModuleCatalog() - { - return new ConfigurationModuleCatalog(); - } - - protected override void OnInitialized() - { - var loadedModules = Container.Resolve>(); - foreach (var module in loadedModules) - module.FinalizeRegistration((IContainerRegistry)Container); - - IMessageBoxService messageBoxService = Container.Resolve(); - IClipboardService clipboardService = Container.Resolve(); - ViewBind.AppViewLocator = Container.Resolve(); - // have no idea if it makes sense, but works - MainWindow? mainWindow = Container.Resolve(); - mainWindow.DataContext = Container.Resolve(); - - IEventAggregator? eventAggregator = Container.Resolve(); - eventAggregator.GetEvent().Publish(); - - mainWindow.ContentRendered += MainWindowOnContentRendered; - - #if DEBUG - mainWindow.ShowDialog(); - #else - try - { - mainWindow.ShowDialog(); - } - catch (Exception e) - { - var deploymentVersion = File.Exists("app.ini") ? File.ReadAllText("app.ini") : "unknown app data"; - Console.WriteLine(e.ToString()); - var logPath = Path.GetTempFileName() + ".WDE.log.txt"; - File.WriteAllText(logPath, deploymentVersion + "\n\n" + e.ToString()); - - var choice = messageBoxService.ShowDialog(new MessageBoxFactory().SetIcon(MessageBoxIcon.Error) - .SetTitle("Fatal error") - .SetMainInstruction("Sorry, fatal error has occured and the program had to stop") - .SetContent("You are welcome to report the bug at github. Reason: " + e.Message) - .SetFooter("Log file saved at: " + logPath) - .WithButton("Copy log path to clipboard", 2) - .WithButton("Open log file", 1) - .WithButton("Close", 0) - .Build()).Result; // in WPF in fact this is sync, so this is legal - if (choice == 2) - clipboardService.SetText(logPath); - else if (choice == 1) - Process.Start("explorer", logPath); - } - #endif - - Current.Shutdown(); - } - - private void MainWindowOnContentRendered(object? sender, EventArgs e) - { - splash!.Close(); - (sender! as MainWindow)!.ContentRendered -= MainWindowOnContentRendered; - } - - private class Conflict - { - public readonly Assembly ConflictingAssembly; - public readonly Assembly FirstAssembly; - - public Conflict(Assembly conflictingAssembly, Assembly firstAssembly) - { - ConflictingAssembly = conflictingAssembly; - FirstAssembly = firstAssembly; - } - } - } - - public class MainThread : IMainThread - { - public void Dispatch(Action action) - { - Application.Current.Dispatcher.Invoke(action); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/AssemblyInfo.cs b/WoWDatabaseEditorCore.WPF/AssemblyInfo.cs deleted file mode 100644 index 42e001a03..000000000 --- a/WoWDatabaseEditorCore.WPF/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Windows; - -[assembly: ThemeInfo(ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/WoWDatabaseEditorCore.WPF/CoreVersion/Views/CoreVersionConfigView.xaml b/WoWDatabaseEditorCore.WPF/CoreVersion/Views/CoreVersionConfigView.xaml deleted file mode 100644 index f015e3f8b..000000000 --- a/WoWDatabaseEditorCore.WPF/CoreVersion/Views/CoreVersionConfigView.xaml +++ /dev/null @@ -1,23 +0,0 @@ - - - Core version - - - - - - - - - diff --git a/WoWDatabaseEditorCore.WPF/CoreVersion/Views/CoreVersionConfigView.xaml.cs b/WoWDatabaseEditorCore.WPF/CoreVersion/Views/CoreVersionConfigView.xaml.cs deleted file mode 100644 index d7c71d4c1..000000000 --- a/WoWDatabaseEditorCore.WPF/CoreVersion/Views/CoreVersionConfigView.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace WoWDatabaseEditorCore.WPF.CoreVersion.Views -{ - public partial class CoreVersionConfigView : UserControl - { - public CoreVersionConfigView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Extensions/FocusBehavior.cs b/WoWDatabaseEditorCore.WPF/Extensions/FocusBehavior.cs deleted file mode 100644 index f778d042f..000000000 --- a/WoWDatabaseEditorCore.WPF/Extensions/FocusBehavior.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace WoWDatabaseEditorCore.WPF.Extensions -{ - public static class FocusBehavior - { - public static readonly DependencyProperty FocusFirstProperty = DependencyProperty.RegisterAttached("FocusFirst", - typeof(bool), - typeof(FocusBehavior), - new PropertyMetadata(false, OnFocusFirstPropertyChanged)); - - public static bool GetFocusFirst(Control control) - { - return (bool) control.GetValue(FocusFirstProperty); - } - - public static void SetFocusFirst(Control control, bool value) - { - control.SetValue(FocusFirstProperty, value); - } - - private static void OnFocusFirstPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) - { - Control? control = obj as Control; - if (control == null || !(args.NewValue is bool)) - return; - - if ((bool) args.NewValue) - control.Loaded += ControlOnLoaded; - } - - private static void ControlOnLoaded(object sender, RoutedEventArgs e) - { - (sender as Control)!.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); - (sender as Control)!.Loaded -= ControlOnLoaded; - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Extensions/GlobalMenuHotKeys.cs b/WoWDatabaseEditorCore.WPF/Extensions/GlobalMenuHotKeys.cs deleted file mode 100644 index 4d12545aa..000000000 --- a/WoWDatabaseEditorCore.WPF/Extensions/GlobalMenuHotKeys.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; -using WDE.Common.Menu; - -namespace WoWDatabaseEditorCore.WPF.Extensions -{ - public static class GlobalMenuHotKeys - { - - public static readonly DependencyProperty MenuItemsGesturesProperty = DependencyProperty.RegisterAttached("MenuItemsGestures", - typeof(IList), - typeof(GlobalMenuHotKeys), - new PropertyMetadata(null, OnHotKeyPropertyChanged)); - - private static void OnHotKeyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var window = d as Window; - if (window == null) - return; - - var menus = GetMenuItemsGestures(window); - - if (menus == null) - return; - - foreach (var m in menus) - { - foreach (var subItem in m.SubItems) - { - if (subItem is not IMenuCommandItem cmd) - continue; - - if (!cmd.Shortcut.HasValue || !Enum.TryParse(cmd.Shortcut.Value.Key, out Key key)) - continue; - - var keyGesture = new KeyGesture(key, cmd.Shortcut.Value.Control ? ModifierKeys.Control : ModifierKeys.None); - window.InputBindings.Add(new InputBinding(cmd.ItemCommand, keyGesture)); - } - } - } - - public static IList? GetMenuItemsGestures(Control control) - { - return (IList?) control.GetValue(MenuItemsGesturesProperty); - } - - public static void SetMenuItemsGestures(Control control, IList? value) - { - control.SetValue(MenuItemsGesturesProperty, value); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Icon.ico b/WoWDatabaseEditorCore.WPF/Icon.ico deleted file mode 100644 index 1976b55be..000000000 Binary files a/WoWDatabaseEditorCore.WPF/Icon.ico and /dev/null differ diff --git a/WoWDatabaseEditorCore.WPF/MainModuleWPF.cs b/WoWDatabaseEditorCore.WPF/MainModuleWPF.cs deleted file mode 100644 index ef4fa2550..000000000 --- a/WoWDatabaseEditorCore.WPF/MainModuleWPF.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Prism.Ioc; -using WoWDatabaseEditorCore.Services.ItemFromListSelectorService; -using WoWDatabaseEditorCore.WPF.Services.ItemFromListSelectorService; -using WDE.Common.Database; -using WDE.Common.Windows; -using WDE.Module; -using WoWDatabaseEditorCore.Services.CreatureEntrySelectorService; -using WoWDatabaseEditorCore.WPF.Services.CreatureEntrySelectorService; - -namespace WoWDatabaseEditorCore.WPF -{ - public class MainModuleWPF : ModuleBase - { - public override void OnInitialized(IContainerProvider containerProvider) - { - base.OnInitialized(containerProvider); - var viewLocator = containerProvider.Resolve(); - - viewLocator.Bind, GenericSelectorDialogView>(); - viewLocator.Bind, GenericSelectorDialogView>(); - viewLocator.Bind, GenericSelectorDialogView>(); - viewLocator.Bind, GenericSelectorDialogView>(); - - viewLocator.Bind(); - viewLocator.Bind(); - viewLocator.Bind(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Managers/MessageBoxService.cs b/WoWDatabaseEditorCore.WPF/Managers/MessageBoxService.cs deleted file mode 100644 index ff5e611a3..000000000 --- a/WoWDatabaseEditorCore.WPF/Managers/MessageBoxService.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Ookii.Dialogs.Wpf; -using WDE.Common.Services.MessageBox; -using WDE.Module.Attributes; - -namespace WoWDatabaseEditorCore.WPF.Managers -{ - [SingleInstance] - [AutoRegister] - public class MessageBoxService : IMessageBoxService - { - public Task ShowDialog(IMessageBox messageBox) - { - using (TaskDialog dialog = new TaskDialog()) - { - dialog.WindowTitle = messageBox.Title; - dialog.MainInstruction = messageBox.MainInstruction; - dialog.Content = messageBox.Content; - dialog.ExpandedInformation = messageBox.ExpandedInformation; - dialog.Footer = messageBox.Footer; - dialog.FooterIcon = ToDialogIcon(messageBox.FooterIcon); - dialog.MainIcon = ToDialogIcon(messageBox.Icon); - - Dictionary buttonToValue = new(); - foreach (var buttonDefinition in messageBox.Buttons) - { - TaskDialogButton button = GenerateButton(buttonDefinition.Name); - buttonToValue[button] = buttonDefinition.ReturnValue; - dialog.Buttons.Add(button); - } - - TaskDialogButton returned = dialog.ShowDialog(); - - return Task.FromResult(buttonToValue[returned]); - } - } - - private TaskDialogButton GenerateButton(string name) - { - switch (name) - { - case "Ok": - return new TaskDialogButton(ButtonType.Ok); - case "Yes": - return new TaskDialogButton(ButtonType.Yes); - case "No": - return new TaskDialogButton(ButtonType.No); - case "Cancel": - return new TaskDialogButton(ButtonType.Cancel); - default: - return new TaskDialogButton(name); - } - } - - private TaskDialogIcon ToDialogIcon(MessageBoxIcon icon) - { - switch (icon) - { - case MessageBoxIcon.NoIcon: - return TaskDialogIcon.Custom; - case MessageBoxIcon.Warning: - return TaskDialogIcon.Warning; - case MessageBoxIcon.Error: - return TaskDialogIcon.Error; - case MessageBoxIcon.Information: - return TaskDialogIcon.Information; - case MessageBoxIcon.Shield: - return TaskDialogIcon.Shield; - default: - throw new ArgumentOutOfRangeException(nameof(icon), icon, null); - } - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Managers/ScopedContainer.cs b/WoWDatabaseEditorCore.WPF/Managers/ScopedContainer.cs deleted file mode 100644 index 6b0141ab5..000000000 --- a/WoWDatabaseEditorCore.WPF/Managers/ScopedContainer.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using Prism.Ioc; -using Prism.Unity.Ioc; -using Unity; -using WDE.Module; - -namespace WoWDatabaseEditorCore.WPF.Managers -{ - public class ScopedContainer : IScopedContainer - { - private IUnityContainer unity; - private IContainerExtension inner; - - public ScopedContainer(IContainerExtension containerExtension, IUnityContainer impl) - { - inner = containerExtension; - unity = impl; - } - - public object Resolve(Type type) => inner.Resolve(type); - - public object Resolve(Type type, params (Type Type, object Instance)[] parameters) => inner.Resolve(type, parameters); - - public object Resolve(Type type, string name) => inner.Resolve(type, name); - - public object Resolve(Type type, string name, params (Type Type, object Instance)[] parameters) => inner.Resolve(type, name, parameters); - - public IContainerRegistry RegisterInstance(Type type, object instance) => inner.RegisterInstance(type, instance); - - public IContainerRegistry RegisterInstance(Type type, object instance, string name) => inner.RegisterInstance(type, instance, name); - - public IContainerRegistry RegisterSingleton(Type @from, Type to) => inner.RegisterSingleton(@from, to); - - public IContainerRegistry RegisterSingleton(Type @from, Type to, string name) => inner.RegisterSingleton(@from, to, name); - - public IContainerRegistry Register(Type @from, Type to) => inner.Register(@from, to); - - public IContainerRegistry Register(Type @from, Type to, string name) => inner.Register(@from, to, name); - - public bool IsRegistered(Type type) => inner.IsRegistered(type); - - public bool IsRegistered(Type type, string name) => inner.IsRegistered(type, name); - - public void FinalizeExtension() => inner.FinalizeExtension(); - - public IScopedContainer CreateScope() - { - var childContainer = unity.CreateChildContainer(); - var extensions = new UnityContainerExtension(childContainer); - var scope = new ScopedContainer(extensions, childContainer); - extensions.RegisterInstance(scope); - extensions.RegisterInstance(scope); - extensions.RegisterInstance(scope); - extensions.RegisterInstance(scope); - return scope; - } - - public IUnityContainer Instance => unity; - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Managers/WindowManager.cs b/WoWDatabaseEditorCore.WPF/Managers/WindowManager.cs deleted file mode 100644 index bd246714a..000000000 --- a/WoWDatabaseEditorCore.WPF/Managers/WindowManager.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Threading.Tasks; -using Ookii.Dialogs.Wpf; -using WDE.Common.Managers; -using WDE.Module.Attributes; -using WoWDatabaseEditorCore.WPF.Views; - -namespace WoWDatabaseEditorCore.WPF.Managers -{ - [SingleInstance] - [AutoRegister] - public class WindowManager : IWindowManager - { - private readonly Lazy mainWindow; - - public WindowManager(Lazy mainWindow) - { - this.mainWindow = mainWindow; - } - - public Task ShowDialog(IDialog viewModel) - { - DialogWindow view = new DialogWindow(); - view.Height = viewModel.DesiredHeight; - view.Width = viewModel.DesiredWidth; - view.Owner = mainWindow.Value; - view.DataContext = viewModel; - return Task.FromResult(view.ShowDialog() ?? false); - } - - public Task ShowFolderPickerDialog(string defaultDirectory) - { - VistaFolderBrowserDialog dialog = new(); - dialog.SelectedPath = defaultDirectory; - bool? result = dialog.ShowDialog(); - - if (result.HasValue && result.Value) - return Task.FromResult(dialog.SelectedPath); - return Task.FromResult(null); - } - - public Task ShowOpenFileDialog(string filter, string? defaultDirectory = null) - { - VistaOpenFileDialog dialog = new(); - if (!string.IsNullOrEmpty(defaultDirectory)) - dialog.InitialDirectory = defaultDirectory; - dialog.Multiselect = false; - dialog.Filter = filter; - - bool? result = dialog.ShowDialog(); - if (result.HasValue && result.Value) - return Task.FromResult(dialog.FileName); - return Task.FromResult(null); - } - - public Task ShowSaveFileDialog(string filter, string? defaultDirectory = null) - { - throw new NotImplementedException(); - } - - public void OpenUrl(string url) - { - var psi = new System.Diagnostics.ProcessStartInfo - { - UseShellExecute = true, - FileName = url - }; - System.Diagnostics.Process.Start(psi); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/ModulesManagement/Configuration/Views/ModulesConfigView.xaml b/WoWDatabaseEditorCore.WPF/ModulesManagement/Configuration/Views/ModulesConfigView.xaml deleted file mode 100644 index 5f3a72b43..000000000 --- a/WoWDatabaseEditorCore.WPF/ModulesManagement/Configuration/Views/ModulesConfigView.xaml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/ModulesManagement/Configuration/Views/ModulesConfigView.xaml.cs b/WoWDatabaseEditorCore.WPF/ModulesManagement/Configuration/Views/ModulesConfigView.xaml.cs deleted file mode 100644 index 9811971c7..000000000 --- a/WoWDatabaseEditorCore.WPF/ModulesManagement/Configuration/Views/ModulesConfigView.xaml.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Controls; - -namespace WoWDatabaseEditorCore.WPF.ModulesManagement.Configuration.Views -{ - /// - /// Interaction logic for ModulesConfigView.xaml - /// - public partial class ModulesConfigView : UserControl - { - public ModulesConfigView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Services/ClipboardService.cs b/WoWDatabaseEditorCore.WPF/Services/ClipboardService.cs deleted file mode 100644 index 18902a047..000000000 --- a/WoWDatabaseEditorCore.WPF/Services/ClipboardService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Windows; -using System.Threading.Tasks; -using WDE.Common.Services; -using WDE.Module.Attributes; - -namespace WoWDatabaseEditorCore.WPF.Services -{ - [AutoRegister] - [SingleInstance] - public class ClipboardService : IClipboardService - { - public Task GetText() - { - return Task.FromResult(Clipboard.GetText()); - } - - public void SetText(string text) - { - Clipboard.SetText(text); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Services/ConfigurationService/Views/ConfigurationPanelView.xaml b/WoWDatabaseEditorCore.WPF/Services/ConfigurationService/Views/ConfigurationPanelView.xaml deleted file mode 100644 index bfd64e7e5..000000000 --- a/WoWDatabaseEditorCore.WPF/Services/ConfigurationService/Views/ConfigurationPanelView.xaml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/AboutView.xaml.cs b/WoWDatabaseEditorCore.WPF/Views/AboutView.xaml.cs deleted file mode 100644 index 35f60728e..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/AboutView.xaml.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Controls; - -namespace WoWDatabaseEditorCore.WPF.Views -{ - /// - /// Interaction logic for AboutView - /// - public partial class AboutView : UserControl - { - public AboutView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/DialogWindow.xaml b/WoWDatabaseEditorCore.WPF/Views/DialogWindow.xaml deleted file mode 100644 index 277bb5775..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/DialogWindow.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/WoWDatabaseEditorCore.WPF/Views/DialogWindow.xaml.cs b/WoWDatabaseEditorCore.WPF/Views/DialogWindow.xaml.cs deleted file mode 100644 index a405515dd..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/DialogWindow.xaml.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel; -using System.Windows; -using System.Windows.Input; -using MahApps.Metro.Controls; -using WDE.Common.Managers; - -namespace WoWDatabaseEditorCore.WPF.Views -{ - public partial class DialogWindow : MetroWindow - { - public DialogWindow() - { - InitializeComponent(); - Loaded += OnLoaded; - Unloaded += OnUnloaded; - } - - private void OnUnloaded(object sender, RoutedEventArgs e) - { - if (DataContext is IDialog dialogWindow) - { - dialogWindow.CloseCancel -= DialogWindowOnCloseCancel; - dialogWindow.CloseOk -= DialogWindowOnCloseOk; - } - } - - private void OnLoaded(object sender, RoutedEventArgs e) - { - if (DataContext is IDialog dialogWindow) - { - dialogWindow.CloseCancel += DialogWindowOnCloseCancel; - dialogWindow.CloseOk += DialogWindowOnCloseOk; - } - } - - private void DialogWindowOnCloseOk() - { - DialogResult = true; - Close(); - } - - private void DialogWindowOnCloseCancel() - { - DialogResult = false; - Close(); - } - - protected override void OnClosing(CancelEventArgs e) - { - base.OnClosing(e); - Keyboard.ClearFocus(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/Helpers/ActiveDocumentConverter.cs b/WoWDatabaseEditorCore.WPF/Views/Helpers/ActiveDocumentConverter.cs deleted file mode 100644 index 262cd37fd..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/Helpers/ActiveDocumentConverter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using WDE.Common.Managers; - -namespace WoWDatabaseEditorCore.WPF.Views.Helpers -{ - public class ActiveDocumentConverter : IValueConverter - { - public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is IDocument) - return value; - - return null; - } - - public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is IDocument) - return value; - - return null; - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/Helpers/BoolToResizeModeConverter.cs b/WoWDatabaseEditorCore.WPF/Views/Helpers/BoolToResizeModeConverter.cs deleted file mode 100644 index ca5011c19..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/Helpers/BoolToResizeModeConverter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace WoWDatabaseEditorCore.WPF.Views.Helpers -{ - public class BoolToResizeModeConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is bool boolValue) - { - return boolValue ? ResizeMode.CanResize : ResizeMode.NoResize; - } - - return ResizeMode.CanResize; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/Helpers/DocumentOrToolToTitleConverter.cs b/WoWDatabaseEditorCore.WPF/Views/Helpers/DocumentOrToolToTitleConverter.cs deleted file mode 100644 index 757ddcda4..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/Helpers/DocumentOrToolToTitleConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace WoWDatabaseEditorCore.WPF.Views.Helpers -{ - public class DocumentOrToolToTitleConverter : IMultiValueConverter - { - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - if (values.Length != 3) - return ""; - - if (!(values[0] is string title)) - return ""; - - bool? isModified = null; - bool? isLoading = null; - - if (values[1] is bool modified) - isModified = modified; - - if (values[2] is bool loading) - isLoading = loading; - - if (isLoading ?? false) - return $"{title} (loading)"; - - if (isModified ?? false) - return $"{title}*"; - - return title; - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/Helpers/DynamicMenuItemStyleSelector.cs b/WoWDatabaseEditorCore.WPF/Views/Helpers/DynamicMenuItemStyleSelector.cs deleted file mode 100644 index bbb28e6b3..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/Helpers/DynamicMenuItemStyleSelector.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using WDE.Common.Menu; - -namespace WoWDatabaseEditorCore.WPF.Views.Helpers -{ - public class DynamicMenuItemStyleSelector: StyleSelector - { - public Style? MainMenuItemStyle { get; set; } - public Style? CategoryItemStyle { get; set; } - public Style? DocumentItemStyle { get; set; } - public Style? CommandItemStyle { get; set; } - public Style? SeparatorItemStyle { get; set; } - - public override Style SelectStyle(object item, DependencyObject container) - { - if (item is IMainMenuItem) - return MainMenuItemStyle!; - if (item is IMenuCategoryItem) - return CategoryItemStyle!; - if (item is IMenuDocumentItem) - return DocumentItemStyle!; - if (item is IMenuCommandItem) - return CommandItemStyle!; - if (item is IMenuSeparator) - return SeparatorItemStyle!; - - return base.SelectStyle(item, container); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/Helpers/PanesStyleSelector.cs b/WoWDatabaseEditorCore.WPF/Views/Helpers/PanesStyleSelector.cs deleted file mode 100644 index f08759e57..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/Helpers/PanesStyleSelector.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using WDE.Common.Managers; -using WDE.Common.Windows; - -namespace WoWDatabaseEditorCore.WPF.Views.Helpers -{ - class PanesStyleSelector : StyleSelector - { - public Style? ToolStyle { get; set; } - - public Style? DocumentStyle { get; set; } - - public override Style SelectStyle(object item, DependencyObject container) - { - if (item is ITool) - return ToolStyle!; - - if (item is IDocument) - return DocumentStyle!; - - return base.SelectStyle(item, container); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/MainWindow.xaml b/WoWDatabaseEditorCore.WPF/Views/MainWindow.xaml deleted file mode 100644 index 78ef296bd..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/MainWindow.xaml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/StatusBarView.xaml.cs b/WoWDatabaseEditorCore.WPF/Views/StatusBarView.xaml.cs deleted file mode 100644 index 412523394..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/StatusBarView.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace WoWDatabaseEditorCore.WPF.Views -{ - public partial class StatusBarView : UserControl - { - public StatusBarView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/Views/TasksPanel.xaml b/WoWDatabaseEditorCore.WPF/Views/TasksPanel.xaml deleted file mode 100644 index a8bed6996..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/TasksPanel.xaml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/WoWDatabaseEditorCore.WPF/Views/TasksPanel.xaml.cs b/WoWDatabaseEditorCore.WPF/Views/TasksPanel.xaml.cs deleted file mode 100644 index 7e79104f3..000000000 --- a/WoWDatabaseEditorCore.WPF/Views/TasksPanel.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace WoWDatabaseEditorCore.WPF.Views -{ - public partial class TasksPanel : UserControl - { - public TasksPanel() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/WoWDatabaseEditorCore.WPF/WoWDatabaseEditorCore.WPF.csproj b/WoWDatabaseEditorCore.WPF/WoWDatabaseEditorCore.WPF.csproj deleted file mode 100644 index bbfea16d8..000000000 --- a/WoWDatabaseEditorCore.WPF/WoWDatabaseEditorCore.WPF.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - WinExe - net5.0-windows7.0 - true - enable - nullable - WoWDatabaseEditorCore.WPF - WoWDatabaseEditorCore.WPF - false - Icon.ico - Debug;Release - AnyCPU - - - - ..\bin\$(Configuration)\ - - - - - - - - - - - app.manifest - - - - - - - - - - - 2.0.5 - - - 2.3.2 - - - 3.14.0 - - - 2.4.3 - - - 1.3.1 - - - - 3.1.0 - - - 7.2.0.1422 - - - 7.2.0.1422 - - - 2.5.3 - - - - - - 5.11.6 - - - 5.11.1 - - - 1.1.31 - - - 4.50.1 - - - 4.50.1 - - - diff --git a/WoWDatabaseEditorCore.WPF/app.manifest b/WoWDatabaseEditorCore.WPF/app.manifest deleted file mode 100644 index fb21a8b05..000000000 --- a/WoWDatabaseEditorCore.WPF/app.manifest +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/appveyor.yml b/appveyor.yml index 33c7d6e40..d3028a78e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,11 +14,11 @@ build_script: - cmd: >- Rem Building WDE - dotnet publish -c Release --self-contained false -f net5.0 -o bin/wowdatabaseeditor-avalonia-win/ LoaderAvalonia/LoaderAvalonia.csproj -r win7-x64 + dotnet publish -c Release --self-contained false -f net6.0 -o bin/wowdatabaseeditor-avalonia-win/ LoaderAvalonia/LoaderAvalonia.csproj -r win7-x64 - dotnet publish -c Release --self-contained false -f net5.0 -o bin/wowdatabaseeditor-avalonia-mac/ LoaderAvalonia/LoaderAvalonia.csproj -r osx-x64 + dotnet publish -c Release --self-contained false -f net6.0 -o bin/wowdatabaseeditor-avalonia-mac/ LoaderAvalonia/LoaderAvalonia.csproj -r osx-x64 - dotnet publish -c Release --self-contained false -f net5.0 -o bin/wowdatabaseeditor-avalonia-linux/ LoaderAvalonia/LoaderAvalonia.csproj -r linux-x64 + dotnet publish -c Release --self-contained false -f net6.0 -o bin/wowdatabaseeditor-avalonia-linux/ LoaderAvalonia/LoaderAvalonia.csproj -r linux-x64 rename bin\wowdatabaseeditor-avalonia-mac\Updater _Updater