From 5bcb7a2b045f26fbb3a5586ca90fb52609473729 Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 10 Jun 2025 19:17:44 -0400 Subject: [PATCH] Code cleanup. --- PortfolioManager/ViewModels/CMMomentumViewModel.cs | 2 -- PortfolioManager/ViewModels/CMTrendViewModel.cs | 2 -- PortfolioManager/ViewModels/DialogViewModelBase.cs | 5 ----- PortfolioManager/ViewModels/MGSHMomentumViewModel.cs | 7 ------- PortfolioManager/ViewModels/MainWindowViewModel.cs | 3 --- PortfolioManager/ViewModels/ModelBase.cs | 1 - PortfolioManager/ViewModels/MomentumViewModel.cs | 2 -- 7 files changed, 22 deletions(-) diff --git a/PortfolioManager/ViewModels/CMMomentumViewModel.cs b/PortfolioManager/ViewModels/CMMomentumViewModel.cs index 8b5e73c..0811916 100644 --- a/PortfolioManager/ViewModels/CMMomentumViewModel.cs +++ b/PortfolioManager/ViewModels/CMMomentumViewModel.cs @@ -36,7 +36,6 @@ namespace PortfolioManager.ViewModels private NVPDictionary nvpDictionary = null; private String selectedParameter = null; private String pathFileName; - private String initialPath; private ModelPerformanceSeries modelPerformanceSeries = null; private ModelStatistics modelStatistics = null; private bool showAsGainLoss = true; @@ -449,7 +448,6 @@ namespace PortfolioManager.ViewModels try { if (!CMSessionManager.IsValidSessionFile(pathFileName)) return false; - initialPath = Path.GetDirectoryName(pathFileName); sessionParams = CMSessionManager.RestoreSession(pathFileName); if (null == sessionParams) { MxMessageBox.Show(GetTopLevelWindow(), String.Format("Unable to open {0}", pathFileName)); pathFileName = null; return false; } modelStatistics = CMMomentumBacktest.GetModelStatistics(sessionParams); diff --git a/PortfolioManager/ViewModels/CMTrendViewModel.cs b/PortfolioManager/ViewModels/CMTrendViewModel.cs index f14997a..3157148 100644 --- a/PortfolioManager/ViewModels/CMTrendViewModel.cs +++ b/PortfolioManager/ViewModels/CMTrendViewModel.cs @@ -39,7 +39,6 @@ namespace PortfolioManager.ViewModels private CMTPositionModel selectedPosition = null; private CMTParams configuration = null; private String pathFileName = null; - private String initialPath = null; private CMTSessionParams sessionParams; private NVPDictionary nvpDictionary = null; private ObservableCollection nvpDictionaryKeys = null; @@ -463,7 +462,6 @@ namespace PortfolioManager.ViewModels try { if (!CMTSessionManager.IsValidSessionFile(pathFileName)) return false; - initialPath = Path.GetDirectoryName(pathFileName); sessionParams = CMTSessionManager.RestoreSession(pathFileName); if (null == sessionParams) { diff --git a/PortfolioManager/ViewModels/DialogViewModelBase.cs b/PortfolioManager/ViewModels/DialogViewModelBase.cs index 5d1034a..48a3c37 100644 --- a/PortfolioManager/ViewModels/DialogViewModelBase.cs +++ b/PortfolioManager/ViewModels/DialogViewModelBase.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.ComponentModel; using Avalonia.Controls; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Input; using System.Threading.Tasks; namespace PortfolioManager.ViewModels diff --git a/PortfolioManager/ViewModels/MGSHMomentumViewModel.cs b/PortfolioManager/ViewModels/MGSHMomentumViewModel.cs index 489b687..8aa107c 100644 --- a/PortfolioManager/ViewModels/MGSHMomentumViewModel.cs +++ b/PortfolioManager/ViewModels/MGSHMomentumViewModel.cs @@ -2,19 +2,14 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; -using System.Configuration; using System.IO; using System.Linq; using System.Reactive.Linq; -using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using Avalonia.Controls; -using Avalonia.Input; -using Avalonia.Labs.Input; using Avalonia.Media; using Avalonia.Platform.Storage; -using Avalonia.Threading; using CommunityToolkit.Mvvm.Input; using Eremex.AvaloniaUI.Controls; using MarketData; @@ -36,7 +31,6 @@ namespace PortfolioManager.ViewModels { private ObservableCollection momentumCandidates = new ObservableCollection(); private MGSHSessionParams sessionParams; - private String initialPath = null; private MGSHPositionModelCollection positions = null; private ModelPerformanceSeries modelPerformanceSeries = null; private ModelStatistics modelStatistics = null; @@ -350,7 +344,6 @@ namespace PortfolioManager.ViewModels try { if (!MGSHSessionManager.IsValidSessionFile(pathFileName)) return false; - initialPath = Path.GetDirectoryName(pathFileName); sessionParams = MGSHSessionManager.RestoreSession(pathFileName); if (null == sessionParams) { diff --git a/PortfolioManager/ViewModels/MainWindowViewModel.cs b/PortfolioManager/ViewModels/MainWindowViewModel.cs index e08d4fa..f0a0014 100644 --- a/PortfolioManager/ViewModels/MainWindowViewModel.cs +++ b/PortfolioManager/ViewModels/MainWindowViewModel.cs @@ -2,13 +2,10 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Linq; using System.Text; -using System.Threading.Tasks; using Avalonia.Threading; using MarketData.Cache; using MarketData.DataAccess; -using MarketData.Utils; using PortfolioManager.Command; namespace PortfolioManager.ViewModels diff --git a/PortfolioManager/ViewModels/ModelBase.cs b/PortfolioManager/ViewModels/ModelBase.cs index 5fcea4f..7e3893a 100644 --- a/PortfolioManager/ViewModels/ModelBase.cs +++ b/PortfolioManager/ViewModels/ModelBase.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using Axiom.Utils; -using Eremex.AvaloniaUI.Controls; namespace PortfolioManager.ViewModels { diff --git a/PortfolioManager/ViewModels/MomentumViewModel.cs b/PortfolioManager/ViewModels/MomentumViewModel.cs index 732d16c..bfb293d 100644 --- a/PortfolioManager/ViewModels/MomentumViewModel.cs +++ b/PortfolioManager/ViewModels/MomentumViewModel.cs @@ -35,7 +35,6 @@ namespace PortfolioManager.ViewModels private NVPDictionary nvpDictionary = null; private String selectedParameter = null; private String pathFileName; - private String initialPath; private ModelPerformanceSeries modelPerformanceSeries = null; private ModelStatistics modelStatistics = null; private MGConfiguration configuration = null; @@ -455,7 +454,6 @@ namespace PortfolioManager.ViewModels pathFileName = null; return false; } - initialPath = Path.GetDirectoryName(pathFileName); sessionParams = MGSessionManager.RestoreSession(pathFileName); if (null == sessionParams) {