public ParticularsViewModel() { ViewModelLocator.MainPageViewModel.PropertyChanged += new PropertyChangedEventHandler(this.MainPageViewModel_PropertyChanged); string loading = AppResources.Loading; AnalyziationSummarization summarization = new AnalyziationSummarization("/") { AmountInfo = loading, ScopeForSummary = SearchingScope.CurrentYear, Title = AppResources.YearlyMonthsIncomeExpenseAvgInfo.FormatWith(new object[] { string.Empty }).Trim() }; this.YearlyMonthsIncomeExpenseAvgInfo = summarization; AnalyziationSummarization summarization2 = new AnalyziationSummarization("/") { AmountInfo = loading, Title = AppResources.MonthlyWeeksExpenseAvgInfo.FormatWith(new object[] { AppResources.CurrentMonth }), ScopeForSummary = SearchingScope.CurrentMonth }; this.MonthlyWeeksExpenseAvgInfo = summarization2; AnalyziationSummarization summarization3 = new AnalyziationSummarization("/") { AmountInfo = loading, Title = AppResources.MonthlyTopNExpenses.FormatWith(new object[] { AppResources.CurrentMonth, 5 }), ScopeForSummary = SearchingScope.CurrentMonth }; this.MonthlyTopNExpenses = summarization3; this.totalInDebt = new AnalyziationSummarization("/"); this.totalLoanOut = new AnalyziationSummarization("/"); AnalyziationSummarization summarization4 = new AnalyziationSummarization("/") { ScopeForSummary = SearchingScope.CurrentMonth }; this.TotalTransaction = summarization4; string str2 = LocalizedStrings.CultureName.DateTimeFormat.AbbreviatedMonthNames[System.DateTime.Now.Month - 1]; string str3 = LocalizedStrings.CultureName.DateTimeFormat.AbbreviatedMonthNames[System.DateTime.Now.Month - 2]; this.MonthlyIncomExpenseChangesTitle = AppResources.MonthlyIncomExpenseChangesTitle.FormatWith(new object[] { str2, str3 }); this.MontlyDailyExpenseAmountTitle = AppResources.MontlyDailyExpenseAmount.FormatWith(new object[] { str2 }); this.PageTitle = "{0} - {1}".FormatWith(new object[] { str2, AppResources.Particulars }); }
private void appendLineToBuilder(System.Text.StringBuilder builder, string lineFormatter, AnalyziationSummarization summaryEntry) { AnalyziationSummaryEntry incomeSummaryEntry = summaryEntry.IncomeSummaryEntry; AnalyziationSummaryEntry expenseSummaryEntry = summaryEntry.ExpenseSummaryEntry; builder.AppendFormat(lineFormatter, new object[] { summaryEntry.Title, summaryEntry.TotalIncomeAmountInfo, summaryEntry.Spliter, summaryEntry.TotalExpenseAmountInfo }); if (summaryEntry.ShowCompareInfo) { builder.AppendFormat("{0}{1}\t\t\t({2}{3}/{4}{5})", new object[] { LocalizedStrings.GetLanguageInfoByKey("CompareTo"), LocalizedStrings.GetLanguageInfoByKey(summaryEntry.ScopeForSummary.ToString()), incomeSummaryEntry.ComparationInfo.BalanceMovingSymbol, incomeSummaryEntry.ComparationInfo.AmountInfo, expenseSummaryEntry.ComparationInfo.BalanceMovingSymbol, expenseSummaryEntry.ComparationInfo.AmountInfo }).AppendLine().AppendLine(); } }
private void InitializeSummaryEntry() { AnalyziationSummarization summarization = new AnalyziationSummarization("/") { Title = AppResources.Today, ShowCompareInfo = false, TotalExpenseAmount = 0M, TotalIncomeAmount = 0M, IncomeAmountInfoVisibility = false }; this.TodaySummary = summarization; AnalyziationSummarization summarization2 = new AnalyziationSummarization("/") { Title = AppResources.CurrentWeek, IncomeAmountInfoVisibility = false, ShowCompareInfo = true, TotalExpenseAmount = 0M, TotalIncomeAmount = 0M }; this.ThisWeekSummary = summarization2; this.ThisWeekSummary.ScopeForSummary = SearchingScope.LastWeek; AnalyziationSummarization summarization3 = new AnalyziationSummarization("/") { Title = AppResources.CurrentMonth, ShowCompareInfo = true, TotalExpenseAmount = 0M, TotalIncomeAmount = 0M }; this.ThisMonthSummary = summarization3; this.ThisMonthSummary.ScopeForSummary = SearchingScope.LastMonth; AnalyziationSummarization summarization4 = new AnalyziationSummarization("/") { Title = AppResources.CurrentYear, ShowCompareInfo = true, TotalExpenseAmount = 0M, TotalIncomeAmount = 0M }; this.ThisYearSummary = summarization4; this.ThisYearSummary.ScopeForSummary = SearchingScope.LastYear; AnalyziationSummarization summarization5 = new AnalyziationSummarization("/") { Title = AppResources.AllAvaliableAssets }; AccountItemMoney money = new AccountItemMoney { CurrencySymbolGetter = (cu, mo) => cu.GetGloableCurrencySymbol(new decimal?(mo)) }; summarization5.MoneyInfo = money; this.AccountInfoSummary = summarization5; AnalyziationSummarization summarization6 = new AnalyziationSummarization("/") { Title = AppResources.RecordsAmount }; this.AccountItemRecordsSummary = summarization6; // this._needToShowYearInfo = false;// System.DateTime.Now.Date.Month == 12; if (System.Diagnostics.Debugger.IsAttached) { this._needToShowYearInfo = true; } this.SummaryItemList.Add(this.TodaySummary); this.SummaryItemList.Add(this.ThisWeekSummary); this.SummaryItemList.Add(this.ThisMonthSummary); if (this._needToShowYearInfo) { this.SummaryItemList.Add(this.ThisYearSummary); } this.AccountMonthBudget = BudgetManager.Current.CurrentMonthBudgetSummary; this.AccountMonthBudget.Title = AppResources.MonthlyBudget; this.FavouritesItems = new ObservableCollection<AccountItem>(); }