diff --git a/SimpleStateMachineNodeEditor/App.xaml b/SimpleStateMachineNodeEditor/App.xaml index 0301c99..7337290 100644 --- a/SimpleStateMachineNodeEditor/App.xaml +++ b/SimpleStateMachineNodeEditor/App.xaml @@ -6,9 +6,11 @@ - + + + @@ -46,12 +48,11 @@ - + - + - - + diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/Command.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/Command.cs index efed073..775c7a1 100644 --- a/SimpleStateMachineNodeEditor/Helpers/Commands/Command.cs +++ b/SimpleStateMachineNodeEditor/Helpers/Commands/Command.cs @@ -4,37 +4,15 @@ namespace SimpleStateMachineNodeEditor.Helpers.Commands { - public class Command : CommandWithUndoRedo, ICommand, ICloneable + public class Command : ICommandWithUndoRedo, ICommand, ICloneable { - private readonly Func _execute; - - /// - /// Функция отмены команды - /// private readonly Func _unExecute; - public Action OnExecute { get; set; } - - /// - /// Параметр, который был передан в команду при выполнении - /// public TParameter Parameters { get; set; } - - /// - /// Результат выполнения команды - /// Например здесь может храниться список объектов, которые были изменены public TResult Result { get; set; } - /// - - - /// - /// Клонирование текущей команды, для записи в стек выполненных или отмененных команд - /// - /// public object Clone() - { - + { return new Command(_execute, _unExecute, OnExecute) { Parameters = this.Parameters, @@ -42,91 +20,56 @@ public object Clone() }; } - /// - /// Требуется интерфейсом ICloneable, не используется - /// + public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { CommandManager.RequerySuggested -= value; } } - /// - /// Требуется интерфейсом ICloneable, не используется - /// - /// - /// Всегда возвращает true public bool CanExecute(object parameter) { return true; } - /// - /// Выполнение команды - /// - /// Параметр команды public void Execute(object parameter) { - //Запоминаем параметр ( чтобы можно было егоже передать в отмену) Parameters = parameter.Cast(); - //Выполняем команду и запоминаем результат ( чтобы можно было выполнить отмену именно для этого результата) Result = this._execute(Parameters, Result).Cast(); - //Добавляем копию команды в стек команд, которые можно отменить - CommandWithUndoRedo.AddInUndo(this.Clone() as CommandWithUndoRedo); + ICommandWithUndoRedo.AddInUndo(this.Clone() as ICommandWithUndoRedo); - //Очищаем список отмененнных команд ( началась новая ветка изменений) - CommandWithUndoRedo.StackRedo.Clear(); + ICommandWithUndoRedo.StackRedo.Clear(); - //Очищаем результат ( чтобы не передавать его при повторном выполнении) Result = default(TResult); - //Очищаем параметр ( чтобы не передавать его при повторном выполнении) Parameters = default(TParameter); OnExecute?.Invoke(); } - /// - /// Отмена команды - /// public void UnExecute() { - //Выполняем отмену команду this._unExecute(Parameters, Result); - //Добавляем копию команды в стек команд, которые можно выполнить повторно - CommandWithUndoRedo.AddInRedo(this.Clone() as CommandWithUndoRedo); + ICommandWithUndoRedo.AddInRedo(this.Clone() as ICommandWithUndoRedo); } - /// - /// Повторное выполнения команды - /// - public void Execute() + public void ExecuteWithSubscribe() { - //Выполянем команду this.Result = this._execute(this.Parameters, this.Result); - //Добавляем копию команды в стек команд, которые можно отменить - CommandWithUndoRedo.AddInUndo(this.Clone() as CommandWithUndoRedo); + ICommandWithUndoRedo.AddInUndo(this.Clone() as ICommandWithUndoRedo); } - /// - /// Создать отменяемую команду - /// - /// Объкт, которому принадлежит команда - /// Функция, которая будет вызвана при выполнении команды - /// Функция, которая будет вызвана при отмене команды - public Command(Func execute, Func unExecute, Action onExecute = null) + public Command(Func ExecuteWithSubscribe, Func unExecute, Action onExecute = null) { - _execute = execute; + _execute = ExecuteWithSubscribe; _unExecute = unExecute; - OnExecute += onExecute; - - + OnExecute += onExecute; } } } diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/CommandWithUndoRedo.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/CommandWithUndoRedo.cs deleted file mode 100644 index 571740f..0000000 --- a/SimpleStateMachineNodeEditor/Helpers/Commands/CommandWithUndoRedo.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Generic; - - -namespace SimpleStateMachineNodeEditor.Helpers.Commands -{ - public interface CommandWithUndoRedo - { - public static Stack StackRedo { get; set; } = new Stack(); - - public static Stack StackUndo { get; set; } = new Stack(); - - public static void Redo() - { - if (StackRedo.Count > 0) - { - CommandWithUndoRedo last = StackRedo.Pop(); - last.Execute(); - } - } - - public static void Undo() - { - if (StackUndo.Count > 0) - { - CommandWithUndoRedo last = StackUndo.Pop(); - last.UnExecute(); - } - } - - public static CommandWithUndoRedo AddInRedo(CommandWithUndoRedo command) - { - StackRedo.Push(command); - - return command; - } - - public static CommandWithUndoRedo AddInUndo(CommandWithUndoRedo command) - { - StackUndo.Push(command); - - return command; - } - - public void Execute(); - public void UnExecute(); - - } -} diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/ICommandWithUndoRedo.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/ICommandWithUndoRedo.cs new file mode 100644 index 0000000..5b58098 --- /dev/null +++ b/SimpleStateMachineNodeEditor/Helpers/Commands/ICommandWithUndoRedo.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; + + +namespace SimpleStateMachineNodeEditor.Helpers.Commands +{ + public interface ICommandWithUndoRedo + { + public static Stack StackRedo { get; set; } = new Stack(); + + public static Stack StackUndo { get; set; } = new Stack(); + + public static void Redo() + { + if (StackRedo.Count > 0) + { + ICommandWithUndoRedo last = StackRedo.Pop(); + last.ExecuteWithSubscribe(); + } + } + + public static void Undo() + { + if (StackUndo.Count > 0) + { + ICommandWithUndoRedo last = StackUndo.Pop(); + last.UnExecute(); + } + } + + public static ICommandWithUndoRedo AddInRedo(ICommandWithUndoRedo command) + { + StackRedo.Push(command); + + return command; + } + + public static ICommandWithUndoRedo AddInUndo(ICommandWithUndoRedo command) + { + StackUndo.Push(command); + + return command; + } + + public void ExecuteWithSubscribe(); + public void UnExecute(); + + } +} diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/Interface1.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/Interface1.cs deleted file mode 100644 index 75baa2e..0000000 --- a/SimpleStateMachineNodeEditor/Helpers/Commands/Interface1.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace SimpleStateMachineNodeEditor.Helpers.Commands -{ - public interface Interface1 - { - /// - /// Стек отмененных команд, которые можно выполнить повторно - /// - public static Stack StackRedo { get; set; } = new Stack(); - - /// - /// Стек выполненных команд, которые можно отменить - /// - public static Stack StackUndo { get; set; } = new Stack(); - - /// - /// Функция для команды повторного выполнения - /// - public static void Redo() - { - if (CommandWithUndoRedo.StackRedo.Count > 0) - { - CommandWithUndoRedo last = CommandWithUndoRedo.StackRedo.Pop(); - last.Execute(); - } - } - - /// - /// Функция для команды отмены - /// - public static void Undo() - { - if (CommandWithUndoRedo.StackUndo.Count > 0) - { - CommandWithUndoRedo last = CommandWithUndoRedo.StackUndo.Pop(); - last.UnExecute(); - } - } - - public abstract void Execute(); - public abstract void UnExecute(); - - /// - /// Добавить команду в стек команд, которые можно выполнить повторно - /// - public void AddInRedo(Interface1 command) - { - StackRedo.Push(command); - } - - /// - /// Добавить команду в стек команд, которые можно отменить - /// - public void AddInUndo(Interface1 command) - { - StackUndo.Push(command); - } - } -} diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/ReactiveCommandWithUndoRedo.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/ReactiveCommandWithUndoRedo.cs deleted file mode 100644 index bc80cbb..0000000 --- a/SimpleStateMachineNodeEditor/Helpers/Commands/ReactiveCommandWithUndoRedo.cs +++ /dev/null @@ -1,43 +0,0 @@ -using ReactiveUI; -using System; -using System.Collections.Generic; -using System.Reactive.Concurrency; -using System.Text; -using System.Windows.Input; - -namespace SimpleStateMachineNodeEditor.Helpers.Commands -{ - public class ReactiveCommandWithUndoRedo : ReactiveCommand - { - //private readonly Func _unExecute; - //private readonly Func _unExecute2; - //public void UnExecute() - //{ - // _unExecute = _unExecute2; - // _unExecute2 = _unExecute; - // //Выполняем отмену команду - // this._unExecute(Parameters, Result); - - // //Добавляем копию команды в стек команд, которые можно выполнить повторно - // CommandWithUndoRedo.AddInRedo(this.Clone() as CommandWithUndoRedo); - //} - - ///// - ///// Повторное выполнения команды - ///// - //public void Execute() - //{ - // //Выполянем команду - // this.Result = this._execute(this.Parameters, this.Result); - - // //Добавляем копию команды в стек команд, которые можно отменить - // CommandWithUndoRedo.AddInUndo(this.Clone() as CommandWithUndoRedo); - //} - - protected internal ReactiveCommandWithUndoRedo(Func> execute, IObservable canExecute, IScheduler outputScheduler):base(execute, canExecute, outputScheduler) - { - - } - - } -} diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommand.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommand.cs deleted file mode 100644 index b0913b0..0000000 --- a/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommand.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Windows.Input; - -namespace SimpleStateMachineNodeEditor.Helpers.Commands -{ - public class SimpleCommand : ICommand - { - /// - /// Функция с параметром, которая будет вызвана при выполнении команды - /// - private Action _execute; - - public Action OnExecute { get; set; } - - /// - /// Требуется интерфейсом ICloneable, не используется - /// - public event EventHandler CanExecuteChanged - { - add { CommandManager.RequerySuggested += value; } - remove { CommandManager.RequerySuggested -= value; } - } - - /// - /// Требуется интерфейсом ICloneable, не используется - /// - /// - /// Всегда возвращает true - public bool CanExecute(object parameter) - { - return true; - } - - /// - /// Выполнение команды - /// - /// Параметр команды - public void Execute(object parameter = null) - { - this._execute(); - OnExecute?.Invoke(); - } - - /// - /// Создать команду - /// - /// Объкт, которому принадлежит команда - /// Функция, которая будет вызвана при выполнении команды - public SimpleCommand(Action execute, Action onExecute = null) - { - _execute = execute; - OnExecute += onExecute; - } - } -} diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommandWithParameter.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommandWithParameter.cs deleted file mode 100644 index e091707..0000000 --- a/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommandWithParameter.cs +++ /dev/null @@ -1,68 +0,0 @@ -using SimpleStateMachineNodeEditor.Helpers.Extensions; -using System; -using System.DirectoryServices; -using System.Windows.Input; - -namespace SimpleStateMachineNodeEditor.Helpers.Commands -{ - /// - /// Команда без Undo/Redo - /// - /// - public class SimpleCommandWithParameter : ICommand - { - /// - /// Функция с параметром, которая будет вызвана при выполнении команды - /// - private Action _execute; - - public Action OnExecute { get; set; } - - /// - /// Требуется интерфейсом ICloneable, не используется - /// - public event EventHandler CanExecuteChanged - { - add { CommandManager.RequerySuggested += value; } - remove { CommandManager.RequerySuggested -= value; } - } - - /// - /// Требуется интерфейсом ICloneable, не используется - /// - /// - /// Всегда возвращает true - public bool CanExecute(object parameter) - { - return true; - } - - /// - /// Выполнение команды - /// - /// Параметр команды - public void Execute(object parameter) - { - - this._execute(parameter.Cast()); - - OnExecute?.Invoke(); - } - - /// - /// Создать команду - /// - /// Объкт, которому принадлежит команда - /// Функция, которая будет вызвана при выполнении команды - public SimpleCommandWithParameter(Action execute, Action onExecute = null) - { - _execute = execute; - OnExecute += onExecute; - } - - public static SimpleCommandWithParameter Create(Action execute, Action onExecute = null) - { - return new SimpleCommandWithParameter(execute, onExecute); - } - } -} diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommandWithResult.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommandWithResult.cs deleted file mode 100644 index c00561d..0000000 --- a/SimpleStateMachineNodeEditor/Helpers/Commands/SimpleCommandWithResult.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Windows.Input; - - -namespace SimpleStateMachineNodeEditor.Helpers.Commands -{ - public class SimpleCommandWithResul : ICommand - { - /// - /// Функция с параметром, которая будет вызвана при выполнении команды - /// - private Func _execute; - - public Action OnExecute { get; set; } - - /// - /// Требуется интерфейсом ICloneable, не используется - /// - public event EventHandler CanExecuteChanged - { - add { CommandManager.RequerySuggested += value; } - remove { CommandManager.RequerySuggested -= value; } - } - - /// - /// Результат выполнения команды - /// - /// Например здесь может храниться список объектов, которые были изменены - public TResult Result { get; set; } - - /// - /// Требуется интерфейсом ICloneable, не используется - /// - /// - /// Всегда возвращает true - public bool CanExecute(object parameter) - { - return true; - } - - /// - /// Выполнение команды - /// - /// Параметр команды - public void Execute(object parameter = null) - { - //Result = this._execute(Parameters, Result) as TResult; - this._execute(); - OnExecute?.Invoke(); - } - - /// - /// Создать команду - /// - /// Объкт, которому принадлежит команда - /// Функция, которая будет вызвана при выполнении команды - public SimpleCommandWithResul(Func execute, Action onExecute = null) - { - _execute = execute; - OnExecute += onExecute; - } - } -} diff --git a/SimpleStateMachineNodeEditor/Helpers/Commands/ValidateObjectProperty.cs b/SimpleStateMachineNodeEditor/Helpers/Commands/ValidateObjectProperty.cs deleted file mode 100644 index 4d87f34..0000000 --- a/SimpleStateMachineNodeEditor/Helpers/Commands/ValidateObjectProperty.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace SimpleStateMachineNodeEditor.Helpers.Commands -{ - public class ValidateObjectProperty where TObject : class where TProperty : class - { - public ValidateObjectProperty(TObject obj, TProperty property) - { - Obj = obj; - Property = property; - } - /// - /// Объект, для которого будем валидировать значенин - /// - public TObject Obj { get; set; } - - /// - /// Новое значение, которое будем валидировать - /// - public TProperty Property { get; set; } - - } -} diff --git a/SimpleStateMachineNodeEditor/Helpers/Enums/DialogResult.cs b/SimpleStateMachineNodeEditor/Helpers/Enums/DialogResult.cs new file mode 100644 index 0000000..851e635 --- /dev/null +++ b/SimpleStateMachineNodeEditor/Helpers/Enums/DialogResult.cs @@ -0,0 +1,15 @@ +namespace SimpleStateMachineNodeEditor.Helpers.Enums +{ + public enum DialogResult + { + noCorrect = 0, + Yes, + No, + Ok, + Cancel, + None, + Abort, + Retry, + Ignore + } +} diff --git a/SimpleStateMachineNodeEditor/Helpers/Enums/DialogType.cs b/SimpleStateMachineNodeEditor/Helpers/Enums/DialogType.cs new file mode 100644 index 0000000..dc16988 --- /dev/null +++ b/SimpleStateMachineNodeEditor/Helpers/Enums/DialogType.cs @@ -0,0 +1,10 @@ +namespace SimpleStateMachineNodeEditor.Helpers.Enums +{ + public enum DialogType + { + noCorrect = 0, + MessageBox, + SaveFileDialog, + OpenFileDialog, + } +} diff --git a/SimpleStateMachineNodeEditor/Helpers/Enums/TypeMove.cs b/SimpleStateMachineNodeEditor/Helpers/Enums/TypeMove.cs new file mode 100644 index 0000000..313bbe3 --- /dev/null +++ b/SimpleStateMachineNodeEditor/Helpers/Enums/TypeMove.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SimpleStateMachineNodeEditor.Helpers.Enums +{ + public enum TypeMove + { + None = 0, + MoveAll, + MoveSelected, + } +} diff --git a/SimpleStateMachineNodeEditor/Helpers/Extensions/EnumExtension.cs b/SimpleStateMachineNodeEditor/Helpers/Extensions/EnumExtension.cs index b34279b..1d5792b 100644 --- a/SimpleStateMachineNodeEditor/Helpers/Extensions/EnumExtension.cs +++ b/SimpleStateMachineNodeEditor/Helpers/Extensions/EnumExtension.cs @@ -10,5 +10,7 @@ public static string Name(this Enum enumType) { return Enum.GetName(enumType.GetType(), enumType); } + + } } diff --git a/SimpleStateMachineNodeEditor/Helpers/Extensions/FileDialogResultExtension.cs b/SimpleStateMachineNodeEditor/Helpers/Extensions/FileDialogResultExtension.cs new file mode 100644 index 0000000..35f7b47 --- /dev/null +++ b/SimpleStateMachineNodeEditor/Helpers/Extensions/FileDialogResultExtension.cs @@ -0,0 +1,23 @@ +using System; + +namespace SimpleStateMachineNodeEditor.Helpers.Extensions +{ + public static class FileDialogResultExtension + { + public static Enums.DialogResult ToDialogResult(this System.Windows.Forms.DialogResult fileDialogResult) + { + return fileDialogResult switch + { + System.Windows.Forms.DialogResult.Yes => Helpers.Enums.DialogResult.None, + System.Windows.Forms.DialogResult.No => Helpers.Enums.DialogResult.No, + System.Windows.Forms.DialogResult.OK => Helpers.Enums.DialogResult.Ok, + System.Windows.Forms.DialogResult.Cancel => Helpers.Enums.DialogResult.Cancel, + System.Windows.Forms.DialogResult.None => Helpers.Enums.DialogResult.None, + System.Windows.Forms.DialogResult.Abort => Helpers.Enums.DialogResult.Abort, + System.Windows.Forms.DialogResult.Retry => Helpers.Enums.DialogResult.Retry, + System.Windows.Forms.DialogResult.Ignore => Helpers.Enums.DialogResult.Ignore, + _ => throw new NotImplementedException(), + }; + } + } +} diff --git a/SimpleStateMachineNodeEditor/Helpers/Extensions/MessageBoxResultExtension.cs b/SimpleStateMachineNodeEditor/Helpers/Extensions/MessageBoxResultExtension.cs new file mode 100644 index 0000000..9dd5c78 --- /dev/null +++ b/SimpleStateMachineNodeEditor/Helpers/Extensions/MessageBoxResultExtension.cs @@ -0,0 +1,21 @@ +using System; +using System.Windows; + +namespace SimpleStateMachineNodeEditor.Helpers.Extensions +{ + public static class MessageBoxResultExtension + { + public static Helpers.Enums.DialogResult ToDialogResult(this MessageBoxResult messageBoxResult) + { + return messageBoxResult switch + { + MessageBoxResult.Yes => Helpers.Enums.DialogResult.Yes, + MessageBoxResult.No => Helpers.Enums.DialogResult.No, + MessageBoxResult.OK => Helpers.Enums.DialogResult.Ok, + MessageBoxResult.Cancel => Helpers.Enums.DialogResult.Cancel, + MessageBoxResult.None => Helpers.Enums.DialogResult.None, + _ => throw new NotImplementedException() + }; + } + } +} diff --git a/SimpleStateMachineNodeEditor/Helpers/Extensions/PointExtensition.cs b/SimpleStateMachineNodeEditor/Helpers/Extensions/PointExtensition.cs new file mode 100644 index 0000000..069a08c --- /dev/null +++ b/SimpleStateMachineNodeEditor/Helpers/Extensions/PointExtensition.cs @@ -0,0 +1,333 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Text; +using System.Windows; + +namespace SimpleStateMachineNodeEditor.Helpers.Extensions +{ + public static class PointExtensition + { + //public static MyPoint ToMyPoint(this Point point) + //{ + // return MyPoint.CreateFromPoint(point); + //} + public static Point CreatePoint(Point point) + { + return new Point(point.X, point.Y); + } + public static Point CreatePoint(int value) + { + return new Point(value, value); + } + public static Point CreatePoint(double value) + { + return new Point(value, value); + } + public static Point CreatePoint(int x, int y) + { + return new Point(x, y); + } + public static Point CreatePoint(double x, double y) + { + return new Point(x, y); + } + public static Point CreatePoint(Size size) + { + return new Point(size.Width, size.Height); + } + + public static Point CreateNew(this Point point, Point point2) + { + return new Point(point2.X, point2.Y); + } + public static Point CreateNew(this Point point, int value) + { + return new Point(value, value); + } + public static Point CreateNew(this Point point, double value) + { + return new Point(value, value); + } + public static Point CreateNew(this Point point, int x, int y) + { + return new Point(x, y); + } + public static Point CreateNew(this Point point, double x, double y) + { + return new Point(x, y); + } + public static Point CreateNew(this Point point, Size size) + { + return new Point(size.Width, size.Height); + } + + public static bool IsClear(this Point point) + { + return (point.X == 0) && (point.Y == 0); + } + + public static Point Mirror(this Point point, bool onX = true, bool onY = true) + { + return new Point(onX ? -point.X : point.X, onY ? -point.Y : point.Y); + } + + public static Point Copy(this Point point) + { + return new Point(point.X, point.Y); + } + + /// + /// Operation + + /// + /// + /// + /// + public static Point Addition(this Point point1, Point point2) + { + return new Point(point1.X + point2.X, point1.Y + point2.Y); + } + /// + /// Operation + + /// + /// + /// + /// + public static Point Addition(this Point point1, int number) + { + return new Point(point1.X + number, point1.Y + number); + } + /// + /// Operation + + /// + /// + /// + /// + /// + public static Point Addition(this Point point1, int x, int y) + { + return new Point(point1.X + x, point1.Y + y); + } + /// + /// Operation + + /// + /// + /// + /// + public static Point Addition(this Point point1, double number) + { + return new Point(point1.X + number, point1.Y + number); + } + /// + /// Operation + + /// + /// + /// + /// + /// + public static Point Addition(this Point point1, double x, double y) + { + return new Point(point1.X + x, point1.Y + y); + } + /// + /// Operation + + /// + /// + /// + /// + /// + public static Point Addition(this Point point1, Size size) + { + return new Point(point1.X + size.Width, point1.Y + size.Height); + } + + /// + /// Operation - + /// + /// + /// + /// + public static Point Subtraction(this Point point1, Point point2) + { + return new Point(point1.X - point2.X, point1.Y - point2.Y); + } + /// + /// Operation - + /// + /// + /// + /// + public static Point Subtraction(this Point point1, int number) + { + return new Point(point1.X - number, point1.Y - number); + } + public static Point Subtraction(this Point point1, int x, int y) + { + return new Point(point1.X - x, point1.Y - y); + } + /// + /// Operation - + /// + /// + /// + /// + public static Point Subtraction(this Point point1, double number) + { + return new Point(point1.X - number, point1.Y - number); + } + /// + /// Operation - + /// + /// + /// + /// + /// + public static Point Subtraction(this Point point1, double x, double y) + { + return new Point(point1.X - x, point1.Y - y); + } + /// + /// Operation - + /// + /// + /// + /// + /// + public static Point Subtraction(this Point point1, Size size) + { + return new Point(point1.X - size.Width, point1.Y - size.Height); + } + + /// + /// Operation / + /// + /// + /// + /// + public static Point Division(this Point point1, Point point2) + { + return new Point(point1.X / point1.X, point1.Y / point1.Y); + } + /// + /// Operation / + /// + /// + /// + /// + public static Point Division(this Point point1, int number) + { + return new Point(point1.X / number, point1.Y / number); + } + public static Point Division(this Point point1, int x, int y) + { + return new Point(point1.X / x, point1.Y / y); + } + /// + /// Operation / + /// + /// + /// + /// + public static Point Division(this Point point1, double number) + { + return new Point(point1.X / number, point1.Y / number); + } + /// + /// Operation / + /// + /// + /// + /// + /// + public static Point Division(this Point point1, double x, double y) + { + return new Point(point1.X / x, point1.Y / y); + } + /// + /// Operation / + /// + /// + /// + /// + /// + public static Point Division(this Point point1, Size size) + { + return new Point(point1.X / size.Width, point1.Y / size.Height); + } + + /// + /// Operation * + /// + /// + /// + /// + public static Point Multiply(this Point point1, Point point2) + { + return new Point(point1.X * point2.X, point1.Y * point2.Y); + } + /// + /// Operation * + /// + /// + /// + /// + public static Point Multiply(this Point point1, int number) + { + return new Point(point1.X * number, point1.Y * number); + } + /// + /// Operation * + /// + /// + /// + /// + /// + public static Point Multiply(this Point point1, int x, int y) + { + return new Point(point1.X * x, point1.Y * y); + } + /// + /// Operation * + /// + /// + /// + /// + public static Point Multiply(this Point point1, double number) + { + return new Point(point1.X * number, point1.Y * number); + } + /// + /// Operation * + /// + /// + /// + /// + /// + public static Point Multiply(this Point point1, double x, double y) + { + return new Point(point1.X * x, point1.Y * y); + } + /// + /// Operation * + /// + /// + /// + /// + /// + public static Point Multiply(this Point point1, Size size) + { + return new Point(point1.X * size.Width, point1.Y * size.Height); + } + + public static string PointToString(Point point) + { + return string.Format("{0}, {1}", point.X.ToString(System.Globalization.CultureInfo.InvariantCulture), point.Y.ToString(System.Globalization.CultureInfo.InvariantCulture)); + } + + public static Point StringToPoint(string str) + { + string[] parts = str.Split(","); + return new Point(double.Parse(parts[0], System.Globalization.CultureInfo.InvariantCulture), double.Parse(parts[1], System.Globalization.CultureInfo.InvariantCulture)); + } + } +} diff --git a/SimpleStateMachineNodeEditor/Helpers/Extensions/ReactiveCommandExtension.cs b/SimpleStateMachineNodeEditor/Helpers/Extensions/ReactiveCommandExtension.cs index caf346f..fc1ac52 100644 --- a/SimpleStateMachineNodeEditor/Helpers/Extensions/ReactiveCommandExtension.cs +++ b/SimpleStateMachineNodeEditor/Helpers/Extensions/ReactiveCommandExtension.cs @@ -12,9 +12,5 @@ public static IDisposable ExecuteWithSubscribe(this ReactiveCom { return reactiveCommand.Execute(parameter).Subscribe(); } - public static ReactiveCommandWithUndoRedo CreateCommandWithUndoRedo(TParam parameter = default) - { - return null; - } } } diff --git a/SimpleStateMachineNodeEditor/Helpers/MyPoint.cs b/SimpleStateMachineNodeEditor/Helpers/MyPoint.cs index 8e6ac5e..70e052b 100644 --- a/SimpleStateMachineNodeEditor/Helpers/MyPoint.cs +++ b/SimpleStateMachineNodeEditor/Helpers/MyPoint.cs @@ -4,181 +4,176 @@ namespace SimpleStateMachineNodeEditor.Helpers { - public class MyPoint : ReactiveObject - { - [Reactive] public Point Value { get; set; } - - public double X - { - get { return Value.X; } - } - - public double Y - { - get { return Value.Y; } - } - - public MyPoint() : this(0, 0) - { - - } - public MyPoint(double x = 0, double y = 0) - { - Set(x, y); - } - - public MyPoint(Point point) - { - FromPoint(point); - } - public MyPoint(MyPoint point) - { - this.Set(point); - } - - public bool IsClear - { - get - { - return (this.X == 0) && (this.Y == 0); - } - } - - public void Clear() - { - Value = new Point(); - } - - /// - /// Отразить координаты - /// - /// Отразить по X (По умолчанию true) - /// Отразить по Y (По умолчанию true) - public void Mirror(bool onX = true, bool onY = true) - { - Value = new Point(onX ? -this.X : this.X, onY ? -this.Y : this.Y); - } - - public MyPoint Add(MyPoint point) - { - Value = new Point(point.X, point.Y); - return this; - } - - public MyPoint Add(double x = 0, double y = 0) - { - Value = new Point(this.X + x, this.Y + y); - return this; - } - - public MyPoint Set(double x = 0, double y = 0) - { - Value = new Point(x, y); - return this; - } - - public MyPoint Set(Point point) - { - this.Set(point.X, point.Y); - return this; - } - - public MyPoint Set(MyPoint point) - { - this.Set(point.X, point.Y); - return this; - } - - public Point ToPoint() - { - return MyPoint.ToPoint(this); - } - - public MyPoint FromPoint(Point point) - { - Set(point); - return this; - } + //public class MyPoint : ReactiveObject + //{ + // [Reactive] public Point Value { get; set; } + + // public double X + // { + // get { return Value.X; } + // } + + // public double Y + // { + // get { return Value.Y; } + // } + + // public MyPoint() : this(0, 0) + // { + + // } + // public MyPoint(double x = 0, double y = 0) + // { + // Set(x, y); + // } + + // public MyPoint(Point point) + // { + // FromPoint(point); + // } + // public MyPoint(MyPoint point) + // { + // this.Set(point); + // } + + // public bool IsClear + // { + // get + // { + // return (this.X == 0) && (this.Y == 0); + // } + // } + + // public void Clear() + // { + // Value = new Point(); + // } + + // public void Mirror(bool onX = true, bool onY = true) + // { + // Value = new Point(onX ? -this.X : this.X, onY ? -this.Y : this.Y); + // } + + // public MyPoint Add(MyPoint point) + // { + // Value = new Point(this.X + point.X, this.Y + point.Y); + // return this; + // } + + // public MyPoint Add(double x = 0, double y = 0) + // { + // Value = new Point(this.X + x, this.Y + y); + // return this; + // } + + // public MyPoint Set(double x = 0, double y = 0) + // { + // Value = new Point(x, y); + // return this; + // } + + // public MyPoint Set(Point point) + // { + // this.Set(point.X, point.Y); + // return this; + // } + + // public MyPoint Set(MyPoint point) + // { + // this.Set(point.X, point.Y); + // return this; + // } + + // public Point ToPoint() + // { + // return MyPoint.ToPoint(this); + // } + + // public MyPoint FromPoint(Point point) + // { + // Set(point); + // return this; + // } - public MyPoint Copy() - { - return new MyPoint(this); - } - - public override string ToString() - { - return string.Format("{0}, {1}", this.Value.X.ToString(System.Globalization.CultureInfo.InvariantCulture), this.Value.Y.ToString(System.Globalization.CultureInfo.InvariantCulture)); - } - - #region Static Methods - - public static Point ToPoint(MyPoint point) - { - return (point != null) ? new Point(point.X, point.Y) : new Point(); - } - - public static MyPoint CreateFromPoint(Point point) - { - return (point != null) ? new MyPoint(point.X, point.Y) : new MyPoint(); - } - - public static MyPoint operator +(MyPoint point1, MyPoint point2) - { - return new MyPoint(point1.X + point2.X, point1.Y + point2.Y); - } - - public static MyPoint operator -(MyPoint point1, MyPoint point2) - { - return new MyPoint(point1.X - point2.X, point1.Y - point2.Y); - } - - public static MyPoint operator +(MyPoint point1, int number) - { - return new MyPoint(point1.X + number, point1.Y + number); - } - - public static MyPoint operator -(MyPoint point1, int number) - { - return new MyPoint(point1.X - number, point1.Y - number); - } - - public static MyPoint operator /(MyPoint point1, int number) - { - return new MyPoint(point1.X / number, point1.Y / number); - } - - public static MyPoint operator *(MyPoint point1, int number) - { - return new MyPoint(point1.X * number, point1.Y * number); - } - - public static MyPoint operator +(MyPoint point1, double number) - { - return new MyPoint(point1.X + number, point1.Y + number); - } - - public static MyPoint operator -(MyPoint point1, double number) - { - return new MyPoint(point1.X - number, point1.Y - number); - } - - public static MyPoint operator /(MyPoint point1, double number) - { - return new MyPoint(point1.X / number, point1.Y / number); - } - - public static MyPoint operator *(MyPoint point1, double number) - { - return new MyPoint(point1.X * number, point1.Y * number); - } - - public static MyPoint Parse(string str) - { - string[] parts = str.Split(","); - return new MyPoint(double.Parse(parts[0], System.Globalization.CultureInfo.InvariantCulture), double.Parse(parts[1], System.Globalization.CultureInfo.InvariantCulture)); - } - - #endregion Static Methods - - } + // public MyPoint Copy() + // { + // return new MyPoint(this); + // } + + // public override string ToString() + // { + // return string.Format("{0}, {1}", this.Value.X.ToString(System.Globalization.CultureInfo.InvariantCulture), this.Value.Y.ToString(System.Globalization.CultureInfo.InvariantCulture)); + // } + + // #region Static Methods + + // public static Point ToPoint(MyPoint point) + // { + // return (point != null) ? new Point(point.X, point.Y) : new Point(); + // } + + // public static MyPoint CreateFromPoint(Point point) + // { + // return (point != null) ? new MyPoint(point.X, point.Y) : new MyPoint(); + // } + + // public static MyPoint operator +(MyPoint point1, MyPoint point2) + // { + // return new MyPoint(point1.X + point2.X, point1.Y + point2.Y); + // } + + // public static MyPoint operator -(MyPoint point1, MyPoint point2) + // { + // return new MyPoint(point1.X - point2.X, point1.Y - point2.Y); + // } + + // public static MyPoint operator +(MyPoint point1, int number) + // { + // return new MyPoint(point1.X + number, point1.Y + number); + // } + + // public static MyPoint operator -(MyPoint point1, int number) + // { + // return new MyPoint(point1.X - number, point1.Y - number); + // } + + // public static MyPoint operator /(MyPoint point1, int number) + // { + // return new MyPoint(point1.X / number, point1.Y / number); + // } + + // public static MyPoint operator *(MyPoint point1, int number) + // { + // return new MyPoint(point1.X * number, point1.Y * number); + // } + + // public static MyPoint operator +(MyPoint point1, double number) + // { + // return new MyPoint(point1.X + number, point1.Y + number); + // } + + // public static MyPoint operator -(MyPoint point1, double number) + // { + // return new MyPoint(point1.X - number, point1.Y - number); + // } + + // public static MyPoint operator /(MyPoint point1, double number) + // { + // return new MyPoint(point1.X / number, point1.Y / number); + // } + + // public static MyPoint operator *(MyPoint point1, double number) + // { + // return new MyPoint(point1.X * number, point1.Y * number); + // } + + // public static MyPoint Parse(string str) + // { + // string[] parts = str.Split(","); + // return new MyPoint(double.Parse(parts[0], System.Globalization.CultureInfo.InvariantCulture), double.Parse(parts[1], System.Globalization.CultureInfo.InvariantCulture)); + // } + + // #endregion Static Methods + + //} } diff --git a/SimpleStateMachineNodeEditor/Helpers/MyUtils.cs b/SimpleStateMachineNodeEditor/Helpers/MyUtils.cs index 3aebdbc..1a82ad7 100644 --- a/SimpleStateMachineNodeEditor/Helpers/MyUtils.cs +++ b/SimpleStateMachineNodeEditor/Helpers/MyUtils.cs @@ -112,7 +112,7 @@ public static void PanelToImage(Panel panel, string filename, ImageFormats forma } } - public static bool CheckIntersectTwoRectangles(MyPoint a1, MyPoint a2, MyPoint b1, MyPoint b2) + public static bool CheckIntersectTwoRectangles(Point a1, Point a2, Point b1, Point b2) { bool par1 = a1.X > b2.X; //second before first bool par2 = b1.X > a2.X; //first before second @@ -123,13 +123,13 @@ public static bool CheckIntersectTwoRectangles(MyPoint a1, MyPoint a2, MyPoint b return !(par1 || par2 || par3 || par4); } - public static MyPoint GetStartPointDiagonal(MyPoint a1, MyPoint b1) + public static Point GetStartPointDiagonal(Point a1, Point b1) { - return new MyPoint(Math.Min(a1.X, b1.X), Math.Min(a1.Y, b1.Y)); + return new Point(Math.Min(a1.X, b1.X), Math.Min(a1.Y, b1.Y)); } - public static MyPoint GetEndPointDiagonal(MyPoint a1, MyPoint b1) + public static Point GetEndPointDiagonal(Point a1, Point b1) { - return new MyPoint(Math.Max(a1.X, b1.X), Math.Max(a1.Y, b1.Y)); + return new Point(Math.Max(a1.X, b1.X), Math.Max(a1.Y, b1.Y)); } #region Check on intersections curve Bezier and line @@ -143,7 +143,7 @@ public static MyPoint GetEndPointDiagonal(MyPoint a1, MyPoint b1) //Gets coefficients of curve Bezier - private static Point[] bezierCoeffs(MyPoint bezierStartPoint, MyPoint bezierPoint1, MyPoint bezierPoint2, MyPoint bezierEndPoint) + private static Point[] bezierCoeffs(Point bezierStartPoint, Point bezierPoint1, Point bezierPoint2, Point bezierEndPoint) { Point[] coeffs = new Point[4]; double bezierStartPointX_M_3 = bezierStartPoint.X * 3.0; @@ -258,7 +258,7 @@ private static double[] cubicRoots(double a, double b, double c, double d) } //Check on intersections curve Bezier and line - public static bool CheckIntersectCubicBezierCurveAndLine(MyPoint bezierStartPoint, MyPoint bezierPoint1, MyPoint bezierPoint2, MyPoint bezierEndPoint, MyPoint lineStartPoint, MyPoint lineEndPoint) + public static bool CheckIntersectCubicBezierCurveAndLine(Point bezierStartPoint, Point bezierPoint1, Point bezierPoint2, Point bezierEndPoint, Point lineStartPoint, Point lineEndPoint) { // coefficients of line double A = lineEndPoint.Y - lineStartPoint.Y;// A = y2 - y1 @@ -279,9 +279,9 @@ public static bool CheckIntersectCubicBezierCurveAndLine(MyPoint bezierStartPoin //find roots of cubic var r = cubicRoots(P[0], P[1], P[2], P[3]); - List X = new List(); + List X = new List(); double t; - MyPoint p; + Point p; double s; double tMt; double tMtMt; @@ -294,7 +294,7 @@ public static bool CheckIntersectCubicBezierCurveAndLine(MyPoint bezierStartPoin tMtMt = tMt * t; #endregion some optimization - p = new MyPoint + p = new Point ( coeffs[0].X * tMtMt + coeffs[1].X * tMt + coeffs[2].X * t + coeffs[3].X, coeffs[0].Y * tMtMt + coeffs[1].Y * tMt + coeffs[2].Y * t + coeffs[3].Y diff --git a/SimpleStateMachineNodeEditor/Helpers/Transformations/Scale.cs b/SimpleStateMachineNodeEditor/Helpers/Transformations/Scale.cs index 77d4a72..d901937 100644 --- a/SimpleStateMachineNodeEditor/Helpers/Transformations/Scale.cs +++ b/SimpleStateMachineNodeEditor/Helpers/Transformations/Scale.cs @@ -1,14 +1,17 @@ using ReactiveUI; using ReactiveUI.Fody.Helpers; +using SimpleStateMachineNodeEditor.Helpers.Extensions; +using Splat; using System; using System.Reactive.Linq; +using System.Windows; namespace SimpleStateMachineNodeEditor.Helpers.Transformations { public class Scale : ReactiveObject { - [Reactive] public MyPoint Scales { get; set; } = new MyPoint(1, 1); - [Reactive] public MyPoint Center { get; set; } = new MyPoint(); + [Reactive] public Point Scales { get; set; } = new Point(1, 1); + [Reactive] public Point Center { get; set; } [Reactive] public double Value { get; set; } = 1.0; @@ -32,7 +35,7 @@ public double CenterY public Scale() { - this.WhenAnyValue(x => x.Value).Subscribe(value => Scales.Set(value, value)); + this.WhenAnyValue(x => x.Value).Subscribe(value => Scales = PointExtensition.CreatePoint(value)); } } } diff --git a/SimpleStateMachineNodeEditor/Helpers/Transformations/Translate.cs b/SimpleStateMachineNodeEditor/Helpers/Transformations/Translate.cs deleted file mode 100644 index 3aee8dc..0000000 --- a/SimpleStateMachineNodeEditor/Helpers/Transformations/Translate.cs +++ /dev/null @@ -1,10 +0,0 @@ -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - -namespace SimpleStateMachineNodeEditor.Helpers.Transformations -{ - public class Translate : ReactiveObject - { - [Reactive] public MyPoint Translates { get; set; } = new MyPoint(1, 1); - } -} diff --git a/SimpleStateMachineNodeEditor/Icons/AddNode.xaml b/SimpleStateMachineNodeEditor/Icons/AddNode.xaml index 0feff5a..49909d8 100644 --- a/SimpleStateMachineNodeEditor/Icons/AddNode.xaml +++ b/SimpleStateMachineNodeEditor/Icons/AddNode.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/Close.xaml b/SimpleStateMachineNodeEditor/Icons/Close.xaml index 69330c2..96a2972 100644 --- a/SimpleStateMachineNodeEditor/Icons/Close.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Close.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/CollapseUp.xaml b/SimpleStateMachineNodeEditor/Icons/CollapseUp.xaml index 29015f4..ac799cc 100644 --- a/SimpleStateMachineNodeEditor/Icons/CollapseUp.xaml +++ b/SimpleStateMachineNodeEditor/Icons/CollapseUp.xaml @@ -5,7 +5,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/ExpandDownGroup.xaml b/SimpleStateMachineNodeEditor/Icons/CollapseUpAll.xaml similarity index 67% rename from SimpleStateMachineNodeEditor/Icons/ExpandDownGroup.xaml rename to SimpleStateMachineNodeEditor/Icons/CollapseUpAll.xaml index 2df7298..aa0dd70 100644 --- a/SimpleStateMachineNodeEditor/Icons/ExpandDownGroup.xaml +++ b/SimpleStateMachineNodeEditor/Icons/CollapseUpAll.xaml @@ -1,10 +1,10 @@  - + - + diff --git a/SimpleStateMachineNodeEditor/Icons/Copy.xaml b/SimpleStateMachineNodeEditor/Icons/Copy.xaml index 7f4aecb..c71148e 100644 --- a/SimpleStateMachineNodeEditor/Icons/Copy.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Copy.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/DeleteScheme.xaml b/SimpleStateMachineNodeEditor/Icons/DeleteScheme.xaml index a415675..be561d2 100644 --- a/SimpleStateMachineNodeEditor/Icons/DeleteScheme.xaml +++ b/SimpleStateMachineNodeEditor/Icons/DeleteScheme.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/ErrorList.xaml b/SimpleStateMachineNodeEditor/Icons/ErrorList.xaml index bfe780f..ef2c1d6 100644 --- a/SimpleStateMachineNodeEditor/Icons/ErrorList.xaml +++ b/SimpleStateMachineNodeEditor/Icons/ErrorList.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/ExpandDown.xaml b/SimpleStateMachineNodeEditor/Icons/ExpandDown.xaml index 2a34f2a..65cfb86 100644 --- a/SimpleStateMachineNodeEditor/Icons/ExpandDown.xaml +++ b/SimpleStateMachineNodeEditor/Icons/ExpandDown.xaml @@ -5,7 +5,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/CollapseUpGroup.xaml b/SimpleStateMachineNodeEditor/Icons/ExpandDownAll.xaml similarity index 67% rename from SimpleStateMachineNodeEditor/Icons/CollapseUpGroup.xaml rename to SimpleStateMachineNodeEditor/Icons/ExpandDownAll.xaml index 08321a1..bd8a395 100644 --- a/SimpleStateMachineNodeEditor/Icons/CollapseUpGroup.xaml +++ b/SimpleStateMachineNodeEditor/Icons/ExpandDownAll.xaml @@ -1,10 +1,10 @@  - + - + diff --git a/SimpleStateMachineNodeEditor/Icons/ExportScheme.xaml b/SimpleStateMachineNodeEditor/Icons/ExportScheme.xaml index 9730577..7156a2e 100644 --- a/SimpleStateMachineNodeEditor/Icons/ExportScheme.xaml +++ b/SimpleStateMachineNodeEditor/Icons/ExportScheme.xaml @@ -5,9 +5,9 @@ - + - + diff --git a/SimpleStateMachineNodeEditor/Icons/Icons.xaml b/SimpleStateMachineNodeEditor/Icons/Icons.xaml index 3320b4b..27aba44 100644 --- a/SimpleStateMachineNodeEditor/Icons/Icons.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Icons.xaml @@ -1,13 +1,15 @@  - + + + - + @@ -21,11 +23,10 @@ - + - diff --git a/SimpleStateMachineNodeEditor/Icons/ImportScheme.xaml b/SimpleStateMachineNodeEditor/Icons/ImportScheme.xaml index f2e82fb..4e5f66d 100644 --- a/SimpleStateMachineNodeEditor/Icons/ImportScheme.xaml +++ b/SimpleStateMachineNodeEditor/Icons/ImportScheme.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/Maximize.xaml b/SimpleStateMachineNodeEditor/Icons/Maximize.xaml index 6f06a35..571c812 100644 --- a/SimpleStateMachineNodeEditor/Icons/Maximize.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Maximize.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/Minimize.xaml b/SimpleStateMachineNodeEditor/Icons/Minimize.xaml index 344f078..37b89bb 100644 --- a/SimpleStateMachineNodeEditor/Icons/Minimize.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Minimize.xaml @@ -3,9 +3,8 @@ - - - + + diff --git a/SimpleStateMachineNodeEditor/Icons/NewSheme.xaml b/SimpleStateMachineNodeEditor/Icons/NewSheme.xaml index 2964243..20e6543 100644 --- a/SimpleStateMachineNodeEditor/Icons/NewSheme.xaml +++ b/SimpleStateMachineNodeEditor/Icons/NewSheme.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/Redo.xaml b/SimpleStateMachineNodeEditor/Icons/Redo.xaml index c488049..76decd5 100644 --- a/SimpleStateMachineNodeEditor/Icons/Redo.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Redo.xaml @@ -4,9 +4,7 @@ - - + diff --git a/SimpleStateMachineNodeEditor/Icons/Relationship.xaml b/SimpleStateMachineNodeEditor/Icons/Relationship.xaml deleted file mode 100644 index 4ab5c71..0000000 --- a/SimpleStateMachineNodeEditor/Icons/Relationship.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SimpleStateMachineNodeEditor/Icons/Restore.xaml b/SimpleStateMachineNodeEditor/Icons/Restore.xaml index 8e1f079..e40577d 100644 --- a/SimpleStateMachineNodeEditor/Icons/Restore.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Restore.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/Save.xaml b/SimpleStateMachineNodeEditor/Icons/Save.xaml index 9015f5d..400018d 100644 --- a/SimpleStateMachineNodeEditor/Icons/Save.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Save.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/SaveAs.xaml b/SimpleStateMachineNodeEditor/Icons/SaveAs.xaml index 47b3213..af997c1 100644 --- a/SimpleStateMachineNodeEditor/Icons/SaveAs.xaml +++ b/SimpleStateMachineNodeEditor/Icons/SaveAs.xaml @@ -4,12 +4,8 @@ - - - + + diff --git a/SimpleStateMachineNodeEditor/Icons/SelectAll.xaml b/SimpleStateMachineNodeEditor/Icons/SelectAll.xaml index 519cf5e..f162acd 100644 --- a/SimpleStateMachineNodeEditor/Icons/SelectAll.xaml +++ b/SimpleStateMachineNodeEditor/Icons/SelectAll.xaml @@ -4,8 +4,8 @@ - - + + diff --git a/SimpleStateMachineNodeEditor/Icons/Test.xaml b/SimpleStateMachineNodeEditor/Icons/Test.xaml deleted file mode 100644 index 4ab47a0..0000000 --- a/SimpleStateMachineNodeEditor/Icons/Test.xaml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - diff --git a/SimpleStateMachineNodeEditor/Icons/Test.xaml.cs b/SimpleStateMachineNodeEditor/Icons/Test.xaml.cs deleted file mode 100644 index 7ec8c66..0000000 --- a/SimpleStateMachineNodeEditor/Icons/Test.xaml.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -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 SimpleStateMachineNodeEditor.Icons -{ - /// - /// Interaction logic for Test.xaml - /// - public partial class Test : UserControl - { - public Test() - { - InitializeComponent(); - } - } -} diff --git a/SimpleStateMachineNodeEditor/Icons/Undo.xaml b/SimpleStateMachineNodeEditor/Icons/Undo.xaml index a424894..3efeca0 100644 --- a/SimpleStateMachineNodeEditor/Icons/Undo.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Undo.xaml @@ -1,12 +1,14 @@  + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + > - + + diff --git a/SimpleStateMachineNodeEditor/Icons/Update.xaml b/SimpleStateMachineNodeEditor/Icons/Update.xaml index 4ce5c1c..176c74e 100644 --- a/SimpleStateMachineNodeEditor/Icons/Update.xaml +++ b/SimpleStateMachineNodeEditor/Icons/Update.xaml @@ -4,7 +4,7 @@ - + diff --git a/SimpleStateMachineNodeEditor/Icons/ZoomIn.xaml b/SimpleStateMachineNodeEditor/Icons/ZoomIn.xaml index 2f3fe5a..73c16b8 100644 --- a/SimpleStateMachineNodeEditor/Icons/ZoomIn.xaml +++ b/SimpleStateMachineNodeEditor/Icons/ZoomIn.xaml @@ -4,8 +4,8 @@ - - + + diff --git a/SimpleStateMachineNodeEditor/Icons/ZoomOriginalSize.xaml b/SimpleStateMachineNodeEditor/Icons/ZoomOriginalSize.xaml index 538ddab..c0c176a 100644 --- a/SimpleStateMachineNodeEditor/Icons/ZoomOriginalSize.xaml +++ b/SimpleStateMachineNodeEditor/Icons/ZoomOriginalSize.xaml @@ -4,9 +4,8 @@ - - - + + diff --git a/SimpleStateMachineNodeEditor/Icons/ZoomOut.xaml b/SimpleStateMachineNodeEditor/Icons/ZoomOut.xaml index 26425ba..b82ec7c 100644 --- a/SimpleStateMachineNodeEditor/Icons/ZoomOut.xaml +++ b/SimpleStateMachineNodeEditor/Icons/ZoomOut.xaml @@ -4,10 +4,8 @@ - - - + + diff --git a/SimpleStateMachineNodeEditor/SimpleStateMachineNodeEditor.csproj b/SimpleStateMachineNodeEditor/SimpleStateMachineNodeEditor.csproj index 0a7e087..b0ffaf3 100644 --- a/SimpleStateMachineNodeEditor/SimpleStateMachineNodeEditor.csproj +++ b/SimpleStateMachineNodeEditor/SimpleStateMachineNodeEditor.csproj @@ -5,7 +5,7 @@ netcoreapp3.1 true SimpleStateMachineNodeEditor.App - StateMachine_16x.ico + StateMachine.ico @@ -54,10 +54,4 @@ - - - Designer - - - \ No newline at end of file diff --git a/SimpleStateMachineNodeEditor/StateMachine_16x.ico b/SimpleStateMachineNodeEditor/StateMachine.ico similarity index 100% rename from SimpleStateMachineNodeEditor/StateMachine_16x.ico rename to SimpleStateMachineNodeEditor/StateMachine.ico diff --git a/SimpleStateMachineNodeEditor/Styles/MainWindow/Header/StyleHeaderButtonClosePath.xaml b/SimpleStateMachineNodeEditor/Styles/MainWindow/Header/StyleHeaderButtonClosePath.xaml deleted file mode 100644 index ac79c57..0000000 --- a/SimpleStateMachineNodeEditor/Styles/MainWindow/Header/StyleHeaderButtonClosePath.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - \ No newline at end of file diff --git a/SimpleStateMachineNodeEditor/Styles/MainWindow/ToolBar/TemplateSeparator.xaml b/SimpleStateMachineNodeEditor/Styles/MainWindow/ToolBar/TemplateSeparator.xaml index 2ada62d..d30ff05 100644 --- a/SimpleStateMachineNodeEditor/Styles/MainWindow/ToolBar/TemplateSeparator.xaml +++ b/SimpleStateMachineNodeEditor/Styles/MainWindow/ToolBar/TemplateSeparator.xaml @@ -3,8 +3,8 @@ xmlns:local="clr-namespace:SimpleStateMachineNodeEditor.Styles.MainWindow.ToolBar">