diff --git a/src/CalcViewModel/Common/DisplayExpressionToken.h b/src/CalcViewModel/Common/DisplayExpressionToken.h index 86aed75f..c53c4857 100644 --- a/src/CalcViewModel/Common/DisplayExpressionToken.h +++ b/src/CalcViewModel/Common/DisplayExpressionToken.h @@ -33,6 +33,7 @@ public OBSERVABLE_PROPERTY_RW(int, TokenPosition); OBSERVABLE_PROPERTY_RW(bool, IsTokenEditable); OBSERVABLE_PROPERTY_RW(int, CommandIndex); + OBSERVABLE_PROPERTY_RW(TokenType, Type); OBSERVABLE_PROPERTY_R(Platform::String ^, OriginalToken); property bool IsTokenInEditMode @@ -51,10 +52,6 @@ public } } - // CSHARP_MIGRATION: TODO: this property has been changed from Internal to Public - // double check if this change is reasonable - OBSERVABLE_PROPERTY_RW(TokenType, Type); - private: bool m_InEditMode; }; diff --git a/src/CalcViewModel/StandardCalculatorViewModel.h b/src/CalcViewModel/StandardCalculatorViewModel.h index edae788d..ac5e877b 100644 --- a/src/CalcViewModel/StandardCalculatorViewModel.h +++ b/src/CalcViewModel/StandardCalculatorViewModel.h @@ -245,13 +245,13 @@ namespace CalculatorApp void SendCommandToCalcManager(int command); public: - // CSHARP_MIGRATION: TODO: check if these still need to be internal - // Memory feature related methods. They are internal because they need to called from the MainPage code-behind + // Memory feature related methods. void OnMemoryButtonPressed(); void OnMemoryItemPressed(Platform::Object ^ memoryItemPosition); void OnMemoryAdd(Platform::Object ^ memoryItemPosition); void OnMemorySubtract(Platform::Object ^ memoryItemPosition); void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition); + void SelectHistoryItem(HistoryItemViewModel ^ item); void SwitchProgrammerModeBase(CalculatorApp::ViewModel::Common::NumberBase calculatorBase); void SetBitshiftRadioButtonCheckedAnnouncement(Platform::String ^ announcement); diff --git a/src/CalcViewModel/UnitConverterViewModel.h b/src/CalcViewModel/UnitConverterViewModel.h index 3e26f123..594742ec 100644 --- a/src/CalcViewModel/UnitConverterViewModel.h +++ b/src/CalcViewModel/UnitConverterViewModel.h @@ -75,7 +75,6 @@ namespace CalculatorApp return AccessibleName; } - // CSHARP_MIGRATION: TODO: public: bool IsModelUnitWhimsical() { @@ -87,10 +86,11 @@ namespace CalculatorApp return m_original.id; } - internal : const UnitConversionManager::Unit& GetModelUnit() const - { - return m_original; - } + internal: + const UnitConversionManager::Unit& GetModelUnit() const + { + return m_original; + } private: const UnitConversionManager::Unit m_original; @@ -98,23 +98,21 @@ namespace CalculatorApp [Windows::UI::Xaml::Data::Bindable] public ref class SupplementaryResult sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged { - internal : SupplementaryResult(Platform::String ^ value, Unit ^ unit) + internal: + SupplementaryResult(Platform::String ^ value, Unit ^ unit) : m_Value(value) , m_Unit(unit) { } - // CSHARP_MIGRATION: TODO: double check below method's accessor public: bool IsWhimsical() { return m_Unit->GetModelUnit().isWhimsical; } - public: Platform::String ^ GetLocalizedAutomationName(); - public: OBSERVABLE_OBJECT(); OBSERVABLE_PROPERTY_R(Platform::String ^, Value); diff --git a/src/Calculator/App.xaml.cs b/src/Calculator/App.xaml.cs index 79b7d038..ac0006f2 100644 --- a/src/Calculator/App.xaml.cs +++ b/src/Calculator/App.xaml.cs @@ -59,7 +59,6 @@ namespace CalculatorApp Suspending += OnSuspending; - // CSHARP_MIGRATION: TODO: #if DEBUG DebugSettings.IsBindingTracingEnabled = true; DebugSettings.BindingFailed += (sender, args) => @@ -399,20 +398,16 @@ namespace CalculatorApp private App m_parent; }; - // CSHARP_MIGRATION: TODO: check what is the pragma used for??? - //#pragma optimize("", off) // Turn off optimizations to work around coroutine optimization bug private async Task SetupJumpList() { try { - // CSHARP_MIGRATION: TODO: var calculatorOptions = NavCategoryGroup.CreateCalculatorCategory(); var jumpList = await JumpList.LoadCurrentAsync(); jumpList.SystemGroupKind = JumpListSystemGroupKind.None; jumpList.Items.Clear(); - // CSHARP_MIGRATION: TODO: foreach (NavCategory option in calculatorOptions.Categories) { if (!option.IsEnabled) diff --git a/src/Calculator/Common/KeyboardShortcuManager.cs b/src/Calculator/Common/KeyboardShortcuManager.cs index aebc0447..0f921318 100644 --- a/src/Calculator/Common/KeyboardShortcuManager.cs +++ b/src/Calculator/Common/KeyboardShortcuManager.cs @@ -617,7 +617,7 @@ namespace CalculatorApp } var buttons = EqualRange(lookupMap, (MyVirtualKey)key); - var navView = buttons.ElementAt(0).Target as MUXC.NavigationView; // CSHARP_MIGRATION: TODO: double check if button[0] exists + var navView = buttons.ElementAt(0).Target as MUXC.NavigationView; var appViewModel = (navView.DataContext as ApplicationViewModel); appViewModel.Mode = ViewMode.Date; var categoryName = AppResourceProvider.GetInstance().GetResourceString("DateCalculationModeText"); @@ -656,7 +656,7 @@ namespace CalculatorApp } var buttons = EqualRange(lookupMap, (MyVirtualKey)myVirtualKey); - if (buttons.Count() <= 0) // CSHARP_MIGRATION: TODO: double check if this is equivalent to `if (buttons.first == buttons.second)` + if (buttons.Count() <= 0) { return; } @@ -710,7 +710,7 @@ namespace CalculatorApp var item = itemRef.Target as MUXC.NavigationView; if (item != null) { - var navView = item as MUXC.NavigationView; // CSHARP_MIGRATION: TODO: check if this line is still needed + var navView = (MUXC.NavigationView)item; var menuItems = ((ObservableCollection)navView.MenuItemsSource); if (menuItems != null) diff --git a/src/Calculator/Views/Calculator.xaml.cs b/src/Calculator/Views/Calculator.xaml.cs index 00407246..6abc1b01 100644 --- a/src/Calculator/Views/Calculator.xaml.cs +++ b/src/Calculator/Views/Calculator.xaml.cs @@ -458,8 +458,6 @@ namespace CalculatorApp { ScientificAngleButtons.IsErrorVisualState = isError; } - // CSHARP_MIGRATION: TODO: - // ScientificAngleButtons works but ProgrammerDisplayPanel doesn't else if (IsProgrammer && ProgrammerDisplayPanel != null) { ProgrammerDisplayPanel.IsErrorVisualState = isError; diff --git a/src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cs b/src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cs index e327734f..22642be8 100644 --- a/src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cs +++ b/src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cs @@ -227,9 +227,6 @@ namespace CalculatorApp } m_updatingCheckedStates = true; - // CSHARP_MIGRATION: - // iterator and index move at the same time with same step - // add index validation in the loop int index = 0; bool mustUpdateTextOfMostSignificantDigits = m_currentValueBitLength != Model.ValueBitLength; int previousMSDPosition = GetIndexOfLastBit(m_currentValueBitLength); diff --git a/src/Calculator/Views/DateCalculator.xaml.cs b/src/Calculator/Views/DateCalculator.xaml.cs index 422453f6..8d2539c0 100644 --- a/src/Calculator/Views/DateCalculator.xaml.cs +++ b/src/Calculator/Views/DateCalculator.xaml.cs @@ -223,8 +223,6 @@ namespace CalculatorApp RaiseLiveRegionChangedAutomationEvent(false); } - // CSHARP_MIGRATION: TODO: - // can we change the calendarDatePicker.Date of in arg? private void ReselectCalendarDate(CalendarDatePicker calendarDatePicker, DateTimeOffset? dateTime) { // Reselect the unselected Date diff --git a/src/Calculator/Views/MainPage.xaml.cs b/src/Calculator/Views/MainPage.xaml.cs index b3cfebda..b4afa348 100644 --- a/src/Calculator/Views/MainPage.xaml.cs +++ b/src/Calculator/Views/MainPage.xaml.cs @@ -116,7 +116,7 @@ namespace CalculatorApp public ObservableCollection CreateUIElementsForCategories(IObservableVector categories) { - var menuCategories = new ObservableCollection(); // CSHARP_MIGRATION: TODO: Check if ObservableCollection fits here + var menuCategories = new ObservableCollection(); foreach (var group in categories) {