Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes up some simple miscellaneous TODO items #1556

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/CalcViewModel/Common/DisplayExpressionToken.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
};
Expand Down
4 changes: 2 additions & 2 deletions src/CalcViewModel/StandardCalculatorViewModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 7 additions & 9 deletions src/CalcViewModel/UnitConverterViewModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ namespace CalculatorApp
return AccessibleName;
}

// CSHARP_MIGRATION: TODO:
public:
bool IsModelUnitWhimsical()
{
Expand All @@ -87,34 +86,33 @@ 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;
};

[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);
Expand Down
5 changes: 0 additions & 5 deletions src/Calculator/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public App()

Suspending += OnSuspending;

// CSHARP_MIGRATION: TODO:
#if DEBUG
DebugSettings.IsBindingTracingEnabled = true;
DebugSettings.BindingFailed += (sender, args) =>
Expand Down Expand Up @@ -399,20 +398,16 @@ public void Dispose()
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)
Expand Down
6 changes: 3 additions & 3 deletions src/Calculator/Common/KeyboardShortcuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ private static void OnKeyDownHandler(CoreWindow sender, KeyEventArgs args)
}

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");
Expand Down Expand Up @@ -656,7 +656,7 @@ private static void OnKeyDownHandler(CoreWindow sender, KeyEventArgs args)
}

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;
}
Expand Down Expand Up @@ -710,7 +710,7 @@ private static void OnAcceleratorKeyActivated(CoreDispatcher dispatcher, Acceler
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<object>)navView.MenuItemsSource);
if (menuItems != null)
Expand Down
2 changes: 0 additions & 2 deletions src/Calculator/Views/Calculator.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,6 @@ private void OnIsInErrorPropertyChanged()
{
ScientificAngleButtons.IsErrorVisualState = isError;
}
// CSHARP_MIGRATION: TODO:
// ScientificAngleButtons works but ProgrammerDisplayPanel doesn't
else if (IsProgrammer && ProgrammerDisplayPanel != null)
{
ProgrammerDisplayPanel.IsErrorVisualState = isError;
Expand Down
3 changes: 0 additions & 3 deletions src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ private void UpdateCheckedStates(bool updateAutomationPropertiesNames)
}

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);
Expand Down
2 changes: 0 additions & 2 deletions src/Calculator/Views/DateCalculator.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@ private void AddSubtractOption_Checked(object sender, RoutedEventArgs e)
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
Expand Down
2 changes: 1 addition & 1 deletion src/Calculator/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void SetHeaderAutomationName()

public ObservableCollection<object> CreateUIElementsForCategories(IObservableVector<NavCategoryGroup> categories)
{
var menuCategories = new ObservableCollection<object>(); // CSHARP_MIGRATION: TODO: Check if ObservableCollection fits here
var menuCategories = new ObservableCollection<object>();

foreach (var group in categories)
{
Expand Down