Merge master into feature/GraphingCalculator branch (#660)

This commit is contained in:
Pepe Rivera 2019-09-05 15:01:12 -07:00 committed by GitHub
parent 1c9755d38a
commit 41fbcfe9c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
199 changed files with 5809 additions and 2925 deletions

View file

@ -148,7 +148,6 @@ UnitConverterViewModel::UnitConverterViewModel(const shared_ptr<UCM::IUnitConver
Unit2AutomationName = m_localizedOutputUnitName;
IsDecimalEnabled = true;
m_IsFirstTime = true;
m_model->Initialize();
PopulateData();
}
@ -156,7 +155,6 @@ UnitConverterViewModel::UnitConverterViewModel(const shared_ptr<UCM::IUnitConver
void UnitConverterViewModel::ResetView()
{
m_model->SendCommand(UCM::Command::Reset);
m_IsFirstTime = true;
OnCategoryChanged(nullptr);
}
@ -239,15 +237,8 @@ void UnitConverterViewModel::OnUnitChanged(Object ^ parameter)
// End timer to show results immediately
m_supplementaryResultsTimer->Cancel();
}
if (!m_IsFirstTime)
{
SaveUserPreferences();
}
else
{
RestoreUserPreferences();
m_IsFirstTime = false;
}
SaveUserPreferences();
}
void UnitConverterViewModel::OnSwitchActive(Platform::Object ^ unused)
@ -502,6 +493,8 @@ void UnitConverterViewModel::OnButtonPressed(Platform::Object ^ parameter)
}
m_model->SendCommand(command);
TraceLogger::GetInstance().LogConverterInputReceived(Mode);
}
void UnitConverterViewModel::OnCopyCommand(Platform::Object ^ parameter)
@ -523,7 +516,7 @@ void UnitConverterViewModel::OnPasteCommand(Platform::Object ^ parameter)
// EventWriteClipboardPaste_Start();
// Any converter ViewMode is fine here.
CopyPasteManager::GetStringToPaste(m_Mode, NavCategory::GetGroupType(m_Mode))
.then([this](String ^ pastedString) { OnPaste(pastedString, m_Mode); }, concurrency::task_continuation_context::use_current());
.then([this](String ^ pastedString) { OnPaste(pastedString); }, concurrency::task_continuation_context::use_current());
}
void UnitConverterViewModel::InitializeView()
@ -882,7 +875,7 @@ NumbersAndOperatorsEnum UnitConverterViewModel::MapCharacterToButtonId(const wch
return mappedValue;
}
void UnitConverterViewModel::OnPaste(String ^ stringToPaste, ViewMode mode)
void UnitConverterViewModel::OnPaste(String ^ stringToPaste)
{
// If pastedString is invalid("NoOp") then display pasteError else process the string
if (stringToPaste == StringReference(CopyPasteManager::PasteErrorString))
@ -891,7 +884,7 @@ void UnitConverterViewModel::OnPaste(String ^ stringToPaste, ViewMode mode)
return;
}
TraceLogger::GetInstance().LogValidInputPasted(mode);
TraceLogger::GetInstance().LogInputPasted(Mode);
bool isFirstLegalChar = true;
bool sendNegate = false;
wstring accumulation = L"";
@ -1014,7 +1007,6 @@ void UnitConverterViewModel::StartConversionResultTimer()
{
String ^ valueFrom = m_Value1Active ? m_Value1 : m_Value2;
String ^ valueTo = m_Value1Active ? m_Value2 : m_Value1;
TraceLogger::GetInstance().LogConversionResult(valueFrom->Data(), UnitFrom->ToString()->Data(), valueTo->Data(), UnitTo->ToString()->Data());
}
});
}