mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
rename UnitConverter::Reset
This commit is contained in:
parent
ec534e43e9
commit
3b91e33ca1
2 changed files with 8 additions and 10 deletions
|
@ -64,7 +64,7 @@ UnitConverter::UnitConverter(_In_ const shared_ptr<IConverterDataLoader>& dataLo
|
|||
unquoteConversions[L"{lb}"] = LEFTESCAPECHAR;
|
||||
unquoteConversions[L"{rb}"] = RIGHTESCAPECHAR;
|
||||
ClearValues();
|
||||
Reset();
|
||||
ResetCategoriesAndRatios();
|
||||
}
|
||||
|
||||
void UnitConverter::Initialize()
|
||||
|
@ -76,7 +76,7 @@ bool UnitConverter::CheckLoad()
|
|||
{
|
||||
if (m_categories.empty())
|
||||
{
|
||||
Reset();
|
||||
ResetCategoriesAndRatios();
|
||||
}
|
||||
return !m_categories.empty();
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ wstring UnitConverter::Serialize()
|
|||
/// <param name="serializedData">wstring holding the serialized data. If it does not have expected number of parameters, we will ignore it</param>
|
||||
void UnitConverter::DeSerialize(const wstring& serializedData)
|
||||
{
|
||||
Reset();
|
||||
ResetCategoriesAndRatios();
|
||||
|
||||
if (serializedData.empty())
|
||||
{
|
||||
|
@ -616,7 +616,7 @@ void UnitConverter::SendCommand(Command command)
|
|||
clearFront = false;
|
||||
clearBack = false;
|
||||
ClearValues();
|
||||
Reset();
|
||||
ResetCategoriesAndRatios();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -825,15 +825,13 @@ vector<tuple<wstring, Unit>> UnitConverter::CalculateSuggested()
|
|||
returnVector.push_back(whimsicalReturnVector.at(0));
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
return returnVector;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the converter to its initial state
|
||||
/// Resets categories and ratios
|
||||
/// </summary>
|
||||
void UnitConverter::Reset()
|
||||
void UnitConverter::ResetCategoriesAndRatios()
|
||||
{
|
||||
m_categories = m_dataLoader->LoadOrderedCategories();
|
||||
|
||||
|
@ -1088,7 +1086,7 @@ void UnitConverter::UpdateViewModel()
|
|||
|
||||
void UnitConverter::ResetCategoriesAndRatio()
|
||||
{
|
||||
Reset();
|
||||
ResetCategoriesAndRatios();
|
||||
Calculate();
|
||||
UpdateViewModel();
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ namespace UnitConversionManager
|
|||
bool CheckLoad();
|
||||
double Convert(double value, ConversionData conversionData);
|
||||
std::vector<std::tuple<std::wstring, Unit>> CalculateSuggested();
|
||||
void Reset();
|
||||
void ResetCategoriesAndRatios();
|
||||
void ClearValues();
|
||||
void Calculate();
|
||||
void TrimString(std::wstring& input);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue