pass build

This commit is contained in:
Tian Liao 2024-10-16 17:17:33 +08:00
commit 54d891a1ee
4 changed files with 18 additions and 12 deletions

View file

@ -4,6 +4,7 @@
#include "pch.h"
#include <cassert>
#include <stdexcept>
#include <vector>
#include "Snapshots.h"
@ -11,25 +12,29 @@ namespace
{
ref struct UnaryCommand sealed : public CalculatorApp::ViewModel::ICalcManagerIExprCommand
{
property Windows::Foundation::Collections::IVector<int> ^ Commands;
internal :;
std::vector<int> Commands;
};
ref struct BinaryCommand sealed : public CalculatorApp::ViewModel::ICalcManagerIExprCommand
{
property int Command;
internal :;
int Command;
};
ref struct OperandCommand sealed : public CalculatorApp::ViewModel::ICalcManagerIExprCommand
{
property bool IsNegative;
property bool IsDecimalPresent;
property bool IsSciFmt;
property Windows::Foundation::Collections::IVector<int> ^ Commands;
internal :;
bool IsNegative;
bool IsDecimalPresent;
bool IsSciFmt;
std::vector<int> Commands;
};
ref struct Parentheses sealed : public CalculatorApp::ViewModel::ICalcManagerIExprCommand
{
property int Command;
internal :;
int Command;
};
CalculatorApp::ViewModel::ICalcManagerIExprCommand ^ CreateExprCommand(const IExpressionCommand* exprCmd) {
@ -39,10 +44,9 @@ namespace
{
auto cmd = static_cast<const IUnaryCommand*>(exprCmd);
auto result = ref new UnaryCommand();
result->Commands = ref new Platform::Collections::Vector<int>();
for (auto& subcmd : *cmd->GetCommands())
{
result->Commands->Append(subcmd);
result->Commands.push_back(subcmd);
}
return result;
}
@ -60,10 +64,9 @@ namespace
result->IsNegative = cmd->IsNegative();
result->IsDecimalPresent = cmd->IsDecimalPresent();
result->IsSciFmt = cmd->IsSciFmt();
result->Commands = ref new Platform::Collections::Vector<int>();
for (auto& subcmd : *cmd->GetCommands())
{
result->Commands->Append(subcmd);
result->Commands.push_back(subcmd);
}
return result;
}

View file

@ -1789,7 +1789,6 @@ void StandardCalculatorViewModel::SetBitshiftRadioButtonCheckedAnnouncement(Plat
StandardCalculatorSnapshot ^ StandardCalculatorViewModel::GetSnapshot() const
{
CUnaryCommand;
auto result = ref new StandardCalculatorSnapshot();
result->CalcManager = ref new CalcManagerSnapshot(m_standardCalculatorManager);
result->PrimaryDisplay = ref new PrimaryDisplaySnapshot(m_DisplayValue, m_IsInError);

View file

@ -333,6 +333,7 @@
<ClInclude Include="..\CalcViewModel\HistoryViewModel.h" />
<ClInclude Include="..\CalcViewModel\MemoryItemViewModel.h" />
<ClInclude Include="..\CalcViewModel\pch.h" />
<ClInclude Include="..\CalcViewModel\Snapshots.h" />
<ClInclude Include="..\CalcViewModel\StandardCalculatorViewModel.h" />
<ClInclude Include="..\CalcViewModel\targetver.h" />
<ClInclude Include="..\CalcViewModel\UnitConverterViewModel.h" />
@ -375,6 +376,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Snapshots.cpp" />
<ClCompile Include="..\CalcViewModel\StandardCalculatorViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\UnitConverterViewModel.cpp" />
</ItemGroup>

View file

@ -87,6 +87,7 @@
<Filter>GraphingCalculator</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\RadixType.cpp" />
<ClCompile Include="..\CalcViewModel\Snapshots.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\CalcViewModel\Common\AppResourceProvider.h">
@ -204,6 +205,7 @@
<ClInclude Include="..\CalcViewModel\Common\AlwaysSelectedCollectionView.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Snapshots.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\CalcViewModel\DataLoaders\DefaultFromToCurrency.json">