mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
fixes misc TODO items
This commit is contained in:
parent
fd5a38acd9
commit
c6cbca004a
9 changed files with 14 additions and 28 deletions
|
@ -33,6 +33,7 @@ public
|
||||||
OBSERVABLE_PROPERTY_RW(int, TokenPosition);
|
OBSERVABLE_PROPERTY_RW(int, TokenPosition);
|
||||||
OBSERVABLE_PROPERTY_RW(bool, IsTokenEditable);
|
OBSERVABLE_PROPERTY_RW(bool, IsTokenEditable);
|
||||||
OBSERVABLE_PROPERTY_RW(int, CommandIndex);
|
OBSERVABLE_PROPERTY_RW(int, CommandIndex);
|
||||||
|
OBSERVABLE_PROPERTY_RW(TokenType, Type);
|
||||||
OBSERVABLE_PROPERTY_R(Platform::String ^, OriginalToken);
|
OBSERVABLE_PROPERTY_R(Platform::String ^, OriginalToken);
|
||||||
|
|
||||||
property bool IsTokenInEditMode
|
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:
|
private:
|
||||||
bool m_InEditMode;
|
bool m_InEditMode;
|
||||||
};
|
};
|
||||||
|
|
|
@ -245,13 +245,13 @@ namespace CalculatorApp
|
||||||
void SendCommandToCalcManager(int command);
|
void SendCommandToCalcManager(int command);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// CSHARP_MIGRATION: TODO: check if these still need to be internal
|
// Memory feature related methods.
|
||||||
// Memory feature related methods. They are internal because they need to called from the MainPage code-behind
|
|
||||||
void OnMemoryButtonPressed();
|
void OnMemoryButtonPressed();
|
||||||
void OnMemoryItemPressed(Platform::Object ^ memoryItemPosition);
|
void OnMemoryItemPressed(Platform::Object ^ memoryItemPosition);
|
||||||
void OnMemoryAdd(Platform::Object ^ memoryItemPosition);
|
void OnMemoryAdd(Platform::Object ^ memoryItemPosition);
|
||||||
void OnMemorySubtract(Platform::Object ^ memoryItemPosition);
|
void OnMemorySubtract(Platform::Object ^ memoryItemPosition);
|
||||||
void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition);
|
void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition);
|
||||||
|
|
||||||
void SelectHistoryItem(HistoryItemViewModel ^ item);
|
void SelectHistoryItem(HistoryItemViewModel ^ item);
|
||||||
void SwitchProgrammerModeBase(CalculatorApp::ViewModel::Common::NumberBase calculatorBase);
|
void SwitchProgrammerModeBase(CalculatorApp::ViewModel::Common::NumberBase calculatorBase);
|
||||||
void SetBitshiftRadioButtonCheckedAnnouncement(Platform::String ^ announcement);
|
void SetBitshiftRadioButtonCheckedAnnouncement(Platform::String ^ announcement);
|
||||||
|
|
|
@ -75,7 +75,6 @@ namespace CalculatorApp
|
||||||
return AccessibleName;
|
return AccessibleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSHARP_MIGRATION: TODO:
|
|
||||||
public:
|
public:
|
||||||
bool IsModelUnitWhimsical()
|
bool IsModelUnitWhimsical()
|
||||||
{
|
{
|
||||||
|
@ -87,7 +86,8 @@ namespace CalculatorApp
|
||||||
return m_original.id;
|
return m_original.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal : const UnitConversionManager::Unit& GetModelUnit() const
|
internal:
|
||||||
|
const UnitConversionManager::Unit& GetModelUnit() const
|
||||||
{
|
{
|
||||||
return m_original;
|
return m_original;
|
||||||
}
|
}
|
||||||
|
@ -98,23 +98,21 @@ namespace CalculatorApp
|
||||||
|
|
||||||
[Windows::UI::Xaml::Data::Bindable] public ref class SupplementaryResult sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
[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_Value(value)
|
||||||
, m_Unit(unit)
|
, m_Unit(unit)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSHARP_MIGRATION: TODO: double check below method's accessor
|
|
||||||
public:
|
public:
|
||||||
bool IsWhimsical()
|
bool IsWhimsical()
|
||||||
{
|
{
|
||||||
return m_Unit->GetModelUnit().isWhimsical;
|
return m_Unit->GetModelUnit().isWhimsical;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
|
||||||
Platform::String ^ GetLocalizedAutomationName();
|
Platform::String ^ GetLocalizedAutomationName();
|
||||||
|
|
||||||
public:
|
|
||||||
OBSERVABLE_OBJECT();
|
OBSERVABLE_OBJECT();
|
||||||
|
|
||||||
OBSERVABLE_PROPERTY_R(Platform::String ^, Value);
|
OBSERVABLE_PROPERTY_R(Platform::String ^, Value);
|
||||||
|
|
|
@ -402,14 +402,12 @@ namespace CalculatorApp
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// CSHARP_MIGRATION: TODO:
|
|
||||||
var calculatorOptions = NavCategoryGroup.CreateCalculatorCategory();
|
var calculatorOptions = NavCategoryGroup.CreateCalculatorCategory();
|
||||||
|
|
||||||
var jumpList = await JumpList.LoadCurrentAsync();
|
var jumpList = await JumpList.LoadCurrentAsync();
|
||||||
jumpList.SystemGroupKind = JumpListSystemGroupKind.None;
|
jumpList.SystemGroupKind = JumpListSystemGroupKind.None;
|
||||||
jumpList.Items.Clear();
|
jumpList.Items.Clear();
|
||||||
|
|
||||||
// CSHARP_MIGRATION: TODO:
|
|
||||||
foreach (NavCategory option in calculatorOptions.Categories)
|
foreach (NavCategory option in calculatorOptions.Categories)
|
||||||
{
|
{
|
||||||
if (!option.IsEnabled)
|
if (!option.IsEnabled)
|
||||||
|
|
|
@ -617,7 +617,7 @@ namespace CalculatorApp
|
||||||
}
|
}
|
||||||
|
|
||||||
var buttons = EqualRange(lookupMap, (MyVirtualKey)key);
|
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);
|
var appViewModel = (navView.DataContext as ApplicationViewModel);
|
||||||
appViewModel.Mode = ViewMode.Date;
|
appViewModel.Mode = ViewMode.Date;
|
||||||
var categoryName = AppResourceProvider.GetInstance().GetResourceString("DateCalculationModeText");
|
var categoryName = AppResourceProvider.GetInstance().GetResourceString("DateCalculationModeText");
|
||||||
|
@ -656,7 +656,7 @@ namespace CalculatorApp
|
||||||
}
|
}
|
||||||
|
|
||||||
var buttons = EqualRange(lookupMap, (MyVirtualKey)myVirtualKey);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -710,7 +710,7 @@ namespace CalculatorApp
|
||||||
var item = itemRef.Target as MUXC.NavigationView;
|
var item = itemRef.Target as MUXC.NavigationView;
|
||||||
if (item != null)
|
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);
|
var menuItems = ((ObservableCollection<object>)navView.MenuItemsSource);
|
||||||
if (menuItems != null)
|
if (menuItems != null)
|
||||||
|
|
|
@ -458,8 +458,6 @@ namespace CalculatorApp
|
||||||
{
|
{
|
||||||
ScientificAngleButtons.IsErrorVisualState = isError;
|
ScientificAngleButtons.IsErrorVisualState = isError;
|
||||||
}
|
}
|
||||||
// CSHARP_MIGRATION: TODO:
|
|
||||||
// ScientificAngleButtons works but ProgrammerDisplayPanel doesn't
|
|
||||||
else if (IsProgrammer && ProgrammerDisplayPanel != null)
|
else if (IsProgrammer && ProgrammerDisplayPanel != null)
|
||||||
{
|
{
|
||||||
ProgrammerDisplayPanel.IsErrorVisualState = isError;
|
ProgrammerDisplayPanel.IsErrorVisualState = isError;
|
||||||
|
|
|
@ -227,9 +227,6 @@ namespace CalculatorApp
|
||||||
}
|
}
|
||||||
|
|
||||||
m_updatingCheckedStates = true;
|
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;
|
int index = 0;
|
||||||
bool mustUpdateTextOfMostSignificantDigits = m_currentValueBitLength != Model.ValueBitLength;
|
bool mustUpdateTextOfMostSignificantDigits = m_currentValueBitLength != Model.ValueBitLength;
|
||||||
int previousMSDPosition = GetIndexOfLastBit(m_currentValueBitLength);
|
int previousMSDPosition = GetIndexOfLastBit(m_currentValueBitLength);
|
||||||
|
|
|
@ -223,8 +223,6 @@ namespace CalculatorApp
|
||||||
RaiseLiveRegionChangedAutomationEvent(false);
|
RaiseLiveRegionChangedAutomationEvent(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSHARP_MIGRATION: TODO:
|
|
||||||
// can we change the calendarDatePicker.Date of in arg?
|
|
||||||
private void ReselectCalendarDate(CalendarDatePicker calendarDatePicker, DateTimeOffset? dateTime)
|
private void ReselectCalendarDate(CalendarDatePicker calendarDatePicker, DateTimeOffset? dateTime)
|
||||||
{
|
{
|
||||||
// Reselect the unselected Date
|
// Reselect the unselected Date
|
||||||
|
|
|
@ -116,7 +116,7 @@ namespace CalculatorApp
|
||||||
|
|
||||||
public ObservableCollection<object> CreateUIElementsForCategories(IObservableVector<NavCategoryGroup> categories)
|
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)
|
foreach (var group in categories)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue