mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-14 02:26:50 -07:00
Fix the project code style, as it is not consistent. (#236)
Fixes #202 This PR fixes code style for the project files. The Problem Different files in the project use different code style. That is not consistent and leads to harder maintenance of the project. Description of the changes: Have investigated and determined the most used code style across the given codebase Have configured IDE and applied code style to all project files. Have crafted clang-formatter config. see https://clang.llvm.org/docs/ClangFormat.html https://clang.llvm.org/docs/ClangFormatStyleOptions.html Some cases were fixed manually How changes were validated: manual/ad-hoc testing, automated testing All tests pass as before because these are only code style changes. Additional Please review, and let me know if I have any mistake in the code style. In case of any mistake, I will change the configuration and re-apply it to the project.
This commit is contained in:
parent
c77f1de84c
commit
2826d37056
237 changed files with 12824 additions and 11843 deletions
|
@ -10,18 +10,15 @@ namespace CalculatorApp
|
|||
{
|
||||
namespace ViewModel
|
||||
{
|
||||
[Windows::UI::Xaml::Data::Bindable]
|
||||
public ref class HistoryItemViewModel sealed : Windows::UI::Xaml::Data::ICustomPropertyProvider
|
||||
[Windows::UI::Xaml::Data::Bindable] public ref class HistoryItemViewModel sealed : Windows::UI::Xaml::Data::ICustomPropertyProvider
|
||||
{
|
||||
internal :
|
||||
|
||||
internal:
|
||||
HistoryItemViewModel(Platform::String ^ expression, Platform::String ^ result,
|
||||
_In_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const& spTokens,
|
||||
_In_ std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> const& spCommands);
|
||||
|
||||
HistoryItemViewModel(Platform::String^ expression,
|
||||
Platform::String^ result,
|
||||
_In_ std::shared_ptr<CalculatorVector <std::pair<std::wstring, int>>> const &spTokens,
|
||||
_In_ std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> const &spCommands);
|
||||
|
||||
std::shared_ptr<CalculatorVector <std::pair<std::wstring, int>>> const& GetTokens()
|
||||
std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const& GetTokens()
|
||||
{
|
||||
return m_spTokens;
|
||||
}
|
||||
|
@ -32,38 +29,25 @@ namespace CalculatorApp
|
|||
}
|
||||
|
||||
public:
|
||||
property Platform::String
|
||||
^ Expression { Platform::String ^ get() { return m_expression; } }
|
||||
|
||||
property Platform::String^ Expression
|
||||
{
|
||||
Platform::String^ get() { return m_expression; }
|
||||
}
|
||||
property Platform::String
|
||||
^ AccExpression { Platform::String ^ get() { return m_accExpression; } }
|
||||
|
||||
property Platform::String^ AccExpression
|
||||
{
|
||||
Platform::String^ get() { return m_accExpression; }
|
||||
}
|
||||
property Platform::String
|
||||
^ Result { Platform::String ^ get() { return m_result; } }
|
||||
|
||||
property Platform::String^ Result
|
||||
{
|
||||
Platform::String^ get() { return m_result; }
|
||||
}
|
||||
property Platform::String
|
||||
^ AccResult { Platform::String ^ get() { return m_accResult; } }
|
||||
|
||||
property Platform::String^ AccResult
|
||||
{
|
||||
Platform::String^ get() { return m_accResult; }
|
||||
}
|
||||
virtual Windows::UI::Xaml::Data::ICustomProperty
|
||||
^ GetCustomProperty(Platform::String ^ name) { return nullptr; }
|
||||
|
||||
virtual Windows::UI::Xaml::Data::ICustomProperty^ GetCustomProperty(Platform::String^ name)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
virtual Windows::UI::Xaml::Data::ICustomProperty
|
||||
^ GetIndexedProperty(Platform::String ^ name, Windows::UI::Xaml::Interop::TypeName type) { return nullptr; }
|
||||
|
||||
virtual Windows::UI::Xaml::Data::ICustomProperty^ GetIndexedProperty(Platform::String^ name, Windows::UI::Xaml::Interop::TypeName type)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual property Windows::UI::Xaml::Interop::TypeName Type
|
||||
virtual property Windows::UI::Xaml::Interop::TypeName Type
|
||||
{
|
||||
Windows::UI::Xaml::Interop::TypeName get()
|
||||
{
|
||||
|
@ -71,22 +55,19 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
|
||||
virtual Platform::String^ GetStringRepresentation()
|
||||
{
|
||||
return m_accExpression + " " + m_accResult;
|
||||
}
|
||||
virtual Platform::String
|
||||
^ GetStringRepresentation() { return m_accExpression + " " + m_accResult; }
|
||||
|
||||
private : static Platform::String
|
||||
^ GetAccessibleExpressionFromTokens(_In_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const& spTokens,
|
||||
_In_ Platform::String ^ fallbackExpression);
|
||||
|
||||
private:
|
||||
static Platform::String^ GetAccessibleExpressionFromTokens(
|
||||
_In_ std::shared_ptr<CalculatorVector <std::pair<std::wstring, int>>> const &spTokens,
|
||||
_In_ Platform::String^ fallbackExpression);
|
||||
|
||||
private:
|
||||
Platform::String^ m_expression;
|
||||
Platform::String^ m_accExpression;
|
||||
Platform::String^ m_accResult;
|
||||
Platform::String^ m_result;
|
||||
std::shared_ptr<CalculatorVector <std::pair<std::wstring, int>>> m_spTokens;
|
||||
Platform::String ^ m_expression;
|
||||
Platform::String ^ m_accExpression;
|
||||
Platform::String ^ m_accResult;
|
||||
Platform::String ^ m_result;
|
||||
std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> m_spTokens;
|
||||
std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> m_spCommands;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue