diff --git a/DomainModel/DataFile/AppSetttingFile.cs b/DomainModel/DataFile/AppSetttingFile.cs deleted file mode 100644 index 8c8648b..0000000 --- a/DomainModel/DataFile/AppSetttingFile.cs +++ /dev/null @@ -1,19 +0,0 @@ -using MSFSPopoutPanelManager.DomainModel.Setting; - -namespace MSFSPopoutPanelManager.DomainModel.DataFile -{ - public class AppSetttingFile - { - public AppSetttingFile() - { - FileVersion = "4.0"; - ApplicationSetting = new ApplicationSetting(); - } - - public string FileVersion { get; set; } - - public ApplicationSetting ApplicationSetting { get; set; } - } - - -} diff --git a/DomainModel/DomainModel.csproj b/DomainModel/DomainModel.csproj index c5e9ea9..4bc947a 100644 --- a/DomainModel/DomainModel.csproj +++ b/DomainModel/DomainModel.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.DomainModel x64 - 4.0.4.1 - 4.0.4.1 - 4.0.4.1 + 4.1.0.1 + 4.1.0.1 + 4.1.0.1 win-x64 Embedded Debug;Release;Local diff --git a/DomainModel/Legacy/LegacyAppSetting.cs b/DomainModel/Legacy/LegacyAppSetting.cs deleted file mode 100644 index 2ae9e10..0000000 --- a/DomainModel/Legacy/LegacyAppSetting.cs +++ /dev/null @@ -1,78 +0,0 @@ -using MSFSPopoutPanelManager.DomainModel.Setting; - -namespace MSFSPopoutPanelManager.DomainModel.Legacy -{ - public class LegacyAppSetting - { - public string AutoUpdaterUrl { get; set; } - - public int LastUsedProfileId { get; set; } - - public bool MinimizeToTray { get; set; } - - public bool AlwaysOnTop { get; set; } - - public bool AutoClose { get; set; } - - public bool UseAutoPanning { get; set; } - - public bool MinimizeAfterPopOut { get; set; } - - public string AutoPanningKeyBinding { get; set; } - - public bool StartMinimized { get; set; } - - public bool AutoPopOutPanels { get; set; } - - public bool AutoDisableTrackIR { get; set; } - - public int OnScreenMessageDuration { get; set; } - - public bool UseLeftRightControlToPopOut { get; set; } - - public bool IsEnabledTouchPanelServer { get; set; } - - public bool AutoResizeMsfsGameWindow { get; set; } - - public LegacyAfterPopOutCameraView AfterPopOutCameraView { get; set; } - - public LegacyTouchScreenSettings TouchScreenSettings { get; set; } - - public LegacyTouchPanelSettings TouchPanelSettings { get; set; } - } - - public class LegacyAfterPopOutCameraView - { - public bool EnableReturnToCameraView { get; set; } - - public AfterPopOutCameraViewType CameraView { get; set; } - - public string CustomCameraKeyBinding { get; set; } - } - - public class LegacyTouchScreenSettings - { - public int TouchDownUpDelay { get; set; } - - public bool RefocusGameWindow { get; set; } - - public int RefocusGameWindowDelay { get; set; } - - public bool RealSimGearGTN750Gen1Override { get; set; } - } - - public class LegacyTouchPanelSettings - { - public bool EnableTouchPanelIntegration { get; set; } - - public bool AutoStart { get; set; } - - public int DataRefreshInterval { get; set; } - - public int MapRefreshInterval { get; set; } - - public bool UseArduino { get; set; } - - public bool EnableSound { get; set; } - } -} diff --git a/DomainModel/Legacy/LegacyProfile.cs b/DomainModel/Legacy/LegacyProfile.cs deleted file mode 100644 index 06aa48e..0000000 --- a/DomainModel/Legacy/LegacyProfile.cs +++ /dev/null @@ -1,84 +0,0 @@ -using MSFSPopoutPanelManager.DomainModel.Profile; -using System.Collections.ObjectModel; - -namespace MSFSPopoutPanelManager.DomainModel.Legacy -{ - public class LegacyProfile - { - public int ProfileId { get; set; } - - public string ProfileName { get; set; } - - public ObservableCollection BindingAircrafts { get; set; } - - public ObservableCollection PanelSourceCoordinates { get; set; } - - public ObservableCollection PanelConfigs { get; set; } - - public ObservableCollection TouchPanelBindings { get; set; } - - public bool IsLocked { get; set; } - - public bool PowerOnRequiredForColdStart { get; set; } - - public bool IncludeInGamePanels { get; set; } - - public bool RealSimGearGTN750Gen1Override { get; set; } - - public LegacyMsfsGameWindowConfig MsfsGameWindowConfig { get; set; } - } - - public class LegacyPanelSourceCoordinate - { - public int PanelIndex { get; set; } - - public int X { get; set; } - - public int Y { get; set; } - } - - public class LegacyPanelConfig - { - public int PanelIndex { get; set; } - - public string PanelName { get; set; } - - public PanelType PanelType { get; set; } - - public int Top { get; set; } - - public int Left { get; set; } - - public int Width { get; set; } - - public int Height { get; set; } - - public bool AlwaysOnTop { get; set; } - - public bool HideTitlebar { get; set; } - - public bool FullScreen { get; set; } - - public bool TouchEnabled { get; set; } - - public bool DisableGameRefocus { get; set; } - } - - public class LegacyTouchPanelBinding - { - public string PlaneId { get; set; } - - public string PanelId { get; set; } - } - - public class LegacyMsfsGameWindowConfig - { - public int Top { get; set; } - - public int Left { get; set; } - - public int Width { get; set; } - - public int Height { get; set; } - } -} diff --git a/MSFSPopoutPanelManager.sln b/MSFSPopoutPanelManager.sln index 4a7d36c..57037bd 100644 --- a/MSFSPopoutPanelManager.sln +++ b/MSFSPopoutPanelManager.sln @@ -14,7 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution LICENSE = LICENSE README.md = README.md RELEASENOTES.md = RELEASENOTES.md - rollback.xml = rollback.xml VERSION.md = VERSION.md EndProjectSection EndProject diff --git a/MainApp/AppUserControl/PopOutPanelSourceCard.xaml.cs b/MainApp/AppUserControl/PopOutPanelSourceCard.xaml.cs index a8b0199..6530706 100644 --- a/MainApp/AppUserControl/PopOutPanelSourceCard.xaml.cs +++ b/MainApp/AppUserControl/PopOutPanelSourceCard.xaml.cs @@ -70,7 +70,7 @@ namespace MSFSPopoutPanelManager.MainApp.AppUserControl var fe = e.OriginalSource as FrameworkElement; - if (fe?.Name != "HeaderSiteContent" && fe?.Name != "BtnShowSourcePanel") + if (fe?.Name != "HeaderSiteContent" && fe?.Name != "BtnShowSourcePanel" && fe?.Name != "BtnIdentifySourcePanel") return; foreach (var panelConfig in _viewModel.ActiveProfile.PanelConfigs) diff --git a/MainApp/AppWindow.xaml b/MainApp/AppWindow.xaml deleted file mode 100644 index 24902e3..0000000 --- a/MainApp/AppWindow.xaml +++ /dev/null @@ -1,165 +0,0 @@ - - - 28 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MainApp/AppWindow.xaml.cs b/MainApp/AppWindow.xaml.cs deleted file mode 100644 index 70ac277..0000000 --- a/MainApp/AppWindow.xaml.cs +++ /dev/null @@ -1,96 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.DomainModel.Profile; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using MSFSPopoutPanelManager.WindowsAgent; -using Prism.Commands; -using System; -using System.Windows; -using System.Windows.Interop; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class AppWindow : Window - { - private ApplicationViewModel _viewModel; - - // This command has to be here since it doesn't work in view model, window StateChanged never gets fire - public DelegateCommand RestoreWindowCommand => new DelegateCommand(() => { this.WindowState = WindowState.Normal; }, () => { return true; }); - - public AppWindow() - { - _viewModel = App.AppHost.Services.GetRequiredService(); - InitializeComponent(); - Loaded += AppWindow_Loaded; - Closing += AppWindow_Closing; - StateChanged += AppWindow_StateChanged; - WindowActionManager.OnPopOutManagerAlwaysOnTopChanged += (sender, e) => { this.Topmost = e; }; - this.MouseLeftButtonDown += (sender, e) => DragMove(); - } - - private void AppWindow_Loaded(object sender, RoutedEventArgs e) - { - _viewModel.ApplicationHandle = new WindowInteropHelper(Window.GetWindow(this)).Handle; - _viewModel.ApplicationWindow = Application.Current.MainWindow; - _viewModel.Initialize(); - - this.DataContext = _viewModel; - - // Try to fix always on to click through. This won't work for app's title bar since mouseEnter won't be triggered. - // This is super tricky to trick POPM process is MSFS process to avoid Windows OS focus stealing - this.MouseEnter += (sender, e) =>WindowActionManager.SetWindowFocus(WindowProcessManager.GetApplicationProcess().Handle); - } - - private void AppWindow_Closing(object? sender, System.ComponentModel.CancelEventArgs e) - { - e.Cancel = true; - _viewModel.WindowClosing(); - } - - private void AppWindow_StateChanged(object? sender, EventArgs e) - { - switch (this.WindowState) - { - case WindowState.Maximized: - this.ShowInTaskbar = true; - break; - case WindowState.Minimized: - if (_viewModel.AppSettingData.ApplicationSetting.GeneralSetting.MinimizeToTray) - { - SystemTrayIcon.Tray.Visibility = Visibility.Visible; - this.ShowInTaskbar = false; - } - break; - case WindowState.Normal: - SystemTrayIcon.Tray.Visibility = Visibility.Hidden; - this.ShowInTaskbar = true; - - // Fix always on top status once app is minimize and then restore - if (_viewModel.AppSettingData.ApplicationSetting.GeneralSetting.AlwaysOnTop) - WindowActionManager.ApplyAlwaysOnTop(_viewModel.ApplicationHandle, PanelType.PopOutManager, true); - break; - } - } - - private void SettingsButton_Click(object sender, RoutedEventArgs e) - { - this.panelDrawers.Children.Clear(); - this.panelDrawers.Children.Add(new PreferenceDrawer()); - } - - private void HelpButton_Click(object sender, RoutedEventArgs e) - { - this.panelDrawers.Children.Clear(); - this.panelDrawers.Children.Add(new HelpDrawer()); - } - - private void BtnMinimize_Click(object sender, RoutedEventArgs e) - { - this.WindowState = WindowState.Minimized; - } - - private void BtnClose_Click(object sender, RoutedEventArgs e) - { - this.Close(); - } - } -} diff --git a/MainApp/HudBar.xaml b/MainApp/HudBar.xaml deleted file mode 100644 index b56161e..0000000 --- a/MainApp/HudBar.xaml +++ /dev/null @@ -1,284 +0,0 @@ - - - 22 - 28 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Elevator Trim: - - - - - - - Aileron Trim: - - - - - - - Rudder Trim: - - - - - - - Flaps: - - - - - - - Brake: - - - - - - - - - - - Gear: - - - - - - - - - - - - - - - - - - - - - - - Timer: - - - - - - - - - - - Sim Rate: - - - - - - - - - - - - - - - - diff --git a/MainApp/HudBar.xaml.cs b/MainApp/HudBar.xaml.cs deleted file mode 100644 index 6cd3446..0000000 --- a/MainApp/HudBar.xaml.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using System; -using System.Windows; -using System.Windows.Input; -using System.Windows.Interop; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class HudBar : Window - { - private HudBarViewModel _viewModel; - - public HudBar(Guid panelId) - { - _viewModel = App.AppHost.Services.GetRequiredService(); - _viewModel.PanelId = panelId; - - InitializeComponent(); - Loaded += (sender, e) => - { - DataContext = _viewModel; - _viewModel.PanelConfig.PanelHandle = new WindowInteropHelper(Window.GetWindow(this)).Handle; - _viewModel.PanelConfig.Width = Convert.ToInt32(Width); - _viewModel.PanelConfig.Height = Convert.ToInt32(Height); - }; - - this.MouseLeftButtonDown += HudBar_MouseLeftButtonDown; - this.Topmost = true; - - Closing += HudBar_Closing; - } - - private void HudBar_Closing(object sender, System.ComponentModel.CancelEventArgs e) - { - _viewModel.CloseCommand.Execute(null); - } - - private void HudBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) - { - DragMove(); - } - - private void BtnClose_Click(object sender, RoutedEventArgs e) - { - this.Close(); - } - } -} diff --git a/MainApp/MainApp.csproj b/MainApp/MainApp.csproj index 9dd17fa..f9e73f5 100644 --- a/MainApp/MainApp.csproj +++ b/MainApp/MainApp.csproj @@ -14,9 +14,9 @@ MSFSPopoutPanelManager.MainApp logo.ico x64 - 4.0.4.1 - 4.0.4.1 - 4.0.4.1 + 4.1.0.1 + 4.1.0.1 + 4.1.0.1 embedded en diff --git a/MainApp/MessageWindow.xaml b/MainApp/MessageWindow.xaml deleted file mode 100644 index 16a38df..0000000 --- a/MainApp/MessageWindow.xaml +++ /dev/null @@ -1,64 +0,0 @@ - - - 22 - 28 - - - - - - - MSFS POP OUT PANEL MANAGER - - - - - - - - - - diff --git a/MainApp/MessageWindow.xaml.cs b/MainApp/MessageWindow.xaml.cs deleted file mode 100644 index 1a5e2dc..0000000 --- a/MainApp/MessageWindow.xaml.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Interop; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class MessageWindow : Window - { - private MessageWindowViewModel _viewModel; - - public MessageWindow() - { - _viewModel = App.AppHost.Services.GetRequiredService(); - - InitializeComponent(); - Loaded += (sender, e) => - { - DataContext = _viewModel; - _viewModel.Handle = new WindowInteropHelper(Window.GetWindow(this)).Handle; - - // Set window binding, needs to be in code after window loaded - Binding visibleBinding = new Binding("IsVisible"); - visibleBinding.Source = _viewModel; - visibleBinding.Converter = new BooleanToVisibilityConverter(); - BindingOperations.SetBinding(this, Window.VisibilityProperty, visibleBinding); - - // Set window click through - WindowsServices.SetWindowExTransparent(_viewModel.Handle); - - _viewModel.OnMessageUpdated += _viewModel_OnMessageUpdated; - }; - } - - private void _viewModel_OnMessageUpdated(object sender, List e) - { - if (e == null) - return; - - TextBlockMessage.Inlines.Clear(); - - foreach (var run in e) - TextBlockMessage.Inlines.Add(run); - - ScrollViewerMessage.ScrollToEnd(); - } - } - - public static class WindowsServices - { - const int WS_EX_TRANSPARENT = 0x00000020; - const int GWL_EXSTYLE = (-20); - - [DllImport("user32.dll")] - static extern int GetWindowLong(IntPtr hwnd, int index); - - [DllImport("user32.dll")] - static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle); - - public static void SetWindowExTransparent(IntPtr hwnd) - { - var extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE); - SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT); - } - } -} diff --git a/MainApp/PanelCoorOverlay.xaml b/MainApp/PanelCoorOverlay.xaml deleted file mode 100644 index 501c921..0000000 --- a/MainApp/PanelCoorOverlay.xaml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/MainApp/PanelCoorOverlay.xaml.cs b/MainApp/PanelCoorOverlay.xaml.cs deleted file mode 100644 index 5e5b0d3..0000000 --- a/MainApp/PanelCoorOverlay.xaml.cs +++ /dev/null @@ -1,111 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.DomainModel.Profile; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using MSFSPopoutPanelManager.WindowsAgent; -using System; -using System.Windows; -using System.Windows.Interop; -using System.Windows.Media; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class PanelCoorOverlay : Window - { - private PanelCoorOverlayViewModel _viewModel; - - private const int WINDOW_ADJUSTMENT = 20; // half of window height with shadow adjustment - - private int _xCoor; - private int _yCoor; - - public bool IsEditingPanelLocation { get; set; } - - public Guid PanelId { get; set; } - - public IntPtr WindowHandle { get; set; } - - public bool IsAllowedEdit { get; set; } - - public event EventHandler WindowLocationChanged; - - public PanelCoorOverlay(Guid id, bool isAllowedEdit) - { - _viewModel = App.AppHost.Services.GetRequiredService(); - _viewModel.SetPanelId(id); - PanelId = id; - IsAllowedEdit = isAllowedEdit; - - InitializeComponent(); - Loaded += PanelCoorOverlay_Loaded; - - OverlayCircle.Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString(_viewModel.Panel.PanelSource.Color)); - - if (!_viewModel.ProfileData.ActiveProfile.IsEditingPanelSource) - OverlayBlinkingCircle.Visibility = Visibility.Collapsed; - - IsEditingPanelLocation = false; - this.Topmost = true; - this.Left = 0; - this.Top = 0; - - this.MouseUp += PanelCoorOverlay_MouseUp; // detect location change when user release mouse button when dragging the overlay window - - this.Background = isAllowedEdit ? new SolidColorBrush(Color.FromArgb(1, 240, 240, 255)) : new SolidColorBrush(System.Windows.Media.Colors.Transparent); - } - - private void PanelCoorOverlay_Loaded(object sender, RoutedEventArgs e) - { - this.DataContext = _viewModel; - } - - private void PanelCoorOverlay_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) - { - if (!IsAllowedEdit) - return; - - if (this.Top is double.NaN || this.Left is double.NaN) - return; - - // Fixed broken window left/top coordinate for DPI Awareness Per Monitor - var handle = new WindowInteropHelper(this).Handle; - var rect = WindowActionManager.GetWindowRectangle(handle); - WindowLocationChanged?.Invoke(this, new System.Drawing.Point(rect.X + WINDOW_ADJUSTMENT, rect.Y + WINDOW_ADJUSTMENT)); - - if (_viewModel.Panel != null) - _viewModel.Panel.IsSelectedPanelSource = false; - } - - public void SetWindowCoor(int x, int y) - { - _xCoor = x; - _yCoor = y; - } - - private void Window_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) - { - if (!IsAllowedEdit) - return; - - if (IsEditingPanelLocation && e.LeftButton == System.Windows.Input.MouseButtonState.Pressed) - this.DragMove(); - } - - private void Window_Loaded(object sender, RoutedEventArgs e) - { - // Fixed broken window left/top coordinate for DPI Awareness Per Monitor - var handle = new WindowInteropHelper(this).Handle; - - WindowActionManager.MoveWindow(handle, _xCoor - WINDOW_ADJUSTMENT, _yCoor - WINDOW_ADJUSTMENT, Convert.ToInt32(this.Width), Convert.ToInt32(this.Height)); - WindowActionManager.ApplyAlwaysOnTop(handle, PanelType.PanelSourceWindow, true); - } - - private void Canvas_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) - { - if (!IsAllowedEdit) - return; - - if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed && _viewModel.Panel != null) - _viewModel.Panel.IsSelectedPanelSource = true; - } - } -} diff --git a/MainApp/Properties/PublishProfiles/FolderProfile.pubxml b/MainApp/Properties/PublishProfiles/FolderProfile.pubxml index 6aeccf1..18dfaa2 100644 --- a/MainApp/Properties/PublishProfiles/FolderProfile.pubxml +++ b/MainApp/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - Debug + Release x64 ..\..\..\publish\master FileSystem diff --git a/MainApp/Styles/ExpanderRotateAngleConverter.cs b/MainApp/Styles/ExpanderRotateAngleConverter.cs deleted file mode 100644 index b910656..0000000 --- a/MainApp/Styles/ExpanderRotateAngleConverter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; -using System.Windows.Data; - -namespace MSFSPopoutPanelManager.MainApp -{ - public class ExpanderRotateAngleConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - double factor = 1.0; - if (parameter is { } parameterValue) - { - if (!double.TryParse(parameterValue.ToString(), out factor)) - { - factor = 1.0; - } - } - return value switch - { - ExpandDirection.Left => 90 * factor, - ExpandDirection.Right => -90 * factor, - _ => 0 - }; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/MainApp/UserControl/Dialog/AddProfileDialog.xaml b/MainApp/UserControl/Dialog/AddProfileDialog.xaml deleted file mode 100644 index 4fa2652..0000000 --- a/MainApp/UserControl/Dialog/AddProfileDialog.xaml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MainApp/UserControl/Dialog/AddProfileDialog.xaml.cs b/MainApp/UserControl/Dialog/AddProfileDialog.xaml.cs deleted file mode 100644 index 03208ab..0000000 --- a/MainApp/UserControl/Dialog/AddProfileDialog.xaml.cs +++ /dev/null @@ -1,26 +0,0 @@ -using MaterialDesignThemes.Wpf; -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using System; -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class AddProfileDialog : UserControl - { - public AddProfileViewModel ViewModel { get; set; } - - public AddProfileDialog() - { - ViewModel = App.AppHost.Services.GetRequiredService(); - InitializeComponent(); - Loaded += (sender, e) => - { - DataContext = ViewModel; - BtnAccept.IsEnabled = false; - }; - } - - public DialogClosingEventHandler ClosingEventHandler { get { return ViewModel.ClosingEventHandler; } } - } -} diff --git a/MainApp/UserControl/Dialog/ConfirmationDialog.xaml b/MainApp/UserControl/Dialog/ConfirmationDialog.xaml deleted file mode 100644 index 6b05b5d..0000000 --- a/MainApp/UserControl/Dialog/ConfirmationDialog.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/MainApp/UserControl/Dialog/ConfirmationDialog.xaml.cs b/MainApp/UserControl/Dialog/ConfirmationDialog.xaml.cs deleted file mode 100644 index 5b2c6c8..0000000 --- a/MainApp/UserControl/Dialog/ConfirmationDialog.xaml.cs +++ /dev/null @@ -1,14 +0,0 @@ -using MSFSPopoutPanelManager.MainApp.ViewModel; -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class ConfirmationDialog : UserControl - { - public ConfirmationDialog(string content, string confirmButtonText) - { - InitializeComponent(); - DataContext = new ConfirmationViewModel(content, confirmButtonText); - } - } -} diff --git a/MainApp/UserControl/HelpDrawer.xaml b/MainApp/UserControl/HelpDrawer.xaml deleted file mode 100644 index 2bf66a4..0000000 --- a/MainApp/UserControl/HelpDrawer.xaml +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Keyboard Commands - - - - To configure a pop out panel, first click on the move and resize icon - - - for the panel. You can then use keyboard commands below to adjust pop out panel when the icon turns green. To end panel configuration using keyboard commands, just click the icon - - - again to end panel adjustment. - - Up Arrow - - Move panel up by 10 pixels - Down Arrow - - Move panel down by 10 pixels - Left Arrow - - Move panel left by 10 pixels - Right Arrow - - Move panel right by 10 pixels - - Shift + Up Arrow - - Move panel up by 1 pixel - Shift + Down Arrow - - Move panel down by 1 pixel - Shift + Left Arrow - - Move panel left by 1 pixel - Shift + Right Arrow - - Move panel right by 1 pixel - - Ctrl + Up Arrow - - Decrease height by 10 pixels - Ctrl + Down Arrow - - Increase height by 10 pixels - Ctrl + Left Arrow - - Decrease width by 10 pixels - Ctrl + Right Arrow - - Increase width by 10 pixels - - Shift + Ctrl + Up Arrow - - Decrease height by 1 pixel - Shift + Ctrl + Down Arrow - - Increase height by 1 pixel - Shift + Ctrl + Left Arrow - - Decrease width by 1 pixel - Shift + Ctrl + Right Arrow - - Increase width by 1 pixel - - - - - - - - - User Guide - - - - - - - - - - - - - - - - - - Download Latest Release - - - - - - - - - - - - - - - - - - Support - - - - - - - - - - - - - - - - - - - - - - - - - - - Always on Top - - - - - - Full Screen Mode - - - - - - Hide Title Bar - - - - - - Automatic Game Refocus - - - - - diff --git a/MainApp/UserControl/PopOutPanelCard.xaml.cs b/MainApp/UserControl/PopOutPanelCard.xaml.cs deleted file mode 100644 index 70bdb14..0000000 --- a/MainApp/UserControl/PopOutPanelCard.xaml.cs +++ /dev/null @@ -1,128 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.DomainModel.Profile; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Input; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class PopOutPanelCard : UserControl - { - private PopOutPanelCardViewModel _viewModel; - public static readonly DependencyProperty DataItemProperty = DependencyProperty.Register("DataItem", typeof(PanelConfig), typeof(PopOutPanelCard)); - - public PopOutPanelCard() - { - _viewModel = App.AppHost.Services.GetRequiredService(); - Loaded += (sender, e) => - { - _viewModel.DataItem = DataItem; - this.DataContext = _viewModel; - InitializeComponent(); - }; - } - - public PanelConfig DataItem - { - get { return (PanelConfig)GetValue(DataItemProperty); } - set { SetValue(DataItemProperty, value); } - } - - private void TextBox_KeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Enter) - { - Keyboard.ClearFocus(); - FocusManager.SetFocusedElement(FocusManager.GetFocusScope(RootExpander), RootExpander as IInputElement); - } - } - - private void TextBox_GotFocus(object sender, RoutedEventArgs e) - { - var txtBox = (TextBox)sender; - txtBox.Dispatcher.BeginInvoke(new Action(() => txtBox.SelectAll())); - } - - private void BtnUpDown_Click(object sender, RoutedEventArgs e) - { - var button = (Button)sender; - var buttonType = button.Name.Substring(9); - - var txtBox = this.FindName($"TxtBox{buttonType}") as TextBox; - if (txtBox != null) - txtBox.Dispatcher.BeginInvoke(new Action(() => txtBox.Focus())); - } - - private string _oldText; - - private void TxtBox_NumbersOnly(object sender, TextCompositionEventArgs e) - { - int result; - e.Handled = !(int.TryParse(e.Text, out result) || (e.Text.Trim() == "-")); - - if (!e.Handled) - _oldText = ((TextBox)sender).Text; - } - - private void TxtBox_NumbersOnlyTextChanged(object sender, TextChangedEventArgs e) - { - int result; - var txtBox = (TextBox)sender; - - if (String.IsNullOrEmpty(txtBox.Text)) - txtBox.Text = "0"; - else if (!(int.TryParse(txtBox.Text, out result) || (txtBox.Text.Trim() == "-"))) - { - txtBox.Text = _oldText; - } - } - - private void Data_SourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e) - { - string? param = null; - - if (sender is PanelConfigField) - param = ((PanelConfigField)sender).BindingPath; - else if (sender is ToggleButton) - param = ((ToggleButton)sender).Name.Substring(6); - else if (sender is TextBox) - param = ((TextBox)sender).Name.Substring(6); - - if (!String.IsNullOrEmpty(param)) - _viewModel.PanelAttributeUpdatedCommand.Execute(param); - } - - private void PanelSourceIcon_PreviewMouseDown(object sender, MouseButtonEventArgs e) - { - if (e.LeftButton == MouseButtonState.Pressed && _viewModel.DataItem != null && _viewModel.ProfileData.ActiveProfile.IsEditingPanelSource) - _viewModel.DataItem.IsShownPanelSource = true; - } - - private void PanelSourceIcon_PreviewMouseUp(object sender, MouseButtonEventArgs e) - { - if (e.LeftButton == MouseButtonState.Released && _viewModel.DataItem != null && _viewModel.ProfileData.ActiveProfile.IsEditingPanelSource) - _viewModel.DataItem.IsShownPanelSource = false; - } - } - - public class CustomTextBox : TextBox - { - static CustomTextBox() - { - TextProperty.OverrideMetadata(typeof(CustomTextBox), new FrameworkPropertyMetadata(null, null, CoerceChanged)); - } - - private static object CoerceChanged(DependencyObject d, object basevalue) - { - TextBox? txtBox = d as TextBox; - if (txtBox != null && basevalue == null) - { - return txtBox.Text; - } - return basevalue; - } - } -} diff --git a/MainApp/UserControl/PopOutPanelCard/EditPanelSourceButton.xaml b/MainApp/UserControl/PopOutPanelCard/EditPanelSourceButton.xaml deleted file mode 100644 index d944731..0000000 --- a/MainApp/UserControl/PopOutPanelCard/EditPanelSourceButton.xaml +++ /dev/null @@ -1,24 +0,0 @@ - - - 22 - 28 - - - - - diff --git a/MainApp/UserControl/PopOutPanelCard/EditPanelSourceButton.xaml.cs b/MainApp/UserControl/PopOutPanelCard/EditPanelSourceButton.xaml.cs deleted file mode 100644 index ed0110e..0000000 --- a/MainApp/UserControl/PopOutPanelCard/EditPanelSourceButton.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class EditPanelSourceButton : UserControl - { - public EditPanelSourceButton() - { - InitializeComponent(); - } - } -} diff --git a/MainApp/UserControl/PopOutPanelCard/MoveAndResizePanelButton.xaml b/MainApp/UserControl/PopOutPanelCard/MoveAndResizePanelButton.xaml deleted file mode 100644 index c6bf266..0000000 --- a/MainApp/UserControl/PopOutPanelCard/MoveAndResizePanelButton.xaml +++ /dev/null @@ -1,38 +0,0 @@ - - - 22 - 28 - - - - - - - - diff --git a/MainApp/UserControl/PopOutPanelCard/MoveAndResizePanelButton.xaml.cs b/MainApp/UserControl/PopOutPanelCard/MoveAndResizePanelButton.xaml.cs deleted file mode 100644 index 76bc166..0000000 --- a/MainApp/UserControl/PopOutPanelCard/MoveAndResizePanelButton.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class MoveAndResizePanelButton : UserControl - { - public MoveAndResizePanelButton() - { - InitializeComponent(); - } - } -} diff --git a/MainApp/UserControl/PopOutPanelCard/MoveUpDownButton.xaml b/MainApp/UserControl/PopOutPanelCard/MoveUpDownButton.xaml deleted file mode 100644 index aa170b6..0000000 --- a/MainApp/UserControl/PopOutPanelCard/MoveUpDownButton.xaml +++ /dev/null @@ -1,51 +0,0 @@ - - - 14 - 22 - - - - - - - - - - diff --git a/MainApp/UserControl/PopOutPanelCard/MoveUpDownButton.xaml.cs b/MainApp/UserControl/PopOutPanelCard/MoveUpDownButton.xaml.cs deleted file mode 100644 index d3fdbe5..0000000 --- a/MainApp/UserControl/PopOutPanelCard/MoveUpDownButton.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class MoveUpDownButton : UserControl - { - public MoveUpDownButton() - { - InitializeComponent(); - } - } -} diff --git a/MainApp/UserControl/PopOutPanelCard/PanelConfigField.xaml b/MainApp/UserControl/PopOutPanelCard/PanelConfigField.xaml deleted file mode 100644 index e04c239..0000000 --- a/MainApp/UserControl/PopOutPanelCard/PanelConfigField.xaml +++ /dev/null @@ -1,148 +0,0 @@ - - - 14 - 22 - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MainApp/UserControl/PopOutPanelCard/PanelConfigField.xaml.cs b/MainApp/UserControl/PopOutPanelCard/PanelConfigField.xaml.cs deleted file mode 100644 index e84464c..0000000 --- a/MainApp/UserControl/PopOutPanelCard/PanelConfigField.xaml.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.DomainModel.Profile; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Input; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class PanelConfigField : UserControl - { - private PanelConfigFieldViewModel _viewModel; - - public static readonly DependencyProperty DataItemProperty = DependencyProperty.Register("DataItem", typeof(PanelConfig), typeof(PanelConfigField)); - public static readonly DependencyProperty BindingPathProperty = DependencyProperty.Register("BindingPath", typeof(string), typeof(PanelConfigField)); - public static readonly RoutedEvent SourceUpdatedEvent = EventManager.RegisterRoutedEvent("SourceUpdatedEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(PanelConfigField)); - - public PanelConfigField() - { - _viewModel = App.AppHost.Services.GetRequiredService(); - Loaded += (sender, e) => - { - _viewModel.DataItem = DataItem; - _viewModel.BindingPath = BindingPath; - _viewModel.SourceUpdatedEvent = SourceUpdatedEvent; - this.DataContext = _viewModel; - InitializeComponent(); - - Binding binding = new Binding($"DataItem.{BindingPath}"); - binding.Mode = BindingMode.TwoWay; - binding.NotifyOnSourceUpdated = true; - TxtBoxData.SetBinding(TextBox.TextProperty, binding); - }; - } - - public PanelConfig DataItem - { - get { return (PanelConfig)GetValue(DataItemProperty); } - set { SetValue(DataItemProperty, value); } - } - - public string BindingPath - { - get { return (string)GetValue(BindingPathProperty); } - set { SetValue(BindingPathProperty, value); } - } - - private void TextBox_KeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Enter) - { - Keyboard.ClearFocus(); - FocusManager.SetFocusedElement(FocusManager.GetFocusScope(this.Parent), this.Parent as IInputElement); - } - } - - private void TextBox_GotFocus(object sender, RoutedEventArgs e) - { - TxtBoxData.Dispatcher.BeginInvoke(new Action(() => TxtBoxData.SelectAll())); - } - - private string _oldText; - - private void TxtBox_NumbersOnly(object sender, TextCompositionEventArgs e) - { - int result; - e.Handled = !(int.TryParse(e.Text, out result) || (e.Text.Trim() == "-")); - - if (!e.Handled) - _oldText = ((TextBox)sender).Text; - } - - private void TxtBox_NumbersOnlyTextChanged(object sender, TextChangedEventArgs e) - { - int result; - var txtBox = (TextBox)sender; - - if (String.IsNullOrEmpty(txtBox.Text)) - txtBox.Text = "0"; - else if (!(int.TryParse(txtBox.Text, out result) || (txtBox.Text.Trim() == "-"))) - { - txtBox.Text = _oldText; - } - } - - private void Data_SourceUpdated(object sender, DataTransferEventArgs e) - { - _viewModel.DataUpdatedCommand.Execute(null); - } - - private void BtnPopupBoxOpen_Click(object sender, RoutedEventArgs e) - { - PopupBoxAdjustment.IsPopupOpen = true; - } - - private void BtnPopupBoxClose_Click(object sender, RoutedEventArgs e) - { - PopupBoxAdjustment.IsPopupOpen = false; - } - } -} diff --git a/MainApp/UserControl/PopOutPanelCard/TouchEnabledButton.xaml b/MainApp/UserControl/PopOutPanelCard/TouchEnabledButton.xaml deleted file mode 100644 index c1c03d6..0000000 --- a/MainApp/UserControl/PopOutPanelCard/TouchEnabledButton.xaml +++ /dev/null @@ -1,38 +0,0 @@ - - - 22 - 28 - - - - - - - - diff --git a/MainApp/UserControl/PopOutPanelCard/TouchEnabledButton.xaml.cs b/MainApp/UserControl/PopOutPanelCard/TouchEnabledButton.xaml.cs deleted file mode 100644 index 6a5f604..0000000 --- a/MainApp/UserControl/PopOutPanelCard/TouchEnabledButton.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class TouchEnabledButton : UserControl - { - public TouchEnabledButton() - { - InitializeComponent(); - } - } -} diff --git a/MainApp/UserControl/PopOutPanelList.xaml b/MainApp/UserControl/PopOutPanelList.xaml deleted file mode 100644 index e2f23d3..0000000 --- a/MainApp/UserControl/PopOutPanelList.xaml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/MainApp/UserControl/PopOutPanelList.xaml.cs b/MainApp/UserControl/PopOutPanelList.xaml.cs deleted file mode 100644 index 7b0b65c..0000000 --- a/MainApp/UserControl/PopOutPanelList.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Globalization; -using System; -using System.Windows.Controls; -using System.Windows.Data; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class PopOutPanelList : UserControl - { - public PopOutPanelList() - { - InitializeComponent(); - } - } - - public class DummyConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return value; - } - } -} diff --git a/MainApp/UserControl/PopOutPanelListEmpty.xaml b/MainApp/UserControl/PopOutPanelListEmpty.xaml deleted file mode 100644 index 8978984..0000000 --- a/MainApp/UserControl/PopOutPanelListEmpty.xaml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - Click here to add - - - - Add pop out panels to aircraft profile - - - (by identifying instrumetation source panel location in the game) - - - diff --git a/MainApp/UserControl/PopOutPanelListEmpty.xaml.cs b/MainApp/UserControl/PopOutPanelListEmpty.xaml.cs deleted file mode 100644 index fda41c9..0000000 --- a/MainApp/UserControl/PopOutPanelListEmpty.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class PopOutPanelListEmpty : UserControl - { - public PopOutPanelListEmpty() - { - InitializeComponent(); - } - } -} diff --git a/MainApp/UserControl/PreferenceDrawer.xaml b/MainApp/UserControl/PreferenceDrawer.xaml deleted file mode 100644 index 0c9d181..0000000 --- a/MainApp/UserControl/PreferenceDrawer.xaml +++ /dev/null @@ -1,640 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Always on Top - - - - Pin the application on top of all open windows. - - - - Auto Start - - - - Enable auto start application when MSFS starts. This adds a XML config entry in EXE.xml file. - - - - Minimize to Tray - - - - Minimize the application to system tray. - - - - Start Minimized - - - - Start the application in minimized mode in system tray. - - - - Auto Close When Exiting MSFS - - - - Automatically close the application when exiting MSFS. - - - - Turbo Mode - - - - - WARNING! - This may not work for all PC. Enable turbo mode to pop out panels as fast as possible. If you have a fast PC, this will let Pop Out Panel Manager executes pop out much faster. - - - - Check for Update - - - - Enable check for application update through Github. - - - - - - - - Enable Auto Pop Out Panels - - - - Automatic pop out panels when an aircraft livery is bound to a profile. The following steps will be performed. - - - - 1. Detect flight start signal using SimConnect. - - - 2. Wait for cockpit view to appear before executing pop out panel sequence. - - - 3. If configured for profile on cold start, execute and detect instrumentation power on before executing pop out panel sequence. - - - - - Auto Pop Out Panel Delay - - - - - Amount of time in seconds to delay auto pop out panels from starting after ready to fly button has been pressed automatically. Extending this delay helps resolve auto pop out failure because cockpit has not been loaded completely yet on slower PC. - - - - - - - - - - Enable Auto Panning - - - - Enable automatic panning of cockpit view when popping out panels. Auto Panning remembers the custom cockpit camera angle you used when defining the locations of pop out panel. - - - - - - - - Configure key binding for saving and recalling of custom MSFS cockpit camera view when defining the locations of pop out panel. Requires binding keystroke to custom camera in MSFS control setting. (Default: Ctrl-Alt-0 to save and Alt-0 to load). - - - - - - Minimize Pop Out Panel Manager During Pop Out - - - - Minimize Pop Out Panel Manager during pop out process. - - - - Minimize Pop Out Panel Manager After Pop Out - - - - Minimize Pop Out Panel Manager after all panels have been popped out. - - - - Enable Active Pause - - - - Enable active pause when panels are being popped out. - - - - - Enable Return to Predefined Camera View After Pop Out - - - - Enable return to a predefined camera view after pop out. - - - - - - - - - - - - - - - - - - Enable Tracking of Panels When Profile Is Locked - - - - - Enable tracking of panels to allow panel to go back to its original location when move if the profile is locked. Disable this setting will allow panel to be moved when profile is locked - but the profile setting will be unchanged. With this setting disable, Pop Out Panel Manager will no longer detect pop out panel's movement when profile is locked which may save some CPU cycles. - - - - - - Enable Pop Out Progress Messages - - - - Enable display of pop out progress messages - - - - - Pop Out Title Bar Color Customization - - - - - Enable setting the color of title bar for pop out panel. The color is set in Hexidemical format of RGB color (RRGGBB). For example, black is "#000000" and white is "#FFFFFF". - - - - - - - - - - - Use Left Control + Right Control to Pop Out Panel - - - - - If your keyboard does not have a Right-Alt key to perform left click to pop out panel, you can map Left Ctrl + Right Ctrl in MSFS control setting to pop out - panel instead. For this feature to work, please map (CTRL + RIGHT CTRL) in Control Options => Miscellaneous => New UI Window Mode in the game - - - - - - - - - Refocus Game Window - - - - Automactically set focus back to game window after a period of inactivity when either clicking on a panel or touching a panel when touch feature is enabled. This will give you flight control back when using pop out panel to overcome the current MSFS limitation. This setting needs to be enabled for each profile and each pop out panel's automatic refocus setting to work. - - - - - Amount of time in seconds to wait for touch inactivity before input focus goes back to game window. - - - - - - - - - - Keyboard Shortcuts - - - - Enable using of keyboard shortcuts to control application. - - - - - - - - Configure key binding to initiate start pop out. - - - - - - - - - - Touch Down Touch Up Delay - - - - - Amount of time in milliseconds to delay touch down and then touch up event when operating touch enabled panel. If your touch is not registering consistently, increasing this value may help. - - - For panel display on direct connected touch monitor, 0 milliseconds work really well. - For panel display on a tablet using software such as Spacedesk, since there is higher latency for touch signal, increasing this value 5ms at a time may compensate for this latency. - - - - - - - - Auto Disable Track IR - - - - Automactically disable Track IR during panel selections and pop out process. Track IR will be re-enabled once these processes are completed. - - - - - - - - Auto Resize MSFS Game Window (Used with Windowed Display Mode only) - - - - - Enable automatic resize of MSFS game window when using Windowed Display Mode. When playing the game in Windowed Display Mode, this setting is used to resize game window to match original size - and location when panel profile was initially defined. When this setting is first checked, current game window size and location will also be saved automatically. - - - - - - - - diff --git a/MainApp/UserControl/PreferenceDrawer.xaml.cs b/MainApp/UserControl/PreferenceDrawer.xaml.cs deleted file mode 100644 index 9a7eb6f..0000000 --- a/MainApp/UserControl/PreferenceDrawer.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class PreferenceDrawer : UserControl - { - public PreferenceDrawer() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/MainApp/UserControl/ProfileCard.xaml b/MainApp/UserControl/ProfileCard.xaml deleted file mode 100644 index cbb4e37..0000000 --- a/MainApp/UserControl/ProfileCard.xaml +++ /dev/null @@ -1,461 +0,0 @@ - - - - 22 - 28 - 14 - 22 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Active Aircraft: - - - - - - - - - - - - - - - Power on is required to pop out panels on cold start (for G1000 based aircrafts ONLY if needed) - - - - - Include in-game menu bar panels for pop out management and touch screen support - - - - - - Add a HUD Bar - - - - - - - - Enable entire monitor display to have game refocus function when touch - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MainApp/UserControl/ProfileCardList.xaml.cs b/MainApp/UserControl/ProfileCardList.xaml.cs deleted file mode 100644 index 84c676d..0000000 --- a/MainApp/UserControl/ProfileCardList.xaml.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using System; -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class ProfileCardList : UserControl - { - private ProfileCardListViewModel _viewModel; - - public ProfileCardList() - { - _viewModel = App.AppHost.Services.GetRequiredService(); - InitializeComponent(); - Loaded += (sender, e) => - { - DataContext = _viewModel; - _viewModel.OnProfileSelected += (sender, e) => - { - PopupBoxFinder.StaysOpen = false; - PopupBoxFinder.IsPopupOpen = false; - }; - }; - } - - private void BtnPopupBoxFinder_Click(object sender, System.Windows.RoutedEventArgs e) - { - PopupBoxFinder.IsPopupOpen = !PopupBoxFinder.IsPopupOpen; - PopupBoxFinder.StaysOpen = PopupBoxFinder.IsPopupOpen; - - if (PopupBoxFinder.IsPopupOpen) - { - ComboBoxSearchProfile.Text = null; - ComboBoxSearchProfile.Focus(); - } - } - } -} diff --git a/MainApp/UserControl/TrayIcon.xaml b/MainApp/UserControl/TrayIcon.xaml deleted file mode 100644 index 7700cf1..0000000 --- a/MainApp/UserControl/TrayIcon.xaml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/MainApp/UserControl/TrayIcon.xaml.cs b/MainApp/UserControl/TrayIcon.xaml.cs deleted file mode 100644 index 99e5fd3..0000000 --- a/MainApp/UserControl/TrayIcon.xaml.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using MSFSPopoutPanelManager.MainApp.ViewModel; -using Prism.Commands; -using System; -using System.Windows; -using System.Windows.Controls; - -namespace MSFSPopoutPanelManager.MainApp -{ - public partial class TrayIcon : UserControl - { - // This command has to be here since it doesn't work in view model, window StateChanged never gets fire - public DelegateCommand RestoreWindowCommand => new DelegateCommand(() => { ((Window)((Border)((Grid)this.Parent).Parent).Parent).WindowState = WindowState.Normal; }, () => { return true; }); - - private TrayIconViewModel ViewModel { get; set; } - - public TrayIcon() - { - ViewModel = App.AppHost.Services.GetRequiredService(); - InitializeComponent(); - Loaded += (sender, e) => { DataContext = ViewModel; }; - - Tray.DoubleClickCommand = RestoreWindowCommand; - } - - private void MenuItem_Click(object sender, RoutedEventArgs e) - { - Tray.ContextMenu.IsOpen = true; - } - } -} diff --git a/MainApp/ViewModel/PopOutPanelCardViewModel.cs b/MainApp/ViewModel/PopOutPanelCardViewModel.cs deleted file mode 100644 index a8500a3..0000000 --- a/MainApp/ViewModel/PopOutPanelCardViewModel.cs +++ /dev/null @@ -1,232 +0,0 @@ -using MaterialDesignThemes.Wpf; -using MSFSPopoutPanelManager.DomainModel.Profile; -using MSFSPopoutPanelManager.Orchestration; -using MSFSPopoutPanelManager.WindowsAgent; -using Prism.Commands; -using System; -using System.Linq; -using System.Windows.Input; - -namespace MSFSPopoutPanelManager.MainApp.ViewModel -{ - public class PopOutPanelCardViewModel : BaseViewModel - { - public PanelConfig DataItem { get; set; } - - public ICommand MovePanelUpCommand { get; set; } - - public ICommand MovePanelDownCommand { get; set; } - - public ICommand DeletePanelCommand { get; set; } - - public ICommand AddPanelSourceLocationCommand { get; set; } - - public ICommand TouchEnabledCommand { get; set; } - - public ICommand MoveResizePanelCommand { get; set; } - - public DelegateCommand PanelAttributeUpdatedCommand { get; set; } - - public PopOutPanelCardViewModel(MainOrchestrator orchestrator) : base(orchestrator) - { - DataItem = new PanelConfig(); - - MovePanelUpCommand = new DelegateCommand(OnMovePanelUp, () => ProfileData.ActiveProfile != null && ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem) > 0) - .ObservesProperty(() => ProfileData.ActiveProfile) - .ObservesProperty(() => ProfileData.ActiveProfile.PanelConfigs) - .ObservesProperty(() => ProfileData.ActiveProfile.PanelConfigs.Count); - - MovePanelDownCommand = new DelegateCommand(OnMovePanelDown, () => ProfileData.ActiveProfile != null && ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem) < ProfileData.ActiveProfile.PanelConfigs.Count - 1) - .ObservesProperty(() => ProfileData.ActiveProfile) - .ObservesProperty(() => ProfileData.ActiveProfile.PanelConfigs) - .ObservesProperty(() => ProfileData.ActiveProfile.PanelConfigs.Count); - - AddPanelSourceLocationCommand = new DelegateCommand(OnAddPanelSourceLocation, () => ProfileData.ActiveProfile != null && FlightSimData.IsInCockpit) - .ObservesProperty(() => ProfileData.ActiveProfile) - .ObservesProperty(() => FlightSimData.IsInCockpit); - - MoveResizePanelCommand = new DelegateCommand(OnMoveResizePanel, () => ProfileData.ActiveProfile != null - && DataItem != null - && (ProfileData.ActiveProfile.CurrentMoveResizePanelId == DataItem.Id || ProfileData.ActiveProfile.CurrentMoveResizePanelId == Guid.Empty) - && FlightSimData.IsInCockpit - && DataItem.IsPopOutSuccess != null - && DataItem.PanelHandle != IntPtr.Zero - && !DataItem.FullScreen) - .ObservesProperty(() => ProfileData.ActiveProfile) - .ObservesProperty(() => ProfileData.ActiveProfile.CurrentMoveResizePanelId) - .ObservesProperty(() => FlightSimData.IsInCockpit) - .ObservesProperty(() => DataItem.IsPopOutSuccess) - .ObservesProperty(() => DataItem.PanelHandle) - .ObservesProperty(() => DataItem.FullScreen); - - TouchEnabledCommand = new DelegateCommand(OnTouchEnabled, () => ProfileData.ActiveProfile != null) - .ObservesProperty(() => ProfileData.ActiveProfile); - - DeletePanelCommand = new DelegateCommand(OnDeletePanel); - PanelAttributeUpdatedCommand = new DelegateCommand(OnPanelAttributeUpdated); - - IsEnabledEditPanelSource = true; - } - - public int DataItemIndex => ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem); - - public int DataItemsMaxIndex => ProfileData.ActiveProfile.PanelConfigs.Count - 1; - - public bool IsEnabledEditPanelSource { get; set; } - - public bool IsErrorPanel => DataItem.IsPopOutSuccess != null && !(bool)DataItem.IsPopOutSuccess; - - private void OnMovePanelUp() - { - var index = ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem); - ProfileData.ActiveProfile.PanelConfigs.Insert(index - 1, DataItem); - ProfileData.ActiveProfile.PanelConfigs.RemoveAt(index + 1); - } - - private void OnMovePanelDown() - { - var index = ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem); - ProfileData.ActiveProfile.PanelConfigs.Insert(index + 2, DataItem); - ProfileData.ActiveProfile.PanelConfigs.RemoveAt(index); - } - - private async void OnDeletePanel() - { - var result = await DialogHost.Show(new ConfirmationDialog("Are you sure you want to delete the panel?", "Delete"), "RootDialog"); - - if (result != null && result.Equals("CONFIRM")) - Orchestrator.PanelSource.RemovePanelSource(DataItem); - - if (ProfileData.ActiveProfile.PanelConfigs.Where(p => p.PanelType == PanelType.CustomPopout).Count() == 0 && ProfileData.ActiveProfile.IsEditingPanelSource) - ProfileData.ActiveProfile.IsEditingPanelSource = false; - } - - private void OnTouchEnabled() - { - if (DataItem != null) - Orchestrator.PanelConfiguration.PanelConfigPropertyUpdated(DataItem.PanelHandle, PanelConfigPropertyName.TouchEnabled); - } - - private void OnPanelAttributeUpdated(string? commandParameter) - { - if (DataItem != null && commandParameter != null) - Orchestrator.PanelConfiguration.PanelConfigPropertyUpdated(DataItem.PanelHandle, (PanelConfigPropertyName)Enum.Parse(typeof(PanelConfigPropertyName), commandParameter)); - } - - private async void OnAddPanelSourceLocation() - { - Orchestrator.PanelSource.StartPanelSelectionEvent(); - - DataItem.IsSelectedPanelSource = true; - if (!ProfileData.ActiveProfile.IsEditingPanelSource) - await Orchestrator.PanelSource.StartEditPanelSources(); - - Orchestrator.PanelSource.StartPanelSelection(DataItem); - } - - private void OnMoveResizePanel() - { - if (DataItem.IsEditingPanel) - { - ProfileData.ActiveProfile.CurrentMoveResizePanelId = DataItem.Id; - - if (!AppSettingData.ApplicationSetting.KeyboardShortcutSetting.IsEnabled) - InputHookManager.StartKeyboardHook(); - - InputHookManager.OnKeyUp -= HandleKeyUpEvent; - InputHookManager.OnKeyUp += HandleKeyUpEvent; - } - else - { - ProfileData.ActiveProfile.CurrentMoveResizePanelId = Guid.Empty; - - if (!AppSettingData.ApplicationSetting.KeyboardShortcutSetting.IsEnabled) - InputHookManager.EndKeyboardHook(); - - InputHookManager.OnKeyUp -= HandleKeyUpEvent; - } - } - - private void HandleKeyUpEvent(object sender, KeyUpEventArgs e) - { - PanelConfigPropertyName panelConfigPropertyName = PanelConfigPropertyName.None; - - if (e.IsHoldControl) - e.KeyCode = $"CTRL+{e.KeyCode}"; - - if (e.IsHoldShift) - e.KeyCode = $"SHFT+{e.KeyCode}"; - - switch (e.KeyCode.ToUpper()) - { - case "UP": - panelConfigPropertyName = PanelConfigPropertyName.Top; - DataItem.Top -= 10; - break; - case "DOWN": - panelConfigPropertyName = PanelConfigPropertyName.Top; - DataItem.Top += 10; - break; - case "LEFT": - panelConfigPropertyName = PanelConfigPropertyName.Left; - DataItem.Left -= 10; - break; - case "RIGHT": - panelConfigPropertyName = PanelConfigPropertyName.Left; - DataItem.Left += 10; - break; - case "SHFT+UP": - panelConfigPropertyName = PanelConfigPropertyName.Top; - DataItem.Top -= 1; - break; - case "SHFT+DOWN": - panelConfigPropertyName = PanelConfigPropertyName.Top; - DataItem.Top += 1; - break; - case "SHFT+LEFT": - panelConfigPropertyName = PanelConfigPropertyName.Left; - DataItem.Left -= 1; - break; - case "SHFT+RIGHT": - panelConfigPropertyName = PanelConfigPropertyName.Left; - DataItem.Left += 1; - break; - case "CTRL+UP": - panelConfigPropertyName = PanelConfigPropertyName.Height; - DataItem.Height -= 10; - break; - case "CTRL+DOWN": - panelConfigPropertyName = PanelConfigPropertyName.Height; - DataItem.Height += 10; - break; - case "CTRL+LEFT": - panelConfigPropertyName = PanelConfigPropertyName.Width; - DataItem.Width -= 10; - break; - case "CTRL+RIGHT": - panelConfigPropertyName = PanelConfigPropertyName.Width; - DataItem.Width += 10; - break; - case "SHFT+CTRL+UP": - panelConfigPropertyName = PanelConfigPropertyName.Height; - DataItem.Height -= 1; - break; - case "SHFT+CTRL+DOWN": - panelConfigPropertyName = PanelConfigPropertyName.Height; - DataItem.Height += 1; - break; - case "SHFT+CTRL+LEFT": - panelConfigPropertyName = PanelConfigPropertyName.Width; - DataItem.Width -= 1; - break; - case "SHFT+CTRL+RIGHT": - panelConfigPropertyName = PanelConfigPropertyName.Width; - DataItem.Width += 1; - break; - } - - if (panelConfigPropertyName != PanelConfigPropertyName.None) - Orchestrator.PanelConfiguration.PanelConfigPropertyUpdated(DataItem.PanelHandle, panelConfigPropertyName); - } - } -} diff --git a/MainApp/ViewModel/PopOutPanelSourceCardViewModel.cs b/MainApp/ViewModel/PopOutPanelSourceCardViewModel.cs index 48b7c96..405fa14 100644 --- a/MainApp/ViewModel/PopOutPanelSourceCardViewModel.cs +++ b/MainApp/ViewModel/PopOutPanelSourceCardViewModel.cs @@ -54,8 +54,6 @@ namespace MSFSPopoutPanelManager.MainApp.ViewModel _panelSourceOrchestrator.StartPanelSelectionEvent(); - DataItem.IsSelectedPanelSource = true; - _panelSourceOrchestrator.StartPanelSelection(DataItem); } diff --git a/Orchestration/MainOrchestrator.cs b/Orchestration/MainOrchestrator.cs deleted file mode 100644 index 4e21156..0000000 --- a/Orchestration/MainOrchestrator.cs +++ /dev/null @@ -1,108 +0,0 @@ -using AutoUpdaterDotNET; -using MSFSPopoutPanelManager.Shared; -using MSFSPopoutPanelManager.WindowsAgent; -using System; -using System.IO; -using System.Threading.Tasks; -using System.Windows; - -namespace MSFSPopoutPanelManager.Orchestration -{ - public class MainOrchestrator : ObservableObject - { - public MainOrchestrator() - { - AppSettingData = new AppSettingData(); - ProfileData = new ProfileData(); - FlightSimData = new FlightSimData(); - ProfileData.FlightSimDataRef = FlightSimData; - ProfileData.AppSettingDataRef = AppSettingData; - FlightSimData.ProfileDataRef = ProfileData; - - Profile = new ProfileOrchestrator(ProfileData, FlightSimData); - PanelSource = new PanelSourceOrchestrator(ProfileData, AppSettingData, FlightSimData); - PanelPopOut = new PanelPopOutOrchestrator(ProfileData, AppSettingData, FlightSimData); - PanelConfiguration = new PanelConfigurationOrchestrator(ProfileData, AppSettingData, FlightSimData); - FlightSim = new FlightSimOrchestrator(ProfileData, AppSettingData, FlightSimData); - Help = new HelpOrchestrator(); - Keyboard = new KeyboardOrchestrator(AppSettingData, FlightSimData); - - PanelSource.FlightSimOrchestrator = FlightSim; - - PanelPopOut.FlightSimOrchestrator = FlightSim; - PanelPopOut.PanelSourceOrchestrator = PanelSource; - PanelPopOut.PanelConfigurationOrchestrator = PanelConfiguration; - - FlightSim.PanelPopOutOrchestrator = PanelPopOut; - FlightSim.PanelConfigurationOrchestrator = PanelConfiguration; - FlightSim.OnSimulatorExited += (sender, e) => { ApplicationClose(); Environment.Exit(0); }; - - Keyboard.PanelPopOutOrchestrator = PanelPopOut; - - // Delete all existing cache version of app - Help.DeleteAppCache(); - } - - public ProfileOrchestrator Profile { get; set; } - - public PanelSourceOrchestrator PanelSource { get; set; } - - public PanelPopOutOrchestrator PanelPopOut { get; set; } - - public PanelConfigurationOrchestrator PanelConfiguration { get; set; } - - public ProfileData ProfileData { get; set; } - - public AppSettingData AppSettingData { get; private set; } - - public FlightSimData FlightSimData { get; private set; } - - public FlightSimOrchestrator FlightSim { get; set; } - - public HelpOrchestrator Help { get; set; } - - public KeyboardOrchestrator Keyboard { get; set; } - - public IntPtr ApplicationHandle { get; set; } - - public Window ApplicationWindow { get; set; } - - public void Initialize() - { - AppSettingData.ReadSettings(); - ProfileData.ReadProfiles(); - - PanelSource.ApplicationHandle = ApplicationHandle; - - if (AppSettingData.ApplicationSetting.GeneralSetting.CheckForUpdate) - CheckForAutoUpdate(); - - ProfileData.SetActiveProfile(AppSettingData.ApplicationSetting.SystemSetting.LastUsedProfileId); // Load last used profile - - Task.Run(() => FlightSim.StartSimConnectServer()); // Start the SimConnect server - - Keyboard.Initialize(); - } - - public void ApplicationClose() - { - // Force unhook all win events - PanelConfiguration.EndConfiguration(); - PanelConfiguration.EndTouchHook(); - - InputHookManager.EndKeyboardHook(); - FlightSim.EndSimConnectServer(true); - } - - private void CheckForAutoUpdate() - { - string jsonPath = Path.Combine(Path.Combine(FileIo.GetUserDataFilePath(), "autoupdate.json")); - AutoUpdater.PersistenceProvider = new JsonFilePersistenceProvider(jsonPath); - AutoUpdater.Synchronous = true; - AutoUpdater.AppTitle = "MSFS Pop Out Panel Manager"; - AutoUpdater.RunUpdateAsAdmin = false; - AutoUpdater.UpdateFormSize = new System.Drawing.Size(1024, 660); - AutoUpdater.Start(AppSettingData.ApplicationSetting.SystemSetting.AutoUpdaterUrl); - } - } -} diff --git a/Orchestration/MigrateData.cs b/Orchestration/MigrateData.cs deleted file mode 100644 index b150900..0000000 --- a/Orchestration/MigrateData.cs +++ /dev/null @@ -1,199 +0,0 @@ -using MSFSPopoutPanelManager.DomainModel.Legacy; -using MSFSPopoutPanelManager.DomainModel.Profile; -using MSFSPopoutPanelManager.DomainModel.Setting; -using MSFSPopoutPanelManager.Shared; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace MSFSPopoutPanelManager.Orchestration -{ - internal class MigrateData - { - private const string USER_PROFILE_DATA_FILENAME = "userprofiledata.json"; - private const string APP_SETTING_DATA_FILENAME = "appsettingdata.json"; - private const string ERROR_LOG_FILENAME = "error.log"; - private const string INFO_LOG_FILENAME = "info.log"; - private const string DEBUG_LOG_FILENAME = "debug.log"; - - public static ApplicationSetting MigrateAppSettingFile(string content) - { - try - { - BackupAppSettingFile(); - - var appSetting = new ApplicationSetting(); - var legacyAppSetting = JsonConvert.DeserializeObject(content); - - // General settings - appSetting.GeneralSetting.AlwaysOnTop = legacyAppSetting.AlwaysOnTop; - appSetting.GeneralSetting.AutoClose = legacyAppSetting.AutoClose; - appSetting.GeneralSetting.MinimizeToTray = legacyAppSetting.MinimizeToTray; - appSetting.GeneralSetting.StartMinimized = legacyAppSetting.StartMinimized; - - // Auto pop out setting - appSetting.AutoPopOutSetting.IsEnabled = legacyAppSetting.AutoPopOutPanels; - - // Pop out setting - appSetting.PopOutSetting.UseLeftRightControlToPopOut = legacyAppSetting.UseLeftRightControlToPopOut; - appSetting.PopOutSetting.MinimizeAfterPopOut = legacyAppSetting.MinimizeAfterPopOut; - appSetting.PopOutSetting.AutoPanning.IsEnabled = legacyAppSetting.UseAutoPanning; - appSetting.PopOutSetting.AutoPanning.KeyBinding = legacyAppSetting.AutoPanningKeyBinding; - appSetting.PopOutSetting.AfterPopOutCameraView.IsEnabled = legacyAppSetting.AfterPopOutCameraView.EnableReturnToCameraView; - appSetting.PopOutSetting.AfterPopOutCameraView.CameraView = legacyAppSetting.AfterPopOutCameraView.CameraView; - appSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding = legacyAppSetting.AfterPopOutCameraView.CustomCameraKeyBinding; - - // Refocus setting - appSetting.RefocusSetting.RefocusGameWindow.IsEnabled = legacyAppSetting.TouchScreenSettings.RefocusGameWindow; - - var delay = Math.Round(legacyAppSetting.TouchScreenSettings.RefocusGameWindowDelay / 1000.0, 1); - appSetting.RefocusSetting.RefocusGameWindow.Delay = delay < 1.0 ? 1.0 : delay; - - // Touch setting - appSetting.TouchSetting.TouchDownUpDelay = 0; - - // Track IR setting - appSetting.TrackIRSetting.AutoDisableTrackIR = legacyAppSetting.AutoDisableTrackIR; - - // Windowed mode setting - appSetting.WindowedModeSetting.AutoResizeMsfsGameWindow = legacyAppSetting.AutoResizeMsfsGameWindow; - - return appSetting; - } - catch (Exception ex) - { - var msg = "An unknown application setting data migration error has occured. Application will close"; - FileLogger.WriteException(msg, ex); - - Environment.Exit(0); - } - - return null; - } - - public static IList MigrateUserProfileFile(string content) - { - try - { - BackupUserProfileFile(); - - var profiles = new List(); - var legacyProfiles = JsonConvert.DeserializeObject>(content); - legacyProfiles = legacyProfiles.OrderBy(p => p.ProfileName.ToLower()).ToList(); - - foreach (var legacyProfile in legacyProfiles) - { - var profile = new UserProfile(); - - profile.Name = legacyProfile.ProfileName; - profile.IsLocked = legacyProfile.IsLocked; - profile.AircraftBindings = legacyProfile.BindingAircrafts; - - profile.ProfileSetting.PowerOnRequiredForColdStart = legacyProfile.PowerOnRequiredForColdStart; - profile.ProfileSetting.IncludeInGamePanels = legacyProfile.IncludeInGamePanels; - - if (legacyProfile.MsfsGameWindowConfig != null) - { - profile.MsfsGameWindowConfig.Top = legacyProfile.MsfsGameWindowConfig.Top; - profile.MsfsGameWindowConfig.Left = legacyProfile.MsfsGameWindowConfig.Left; - profile.MsfsGameWindowConfig.Width = legacyProfile.MsfsGameWindowConfig.Width; - profile.MsfsGameWindowConfig.Height = legacyProfile.MsfsGameWindowConfig.Height; - } - - foreach (var legacyPanelConfig in legacyProfile.PanelConfigs) - { - var panelConfig = new PanelConfig(); - - panelConfig.PanelName = legacyPanelConfig.PanelName; - panelConfig.PanelType = legacyPanelConfig.PanelType; - - panelConfig.Top = legacyPanelConfig.Top; - panelConfig.Left = legacyPanelConfig.Left + 9; - panelConfig.Width = legacyPanelConfig.Width - 18; - panelConfig.Height = legacyPanelConfig.Height - 9; - - if (panelConfig.PanelType == PanelType.CustomPopout) - { - var legacyPanelSource = legacyProfile.PanelSourceCoordinates.FirstOrDefault(x => x.PanelIndex == legacyPanelConfig.PanelIndex); - - if (legacyPanelSource != null) - { - panelConfig.PanelSource.X = legacyPanelSource.X; - panelConfig.PanelSource.Y = legacyPanelSource.Y; - panelConfig.PanelSource.Color = PanelConfigColors.GetNextAvailableColor(profile.PanelConfigs.ToList()); - } - } - - panelConfig.AlwaysOnTop = legacyPanelConfig.AlwaysOnTop; - panelConfig.HideTitlebar = legacyPanelConfig.HideTitlebar; - panelConfig.FullScreen = legacyPanelConfig.FullScreen; - - if (legacyProfile.RealSimGearGTN750Gen1Override) - panelConfig.TouchEnabled = false; - else - panelConfig.TouchEnabled = legacyPanelConfig.TouchEnabled; - - if (legacyPanelConfig.DisableGameRefocus || panelConfig.PanelType == PanelType.BuiltInPopout) - panelConfig.AutoGameRefocus = false; - - profile.PanelConfigs.Add(panelConfig); - } - - profiles.Add(profile); - } - - return profiles; - } - catch (Exception ex) - { - var msg = "An unknown user data migration error has occured. Application will close"; - FileLogger.WriteException(msg, ex); - - Environment.Exit(0); - } - - return null; - } - - private static void BackupAppSettingFile() - { - var srcPath = Path.Combine(FileIo.GetUserDataFilePath(), APP_SETTING_DATA_FILENAME); - var backupPath = Path.Combine(FileIo.GetUserDataFilePath(), "Backup-previous-version", APP_SETTING_DATA_FILENAME); - - if (File.Exists(srcPath)) - { - Directory.CreateDirectory(Path.Combine(FileIo.GetUserDataFilePath(), "Backup-previous-version")); - File.Copy(srcPath, backupPath, true); - } - - // Delete existing error log - var logFilePath = Path.Combine(FileIo.GetUserDataFilePath(), "LogFiles", ERROR_LOG_FILENAME); - if (File.Exists(logFilePath)) - File.Delete(logFilePath); - - logFilePath = Path.Combine(FileIo.GetUserDataFilePath(), "LogFiles", INFO_LOG_FILENAME); - if (File.Exists(logFilePath)) - File.Delete(logFilePath); - - logFilePath = Path.Combine(FileIo.GetUserDataFilePath(), "LogFiles", DEBUG_LOG_FILENAME); - if (File.Exists(logFilePath)) - File.Delete(logFilePath); - - FileLogger.WriteLog("File initialized...", StatusMessageType.Error); - } - - private static void BackupUserProfileFile() - { - var srcPath = Path.Combine(FileIo.GetUserDataFilePath(), USER_PROFILE_DATA_FILENAME); - var backupPath = Path.Combine(FileIo.GetUserDataFilePath(), "Backup-previous-version", USER_PROFILE_DATA_FILENAME); - - if (File.Exists(srcPath)) - { - Directory.CreateDirectory(Path.Combine(FileIo.GetUserDataFilePath(), "Backup-previous-version")); - File.Copy(srcPath, backupPath, true); - } - } - } -} diff --git a/Orchestration/Orchestration.csproj b/Orchestration/Orchestration.csproj index 54e3e83..53d0ac9 100644 --- a/Orchestration/Orchestration.csproj +++ b/Orchestration/Orchestration.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Orchestration x64 - 4.0.4.1 - 4.0.4.1 - 4.0.4.1 + 4.1.0.1 + 4.1.0.1 + 4.1.0.1 win-x64 Embedded Debug;Release;Local diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 443af1e..1e5bdfc 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,19 +1,13 @@ -## Version 4.0.3 +## Version 4.1.0 -* Fixed rogue CPU issue when using touch feature in pop out panel which may cause computer to hang. +* Added new method to select panel source for an aircraft profile using fixed camera view instead of relying saved custom camera view. Previous method of using saved custom camera view is still available to use if desire. -* Added a new turbo mode to improve execution speed during pop out process. Turbo mode can be turned on in preferences => general settings. +Video showing how to create a new profile using the new panel selection method: https://vimeo.com/917361559 -* Added support for PMDG 737 EFB. +Video showing how to updae existing profile to use the new panel selection method: https://vimeo.com/917364912 -* Added please wait message when editing panel source to resolve the confusion that Pop Out Panel Manager seems to hang when trying to select panel source during creation of a new aircraft profile. +* Added new virtual number pad to be used for touch enabled screen. This number pad will first focus the game window before sending num pad keystroke to the game. -* Improved touch reliability when touch feature on pop out panel. +* Added a new button to easily close all Pop Out Panel Manager's managed pop outs. -* Removed pop out failure error message when after pop out predefined camera view has not been setup for an aircraft. - -* Update text color for pop out progress dialog. - -### KNOWN ISSUE: - -* For A2A Comanche PA-24-250, pop out step "Resetting camera view" does not work since this aircraft does not seem to implement SimConnect variable CAMERA_VIEW_TYPE_AND_INDEX:1 which Pop Out Panel Manager uses to reset camera view. +* Fixed few reported bugs in the application. \ No newline at end of file diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 15778aa..b5dfb8f 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Shared x64 - 4.0.4.1 - 4.0.4.1 - 4.0.4.1 + 4.1.0.1 + 4.1.0.1 + 4.1.0.1 win-x64 Embedded Debug;Release;Local diff --git a/Shared/StatusMessageEventArgs.cs b/Shared/StatusMessageEventArgs.cs deleted file mode 100644 index 43d3fab..0000000 --- a/Shared/StatusMessageEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace MSFSPopoutPanelManager.Shared -{ - public class StatusMessageEventArg : EventArgs - { - public StatusMessageEventArg(List messages) - { - Messages = messages; - } - - public List Messages { get; set; } - } - - public class StatusMessage - { - public StatusMessageType StatusMessageType { get; set; } - - public string Message { get; set; } - - public bool NewLine { get; set; } - } -} diff --git a/SimconnectAgent/SimconnectAgent.csproj b/SimconnectAgent/SimconnectAgent.csproj index ec111ad..0b53eea 100644 --- a/SimconnectAgent/SimconnectAgent.csproj +++ b/SimconnectAgent/SimconnectAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.SimConnectAgent x64 - 4.0.4.1 - 4.0.4.1 - 4.0.4.1 + 4.1.0.1 + 4.1.0.1 + 4.1.0.1 win-x64 Embedded Debug;Release;Local diff --git a/VERSION.md b/VERSION.md index 14d34d0..564758b 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,6 +1,20 @@ # Version History
+## Version 4.1.0 + +* Added new method to select panel source for an aircraft profile using fixed camera view instead of relying saved custom camera view. Previous method of using saved custom camera view is still available to use if desire. + +Video showing how to create a new profile using the new panel selection method: https://vimeo.com/917361559 + +Video showing how to updae existing profile to use the new panel selection method: https://vimeo.com/917364912 + +* Added new virtual number pad to be used for touch enabled screen. This number pad will first focus the game window before sending num pad keystroke to the game. + +* Added a new button to easily close all Pop Out Panel Manager's managed pop outs. + +* Fixed few outstanding bugs in the application. + ## Version 4.0.3 * Fixed rogue CPU issue when using touch feature in pop out panel which may cause computer to hang. diff --git a/WindowsAgent/WindowsAgent.csproj b/WindowsAgent/WindowsAgent.csproj index cced023..4631065 100644 --- a/WindowsAgent/WindowsAgent.csproj +++ b/WindowsAgent/WindowsAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.WindowsAgent x64 - 4.0.4.1 - 4.0.4.1 - 4.0.4.1 + 4.1.0.1 + 4.1.0.1 + 4.1.0.1 win-x64 Embedded Debug;Release;Local