mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-13 00:32:52 -07:00
CalcViewModel code cleaning (#754)
* move KeyboardShortcutManager, ValidationConverter and ViewState to Calculator * remove dead code listed in #753 * remove Microsoft.UI.Xaml nuget package from CalcViewModel
This commit is contained in:
parent
712bdb1b7c
commit
2d177e5160
31 changed files with 77 additions and 378 deletions
|
@ -903,21 +903,6 @@ void StandardCalculatorViewModel::OnClearMemoryCommand(Object ^ parameter)
|
|||
Announcement = CalculatorAnnouncement::GetMemoryClearedAnnouncement(m_localizedMemoryCleared);
|
||||
}
|
||||
|
||||
void StandardCalculatorViewModel::OnPinUnpinCommand(Object ^ parameter)
|
||||
{
|
||||
SetViewPinnedState(!IsViewPinned());
|
||||
}
|
||||
|
||||
bool StandardCalculatorViewModel::IsViewPinned()
|
||||
{
|
||||
return m_IsCurrentViewPinned;
|
||||
}
|
||||
|
||||
void StandardCalculatorViewModel::SetViewPinnedState(bool pinned)
|
||||
{
|
||||
IsCurrentViewPinned = pinned;
|
||||
}
|
||||
|
||||
ButtonInfo StandardCalculatorViewModel::MapCharacterToButtonId(char16 ch)
|
||||
{
|
||||
ButtonInfo result;
|
||||
|
@ -1476,15 +1461,6 @@ void StandardCalculatorViewModel::Recalculate(bool fromHistory)
|
|||
}
|
||||
}
|
||||
|
||||
CommandType StandardCalculatorViewModel::GetSelectedTokenType(_In_ unsigned int tokenPosition)
|
||||
{
|
||||
const pair<wstring, int>& token = m_tokens->at(tokenPosition);
|
||||
unsigned int tokenCommandIndex = token.second;
|
||||
const shared_ptr<IExpressionCommand>& tokenCommand = m_commands->at(tokenCommandIndex);
|
||||
|
||||
return tokenCommand->GetCommandType();
|
||||
}
|
||||
|
||||
bool StandardCalculatorViewModel::IsOpnd(Command command)
|
||||
{
|
||||
static constexpr Command opnd[] = { Command::Command0, Command::Command1, Command::Command2, Command::Command3, Command::Command4, Command::Command5,
|
||||
|
@ -1626,26 +1602,6 @@ void StandardCalculatorViewModel::SwitchAngleType(NumbersAndOperatorsEnum num)
|
|||
OnButtonPressed(num);
|
||||
}
|
||||
|
||||
NumbersAndOperatorsEnum StandardCalculatorViewModel::ConvertIntegerToNumbersAndOperatorsEnum(unsigned int parameter)
|
||||
{
|
||||
NumbersAndOperatorsEnum angletype;
|
||||
switch (parameter)
|
||||
{
|
||||
case 321:
|
||||
angletype = NumbersAndOperatorsEnum::Degree;
|
||||
break;
|
||||
case 322:
|
||||
angletype = NumbersAndOperatorsEnum::Radians;
|
||||
break;
|
||||
case 323:
|
||||
angletype = NumbersAndOperatorsEnum::Grads;
|
||||
break;
|
||||
default:
|
||||
angletype = NumbersAndOperatorsEnum::Degree;
|
||||
};
|
||||
return angletype;
|
||||
}
|
||||
|
||||
void StandardCalculatorViewModel::UpdateOperand(int pos, String ^ text)
|
||||
{
|
||||
pair<wstring, int> p = m_tokens->at(pos);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue