diff --git a/Source/WPF/MyMoney/Charts/AnimatingBarChart.xaml.cs b/Source/WPF/MyMoney/Charts/AnimatingBarChart.xaml.cs index e8e46ae4..3d728e76 100644 --- a/Source/WPF/MyMoney/Charts/AnimatingBarChart.xaml.cs +++ b/Source/WPF/MyMoney/Charts/AnimatingBarChart.xaml.cs @@ -428,7 +428,7 @@ private Size CreateColumnInfos() var block = info.Label; if (block == null) { - block = new TextBlock() { Foreground = Foreground }; + block = new TextBlock() { Foreground = this.Foreground }; info.Label = block; } block.Text = item.Label; @@ -494,9 +494,9 @@ private Size AddAxisLabels(out AxisTickSpacer scale) } else { - label = new TextBlock() { Foreground = Foreground }; + label = new TextBlock() { Foreground = this.Foreground }; this.axisLabels.Add(label); - line = new Polygon() { Stroke = LineBrush, StrokeThickness = LineThickness, Points = new PointCollection() }; + line = new Polygon() { Stroke = this.LineBrush, StrokeThickness = this.LineThickness, Points = new PointCollection() }; this.axisLines.Add(line); } this.ChartCanvas.Children.Add(line); diff --git a/Source/WPF/MyMoney/Controls/Calculator/Parser.cs b/Source/WPF/MyMoney/Controls/Calculator/Parser.cs index 2ec45f44..c2ba2042 100644 --- a/Source/WPF/MyMoney/Controls/Calculator/Parser.cs +++ b/Source/WPF/MyMoney/Controls/Calculator/Parser.cs @@ -59,7 +59,7 @@ public double Parse(string expression) switch (token) { case Token.Number: - this.Shift(new Operation() { Token = Token.Number, Number = number }); + this.Shift(new Operation() { Token = Token.Number, Number = this.number }); this.state = 1; break; case Token.Plus: @@ -141,12 +141,12 @@ public double Parse(string expression) switch (token) { case Token.Number: - this.Shift(new Operation() { Token = Token.Number, Number = number }); + this.Shift(new Operation() { Token = Token.Number, Number = this.number }); this.ReduceUnaryOperator(); this.state = 1; break; case Token.LeftParen: - this.Shift(new Operation() { Token = Token.LeftParen, Number = number }); + this.Shift(new Operation() { Token = Token.LeftParen, Number = this.number }); this.state = 0; break; case Token.Dollar: @@ -161,7 +161,7 @@ public double Parse(string expression) switch (token) { case Token.Number: - this.Shift(new Operation() { Token = Token.Number, Number = number }); + this.Shift(new Operation() { Token = Token.Number, Number = this.number }); this.ReduceUnaryOperator(); this.state = 1; break; diff --git a/Source/WPF/MyMoney/Controls/SingleLineTextBlock.cs b/Source/WPF/MyMoney/Controls/SingleLineTextBlock.cs index 2b342151..d9b11fd5 100644 --- a/Source/WPF/MyMoney/Controls/SingleLineTextBlock.cs +++ b/Source/WPF/MyMoney/Controls/SingleLineTextBlock.cs @@ -188,16 +188,16 @@ private FormattedText GetFormattedText() this._properties = new TextProperties() { CultureInfo = CultureInfo.CurrentCulture, - FontFamily = FontFamily, - FontSize = FontSize, - FontStyle = FontStyle, - FontWeight = FontWeight, - FontStretch = FontStretch, - ForegroundBrush = Foreground, + FontFamily = this.FontFamily, + FontSize = this.FontSize, + FontStyle = this.FontStyle, + FontWeight = this.FontWeight, + FontStretch = this.FontStretch, + ForegroundBrush = this.Foreground, PixelsPerDip = VisualTreeHelper.GetDpi(this).PixelsPerDip, - FlowDirection = FlowDirection, - TextAlignment = TextAlignment, - VerticalAlignment = VerticalAlignment + FlowDirection = this.FlowDirection, + TextAlignment = this.TextAlignment, + VerticalAlignment = this.VerticalAlignment }; this._properties.Typeface = new Typeface(this._properties.FontFamily, this._properties.FontStyle, this._properties.FontWeight, this._properties.FontStretch); this._formatted = null; diff --git a/Source/WPF/MyMoney/Database/CostBasis.cs b/Source/WPF/MyMoney/Database/CostBasis.cs index 30524cc9..1af02231 100644 --- a/Source/WPF/MyMoney/Database/CostBasis.cs +++ b/Source/WPF/MyMoney/Database/CostBasis.cs @@ -83,10 +83,10 @@ internal SecuritySale Sell(DateTime date, decimal units, decimal unitSalePrice) return new SecuritySale() { DateSold = date, - Security = Security, - CostBasisPerUnit = CostBasisPerUnit, + Security = this.Security, + CostBasisPerUnit = this.CostBasisPerUnit, UnitsSold = canSell, - DateAcquired = DatePurchased, + DateAcquired = this.DatePurchased, SalePricePerUnit = unitSalePrice }; } @@ -227,7 +227,7 @@ public void Buy(DateTime datePurchased, decimal units, decimal costBasis) { SecurityPurchase sp = new SecurityPurchase() { - Security = Security, + Security = this.Security, DatePurchased = datePurchased, CostBasisPerUnit = costBasis / units, UnitsRemaining = units @@ -283,8 +283,8 @@ public IEnumerable Sell(DateTime dateSold, decimal units, decimal // Generate an error item so we can report this problem later. this.pending.Add(new SecuritySale() { - Security = Security, - Account = Account, + Security = this.Security, + Account = this.Account, DateSold = dateSold, UnitsSold = units, SalePricePerUnit = salePricePerUnit @@ -391,7 +391,7 @@ public void Buy(Security s, DateTime datePurchased, decimal units, decimal costB queue = new SecurityFifoQueue() { Security = s, - Account = Account + Account = this.Account }; this.queues[s] = queue; } @@ -417,7 +417,7 @@ public IEnumerable Sell(Security s, DateTime dateSold, decimal uni queue = new SecurityFifoQueue() { Security = s, - Account = Account + Account = this.Account }; this.queues[s] = queue; } @@ -532,7 +532,7 @@ public IList GetHoldingsBySecurityType(Predicate filter) SecurityGroup group = null; if (!result.TryGetValue(type, out group)) { - group = new SecurityGroup() { Date = toDate, Security = sp.Security, Type = type, Purchases = new List() }; + group = new SecurityGroup() { Date = this.toDate, Security = sp.Security, Type = type, Purchases = new List() }; result[type] = group; } else if (group.Security != sp.Security) @@ -563,7 +563,7 @@ public IList RegroupBySecurity(SecurityGroup groupByType) SecurityGroup group = null; if (!holdingsBySecurity.TryGetValue(s, out group)) { - group = new SecurityGroup() { Date = toDate, Security = s, Type = s.SecurityType, Purchases = new List() }; + group = new SecurityGroup() { Date = this.toDate, Security = s, Type = s.SecurityType, Purchases = new List() }; holdingsBySecurity[s] = group; } group.Purchases.Add(sp); diff --git a/Source/WPF/MyMoney/Database/Money.cs b/Source/WPF/MyMoney/Database/Money.cs index 3999d8be..aec046d5 100644 --- a/Source/WPF/MyMoney/Database/Money.cs +++ b/Source/WPF/MyMoney/Database/Money.cs @@ -3398,21 +3398,21 @@ public OnlineAccount ShallowCopy() // do NOT want to copy Parent or Id fields because this generates confusing change events. return new OnlineAccount() { - name = name, - institution = institution, - ofx = ofx, - fid = fid, - userid = userid, - password = password, - bankId = bankId, - brokerId = brokerId, - branchId = branchId, - ofxVersion = ofxVersion, - logoUrl = logoUrl, - appId = appId, - appVersion = appVersion, - sessionCookie = sessionCookie, - clientUid = clientUid + name = this.name, + institution = this.institution, + ofx = this.ofx, + fid = this.fid, + userid = this.userid, + password = this.password, + bankId = this.bankId, + brokerId = this.brokerId, + branchId = this.branchId, + ofxVersion = this.ofxVersion, + logoUrl = this.logoUrl, + appId = this.appId, + appVersion = this.appVersion, + sessionCookie = this.sessionCookie, + clientUid = this.clientUid }; } @@ -12432,7 +12432,7 @@ public bool Matches(QueryRow q) public Currency GetAccountCurrency() { - MyMoney money = this.Account.Parent.Parent as MyMoney; + MyMoney money = this.Account.Parent.Parent as MyMoney; if (money == null) { return Currencies.GetDefaultCurrency(); diff --git a/Source/WPF/MyMoney/Dialogs/MoneyFileImportDialog.xaml.cs b/Source/WPF/MyMoney/Dialogs/MoneyFileImportDialog.xaml.cs index da7ef611..e7d82a75 100644 --- a/Source/WPF/MyMoney/Dialogs/MoneyFileImportDialog.xaml.cs +++ b/Source/WPF/MyMoney/Dialogs/MoneyFileImportDialog.xaml.cs @@ -179,7 +179,7 @@ private void ImportMoneyFile(MyMoney newMoney, AttachmentManager newAttachments, { this.list.Add(new AccountImportState() { - Dispatcher = dispatcher, + Dispatcher = this.dispatcher, Account = acct, Name = acct.Name, }); diff --git a/Source/WPF/MyMoney/Dialogs/RenamePayeeDialog.xaml.cs b/Source/WPF/MyMoney/Dialogs/RenamePayeeDialog.xaml.cs index 64630712..7b2bb437 100644 --- a/Source/WPF/MyMoney/Dialogs/RenamePayeeDialog.xaml.cs +++ b/Source/WPF/MyMoney/Dialogs/RenamePayeeDialog.xaml.cs @@ -177,7 +177,7 @@ private void CheckConflicts() if (this.Alias) { AliasType atype = this.checkBoxUseRegex.IsChecked == true ? AliasType.Regex : AliasType.None; - Alias a = new Alias() { Pattern = Pattern, AliasType = atype }; + Alias a = new Alias() { Pattern = this.Pattern, AliasType = atype }; IEnumerable conflicts = this.money.FindSubsumedAliases(a); if (conflicts.Count() > 0) { diff --git a/Source/WPF/MyMoney/Dialogs/StockQuoteServiceDialog.xaml.cs b/Source/WPF/MyMoney/Dialogs/StockQuoteServiceDialog.xaml.cs index ad1b17e6..eb141aad 100644 --- a/Source/WPF/MyMoney/Dialogs/StockQuoteServiceDialog.xaml.cs +++ b/Source/WPF/MyMoney/Dialogs/StockQuoteServiceDialog.xaml.cs @@ -5,7 +5,6 @@ using System.Windows.Controls; using Walkabout.StockQuotes; using Walkabout.Utilities; -using static System.Runtime.InteropServices.JavaScript.JSType; namespace Walkabout.Dialogs { @@ -36,7 +35,7 @@ public StockQuoteManager StockQuoteManager } private void OnServiceSelected(object sender, SelectionChangedEventArgs e) { - if (!_initialized) + if (!this._initialized) { return; } @@ -60,7 +59,7 @@ private void OnServiceSelected(object sender, SelectionChangedEventArgs e) private void UpdateDialog() { - foreach (StockServiceSettings item in this.ComboServiceName.Items) + foreach (StockServiceSettings item in this.ComboServiceName.Items) { item.PropertyChanged -= this.OnSettingsChanged; } diff --git a/Source/WPF/MyMoney/MainWindow.xaml.cs b/Source/WPF/MyMoney/MainWindow.xaml.cs index f810cbf8..6e0b8255 100644 --- a/Source/WPF/MyMoney/MainWindow.xaml.cs +++ b/Source/WPF/MyMoney/MainWindow.xaml.cs @@ -2634,7 +2634,7 @@ private void HideBalancePanel(bool balanced, bool hasStatement) #region MANAGE VIEW - int ignoreViewChangeCount; + private int ignoreViewChangeCount; private void OnBeforeViewStateChanged(object sender, EventArgs e) { diff --git a/Source/WPF/MyMoney/Ofx/Ofx.cs b/Source/WPF/MyMoney/Ofx/Ofx.cs index 448c6931..26b1dc66 100644 --- a/Source/WPF/MyMoney/Ofx/Ofx.cs +++ b/Source/WPF/MyMoney/Ofx/Ofx.cs @@ -9,8 +9,6 @@ using System.Net.Http; using System.Net.Http.Headers; using System.Net.NetworkInformation; -using System.Runtime.CompilerServices; -using System.Security.Policy; using System.Text; using System.Text.RegularExpressions; using System.Threading; @@ -2917,11 +2915,11 @@ private void ProcessCurrency(XElement e, Account account, OfxDownloadData result Currency c = this.myMoney.Currencies.FindCurrencyOrDefault(account.NonNullCurrency); if (string.Compare(c.Name, symbol, StringComparison.OrdinalIgnoreCase) != 0) { - if (currencyErrors.Contains(symbol)) + if (this.currencyErrors.Contains(symbol)) { OfxDownloadData data = results.AddError(this.onlineAccount, account, $"Transaction with currency {symbol} doesn't match account currency {c.Name}"); data.LinkCaption = e.ToString(); - currencyErrors.Add(symbol); + this.currencyErrors.Add(symbol); } } } @@ -3858,7 +3856,7 @@ private void HandleChallenge(OFX ofx) this.OnError(new OfxException("Server returned unexpected response from MFA Challenge Request") { Root = ofx, - HelpLink = challengeLog + HelpLink = this.challengeLog }); } } diff --git a/Source/WPF/MyMoney/Reports/NetWorthReport.cs b/Source/WPF/MyMoney/Reports/NetWorthReport.cs index 3d06fdab..788e8316 100644 --- a/Source/WPF/MyMoney/Reports/NetWorthReport.cs +++ b/Source/WPF/MyMoney/Reports/NetWorthReport.cs @@ -108,7 +108,7 @@ public override async Task Generate(IReportWriter writer) Predicate bankAccountFilter = (a) => { return this.IsBankAccount(a); }; decimal balance = this.myMoney.GetCashBalanceNormalized(this.reportDate, bankAccountFilter); - var cashGroup = new AccountGroup() { Filter = bankAccountFilter, Date = reportDate, Title = "Bank Account" }; + var cashGroup = new AccountGroup() { Filter = bankAccountFilter, Date = this.reportDate, Title = "Bank Account" }; // Non-investment Cash var color = this.GetRandomColor(); @@ -121,7 +121,7 @@ public override async Task Generate(IReportWriter writer) balance = this.myMoney.GetCashBalanceNormalized(this.reportDate, investmentAccountFilter); if (balance != 0) { - var investmentCashGroup = new AccountGroup { Filter = investmentAccountFilter, Date = reportDate, Title = "Investment Account" }; + var investmentCashGroup = new AccountGroup { Filter = investmentAccountFilter, Date = this.reportDate, Title = "Investment Account" }; color = this.GetRandomColor(); data.Add(new ChartDataValue() { Label = "Investment Cash", Value = (double)balance.RoundToNearestCent(), Color = color, UserData = investmentCashGroup }); this.WriteRow(writer, color, "Investment Cash", balance, () => this.OnSelectCashGroup(investmentCashGroup)); @@ -133,7 +133,7 @@ public override async Task Generate(IReportWriter writer) balance = this.myMoney.GetCashBalanceNormalized(this.reportDate, taxDeferredAccountFilter); if (balance != 0) { - var taxDeferredCashGroup = new AccountGroup { Filter = taxDeferredAccountFilter, Date = reportDate, Title = "Tax-Deferred Account" }; + var taxDeferredCashGroup = new AccountGroup { Filter = taxDeferredAccountFilter, Date = this.reportDate, Title = "Tax-Deferred Account" }; color = this.GetRandomColor(); data.Add(new ChartDataValue() { Label = "Tax-Deferred Cash", Value = (double)balance.RoundToNearestCent(), Color = color, UserData = taxDeferredCashGroup }); this.WriteRow(writer, color, "Tax-Deferred Cash", balance, () => this.OnSelectCashGroup(taxDeferredCashGroup)); @@ -145,7 +145,7 @@ public override async Task Generate(IReportWriter writer) balance = this.myMoney.GetCashBalanceNormalized(this.reportDate, taxFreeAccountFilter); if (balance != 0) { - var taxFreeCashGroup = new AccountGroup { Filter = taxFreeAccountFilter, Date = reportDate, Title = "Tax-Free Account" }; + var taxFreeCashGroup = new AccountGroup { Filter = taxFreeAccountFilter, Date = this.reportDate, Title = "Tax-Free Account" }; color = this.GetRandomColor(); data.Add(new ChartDataValue() { Label = "Tax-Free Cash", Value = (double)balance.RoundToNearestCent(), Color = color, UserData = taxFreeCashGroup }); this.WriteRow(writer, color, "Tax-Free Cash", balance, () => this.OnSelectCashGroup(taxFreeCashGroup)); @@ -189,7 +189,7 @@ public override async Task Generate(IReportWriter writer) Predicate creditAccountFilter = (a) => a.Type == AccountType.Credit; balance = this.myMoney.GetCashBalanceNormalized(this.reportDate, creditAccountFilter); totalBalance += balance; - var creditGroup = new AccountGroup() { Filter = creditAccountFilter, Date = reportDate, Title = "Credit Accounts" }; + var creditGroup = new AccountGroup() { Filter = creditAccountFilter, Date = this.reportDate, Title = "Credit Accounts" }; color = this.GetRandomColor(); this.WriteRow(writer, color, "Credit", balance, () => this.OnSelectCashGroup(creditGroup)); totalBalance += this.WriteLoanAccountRows(writer, data, color, true); diff --git a/Source/WPF/MyMoney/StockQuotes/AlphaVantage.cs b/Source/WPF/MyMoney/StockQuotes/AlphaVantage.cs index 9f4c0371..8909a916 100644 --- a/Source/WPF/MyMoney/StockQuotes/AlphaVantage.cs +++ b/Source/WPF/MyMoney/StockQuotes/AlphaVantage.cs @@ -1,17 +1,12 @@ -using ModernWpf.Controls; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using System.Net; using System.Net.Http; -using System.Runtime.CompilerServices; using System.Text; -using System.Threading; using System.Threading.Tasks; -using static System.Data.Entity.Infrastructure.Design.Executor; namespace Walkabout.StockQuotes { diff --git a/Source/WPF/MyMoney/StockQuotes/IEXCloud.cs b/Source/WPF/MyMoney/StockQuotes/IEXCloud.cs index 96a83b04..014d7856 100644 --- a/Source/WPF/MyMoney/StockQuotes/IEXCloud.cs +++ b/Source/WPF/MyMoney/StockQuotes/IEXCloud.cs @@ -1,14 +1,8 @@ using Newtonsoft.Json.Linq; using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; using System.IO; -using System.Linq; -using System.Net; using System.Net.Http; using System.Text; -using System.Threading; using System.Threading.Tasks; namespace Walkabout.StockQuotes @@ -53,7 +47,7 @@ public static bool IsMySettings(StockServiceSettings settings) } protected override async Task DownloadThrottledQuoteAsync(string symbol) - { + { string uri = string.Format(stockQuoteAddress, symbol, this.Settings.ApiKey); HttpClient client = new HttpClient(); @@ -98,7 +92,7 @@ protected override async Task DownloadThrottledQuoteAsync(string sym public static StockQuote ParseStockQuote(JObject child) { // See https://iexcloud.io/docs/core/QUOTE - + var quote = new StockQuote() { Downloaded = DateTime.Now }; JToken value; if (child.TryGetValue("symbol", StringComparison.Ordinal, out value) && value.Type != JTokenType.Null) diff --git a/Source/WPF/MyMoney/StockQuotes/IStockQuoteService.cs b/Source/WPF/MyMoney/StockQuotes/IStockQuoteService.cs index be562cf5..60ff41cb 100644 --- a/Source/WPF/MyMoney/StockQuotes/IStockQuoteService.cs +++ b/Source/WPF/MyMoney/StockQuotes/IStockQuoteService.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Threading.Tasks; using System.Xml; -using System.Xml.Linq; using System.Xml.Serialization; using Walkabout.Utilities; diff --git a/Source/WPF/MyMoney/StockQuotes/Polygon.cs b/Source/WPF/MyMoney/StockQuotes/Polygon.cs index 5e8071b4..4e5fb799 100644 --- a/Source/WPF/MyMoney/StockQuotes/Polygon.cs +++ b/Source/WPF/MyMoney/StockQuotes/Polygon.cs @@ -1,16 +1,12 @@ using Newtonsoft.Json.Linq; using System; -using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Linq; using System.Net.Http; using System.Text; -using System.Threading; using System.Threading.Tasks; using System.Xml; -using System.Xml.Linq; using System.Xml.Serialization; namespace Walkabout.StockQuotes @@ -83,7 +79,7 @@ protected override async Task DownloadThrottledQuoteAsync(string sym using (StreamReader sr = new StreamReader(stm, Encoding.UTF8)) { string json = sr.ReadToEnd(); - JObject o = JObject.Parse(json); + JObject o = JObject.Parse(json); StockQuote quote = this.ParseStockQuote(o); if (quote == null || quote.Symbol == null) { @@ -102,7 +98,7 @@ protected override async Task DownloadThrottledQuoteAsync(string sym } } - private StockQuote ParseStockQuote(JObject child) + private StockQuote ParseStockQuote(JObject child) { // See https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__prev @@ -319,7 +315,7 @@ public static PolygonTickerInfo Load(string logFolder) { return (PolygonTickerInfo)s.Deserialize(r); } - } + } catch (Exception) { } diff --git a/Source/WPF/MyMoney/StockQuotes/StockQuoteManager.cs b/Source/WPF/MyMoney/StockQuotes/StockQuoteManager.cs index e6a7187a..d0f08b35 100644 --- a/Source/WPF/MyMoney/StockQuotes/StockQuoteManager.cs +++ b/Source/WPF/MyMoney/StockQuotes/StockQuoteManager.cs @@ -10,7 +10,6 @@ using System.Windows; using System.Windows.Documents; using System.Windows.Input; -using System.Windows.Media.Animation; using System.Xml; using System.Xml.Serialization; using Walkabout.Controls; @@ -677,7 +676,7 @@ internal async Task TestApiKeyAsync(StockServiceSettings settings) { return await service.TestApiKeyAsync(settings.ApiKey); } - return string.Empty; + return string.Empty; } } diff --git a/Source/WPF/MyMoney/StockQuotes/StockQuoteThrottle.cs b/Source/WPF/MyMoney/StockQuotes/StockQuoteThrottle.cs index 8a372b8a..19ba71c5 100644 --- a/Source/WPF/MyMoney/StockQuotes/StockQuoteThrottle.cs +++ b/Source/WPF/MyMoney/StockQuotes/StockQuoteThrottle.cs @@ -131,7 +131,7 @@ public void Save() public static StockQuoteThrottle Load(string filename) { try - { + { var fullPath = System.IO.Path.Combine(ProcessHelper.AppDataPath, filename); if (System.IO.File.Exists(fullPath)) { diff --git a/Source/WPF/MyMoney/StockQuotes/ThrottledStockQuoteService.cs b/Source/WPF/MyMoney/StockQuotes/ThrottledStockQuoteService.cs index 1c0518e9..e932dc04 100644 --- a/Source/WPF/MyMoney/StockQuotes/ThrottledStockQuoteService.cs +++ b/Source/WPF/MyMoney/StockQuotes/ThrottledStockQuoteService.cs @@ -1,12 +1,8 @@ -using Newtonsoft.Json.Linq; -using System; +using System; using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using System.Linq; -using System.Net.Http; using System.Net; -using System.Text; +using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -18,7 +14,7 @@ namespace Walkabout.StockQuotes /// internal class StockQuoteThrottledException : Exception { - public StockQuoteThrottledException(string msg): base(msg) { } + public StockQuoteThrottledException(string msg) : base(msg) { } } /// @@ -56,15 +52,15 @@ public ThrottledStockQuoteService(StockServiceSettings settings, string logPath) settings.Name = this.FriendlyName; this._settings = settings; - string filename = string.Format("{0}Throttle.xml", this.FriendlyName); - this._throttle = StockQuoteThrottle.Load(filename); + string filename = string.Format("{0}Throttle.xml", this.FriendlyName); + this._throttle = StockQuoteThrottle.Load(filename); this._throttle.Settings = settings; this._logPath = logPath; } - protected StockServiceSettings Settings => _settings; + protected StockServiceSettings Settings => this._settings; - protected CancellationTokenSource TokenSource => _source; + protected CancellationTokenSource TokenSource => this._source; public abstract string FriendlyName { get; } @@ -289,7 +285,7 @@ private async Task DownloadQuotes() if (ex != null) { - string message = string.Format(Walkabout.Properties.Resources.ErrorFetchingSymbols, symbol) + "\r\n" + ex.Message; + string message = string.Format(Walkabout.Properties.Resources.ErrorFetchingSymbols, symbol) + "\r\n" + ex.Message; lock (this._retry) { this._retry.Add(symbol); diff --git a/Source/WPF/MyMoney/View Selectors/AccountsControl.xaml.cs b/Source/WPF/MyMoney/View Selectors/AccountsControl.xaml.cs index 99c086ac..79066080 100644 --- a/Source/WPF/MyMoney/View Selectors/AccountsControl.xaml.cs +++ b/Source/WPF/MyMoney/View Selectors/AccountsControl.xaml.cs @@ -75,7 +75,7 @@ static AccountsControl() public DatabaseSettings DatabaseSettings { - get => databaseSettings; + get => this.databaseSettings; set { if (this.databaseSettings != null) @@ -98,9 +98,9 @@ private void OnDatabaseSettingsChanged(object sender, PropertyChangedEventArgs e private void UpdateShowCurrency() { - bool newValue = databaseSettings.ShowCurrency; + bool newValue = this.databaseSettings.ShowCurrency; // propagate to the view model. - foreach (var item in items) + foreach (var item in this.items) { item.ShowCurrency = newValue; } diff --git a/Source/WPF/MyMoney/View Selectors/CategoriesControl.xaml.cs b/Source/WPF/MyMoney/View Selectors/CategoriesControl.xaml.cs index 6574e0fc..081cfb7e 100644 --- a/Source/WPF/MyMoney/View Selectors/CategoriesControl.xaml.cs +++ b/Source/WPF/MyMoney/View Selectors/CategoriesControl.xaml.cs @@ -693,7 +693,7 @@ public void Delete() IList data = this.MyMoney.Transactions.GetTransactionsByCategory(c, null); if (data.Count > 0) { - var dialog = new MergeCategoryDialog() { Money = MyMoney, SourceCategory = c }; + var dialog = new MergeCategoryDialog() { Money = this.MyMoney, SourceCategory = c }; dialog.FontSize = this.FontSize; dialog.Owner = App.Current.MainWindow; dialog.Title = "Delete Category"; @@ -816,7 +816,7 @@ private FrameworkElement CreateDragVisual(Category c) visual.SetResourceReference(Window.ForegroundProperty, "SystemControlPageTextBaseHighBrush"); visual.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); visual.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); - var label = new TextBlock() { Text = c.Name, Margin = new Thickness(5), FontSize = FontSize, FontFamily = FontFamily }; + var label = new TextBlock() { Text = c.Name, Margin = new Thickness(5), FontSize = this.FontSize, FontFamily = this.FontFamily }; var swatch = new Border() { Margin = new Thickness(5), Width = 8, Height = 8, Background = new SolidColorBrush() { Color = ColorAndBrushGenerator.GenerateNamedColor(c.InheritedColor) } }; visual.Children.Add(label); visual.Children.Add(swatch); @@ -1081,7 +1081,7 @@ private void OnMergeCategory(object sender, ExecutedRoutedEventArgs e) Category c = this.Selected; if (c != null) { - var d = new MergeCategoryDialog() { Money = money, SourceCategory = c }; + var d = new MergeCategoryDialog() { Money = this.money, SourceCategory = c }; d.Owner = App.Current.MainWindow; d.FontSize = this.FontSize; if (d.ShowDialog() == true && d.SelectedCategory != null) diff --git a/Source/WPF/MyMoney/View Selectors/PayeesControl.xaml.cs b/Source/WPF/MyMoney/View Selectors/PayeesControl.xaml.cs index a466049f..740d6a48 100644 --- a/Source/WPF/MyMoney/View Selectors/PayeesControl.xaml.cs +++ b/Source/WPF/MyMoney/View Selectors/PayeesControl.xaml.cs @@ -175,7 +175,7 @@ private FrameworkElement CreateDragVisual(Payee p) Border visual = new Border(); visual.SetResourceReference(Window.BackgroundProperty, "SystemControlHighlightAccent3RevealBackgroundBrush"); visual.SetResourceReference(Window.ForegroundProperty, "SystemControlPageTextBaseHighBrush"); - var label = new TextBlock() { Text = p.Name, Margin = new Thickness(5), FontSize = FontSize, FontFamily = FontFamily }; + var label = new TextBlock() { Text = p.Name, Margin = new Thickness(5), FontSize = this.FontSize, FontFamily = this.FontFamily }; visual.Child = label; return visual; } diff --git a/Source/WPF/MyMoney/View Selectors/SecuritiesControl.xaml.cs b/Source/WPF/MyMoney/View Selectors/SecuritiesControl.xaml.cs index 86f45fd0..6933bef4 100644 --- a/Source/WPF/MyMoney/View Selectors/SecuritiesControl.xaml.cs +++ b/Source/WPF/MyMoney/View Selectors/SecuritiesControl.xaml.cs @@ -176,7 +176,7 @@ private FrameworkElement CreateDragVisual(Security s) Border visual = new Border(); visual.SetResourceReference(Window.BackgroundProperty, "SystemControlHighlightAccent3RevealBackgroundBrush"); visual.SetResourceReference(Window.ForegroundProperty, "SystemControlPageTextBaseHighBrush"); - var label = new TextBlock() { Text = s.Name, Margin = new Thickness(5), FontSize = FontSize, FontFamily = FontFamily }; + var label = new TextBlock() { Text = s.Name, Margin = new Thickness(5), FontSize = this.FontSize, FontFamily = this.FontFamily }; visual.Child = label; return visual; } diff --git a/Source/WPF/MyMoney/Views/SecuritiesView.xaml.cs b/Source/WPF/MyMoney/Views/SecuritiesView.xaml.cs index bd18879e..bc72217f 100644 --- a/Source/WPF/MyMoney/Views/SecuritiesView.xaml.cs +++ b/Source/WPF/MyMoney/Views/SecuritiesView.xaml.cs @@ -536,8 +536,8 @@ public ViewState ViewState SecuritiesViewState state = new SecuritiesViewState() { SelectedSecurity = name, - ViewAllSplits = ViewAllSplits, - ViewAllSecurities = ViewAllSecurities + ViewAllSplits = this.ViewAllSplits, + ViewAllSecurities = this.ViewAllSecurities }; int column = 0; diff --git a/Source/WPF/MyMoney/Views/TransactionsView.xaml.cs b/Source/WPF/MyMoney/Views/TransactionsView.xaml.cs index f567cac3..45762d94 100644 --- a/Source/WPF/MyMoney/Views/TransactionsView.xaml.cs +++ b/Source/WPF/MyMoney/Views/TransactionsView.xaml.cs @@ -1193,8 +1193,16 @@ private void OnDataGridRowDragOver(object sender, DragEventArgs e) private bool InvestmentsCanMerge(Investment i, Investment j) { - if (i == null) return j == null; - if (j == null) return i == null; + if (i == null) + { + return j == null; + } + + if (j == null) + { + return i == null; + } + if (i.Type == j.Type && i.SecurityName == j.SecurityName) { return Math.Round(i.Units, 2, MidpointRounding.AwayFromZero) == Math.Round(j.Units, 2, MidpointRounding.AwayFromZero); @@ -6223,7 +6231,7 @@ public TransactionPayeeCategoryMemoField(TransactionsView view, Binding payee, B BorderThickness = new Thickness(0, 0, 0, 1), BorderBrush = Brushes.Transparent, Focusable = false, - Child = payeeField + Child = this.payeeField }); this.Loaded += this.OnLoaded; @@ -6290,14 +6298,14 @@ private void CreateCategoryMemo(Binding category, Binding memo, object dataItem) BorderThickness = new Thickness(0, 0, 0, 1), BorderBrush = Brushes.Transparent, Focusable = false, - Child = categoryField + Child = this.categoryField }); this.Children.Add(new Border() { BorderThickness = new Thickness(0, 0, 0, 1), BorderBrush = Brushes.Transparent, Focusable = false, - Child = memoField + Child = this.memoField }); } } @@ -6874,7 +6882,7 @@ protected override FrameworkElement GenerateEditingElement(DataGridCell cell, ob VerticalAlignment = VerticalAlignment.Top, TextAlignment = TextAlignment.Right, Style = (Style)cell.FindResource("DefaultTextBoxStyle"), - Name = SortMemberPath + Name = this.SortMemberPath }; ModernWpf.Controls.Primitives.TextBoxHelper.SetIsEnabled(box, false); @@ -6942,7 +6950,7 @@ protected override FrameworkElement GenerateElement(DataGridCell cell, object da { TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Top, - Style = TextBlockStyle + Style = this.TextBlockStyle }; } diff --git a/Source/WPF/ScenarioTest/Wrappers/GridViewWrapper.cs b/Source/WPF/ScenarioTest/Wrappers/GridViewWrapper.cs index f9136979..1f9c1149 100644 --- a/Source/WPF/ScenarioTest/Wrappers/GridViewWrapper.cs +++ b/Source/WPF/ScenarioTest/Wrappers/GridViewWrapper.cs @@ -60,7 +60,7 @@ public bool HasSelection { SelectionPattern selection = (SelectionPattern)this.Control.GetCurrentPattern(SelectionPattern.Pattern); AutomationElement[] selected = selection.Current.GetSelection(); - return (selected == null || selected.Length > 0); + return selected == null || selected.Length > 0; } } diff --git a/Source/WPF/UnitTests/IEXCloudTests.cs b/Source/WPF/UnitTests/IEXCloudTests.cs index ae84eeef..f61223f9 100644 --- a/Source/WPF/UnitTests/IEXCloudTests.cs +++ b/Source/WPF/UnitTests/IEXCloudTests.cs @@ -1,8 +1,5 @@ using Newtonsoft.Json.Linq; using NUnit.Framework; -using System.Xml; -using Walkabout.Ofx; -using Walkabout.Sgml; using Walkabout.StockQuotes; namespace Walkabout.Tests