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:
Oleg Abrazhaev 2019-05-02 20:59:19 +02:00 committed by Daniel Belcher
commit 2826d37056
237 changed files with 12824 additions and 11843 deletions

View file

@ -15,60 +15,60 @@ namespace CalculatorApp
namespace ViewModel
{
public delegate void HideHistoryClickedHandler();
public delegate void HistoryItemClickedHandler(CalculatorApp::ViewModel::HistoryItemViewModel^ e);
public
delegate void HideHistoryClickedHandler();
public
delegate void HistoryItemClickedHandler(CalculatorApp::ViewModel::HistoryItemViewModel ^ e);
[Windows::UI::Xaml::Data::Bindable]
public ref class HistoryViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
[Windows::UI::Xaml::Data::Bindable] public ref class HistoryViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_RW(int, ItemSize);
OBSERVABLE_PROPERTY_RW(Windows::UI::Xaml::Interop::IBindableObservableVector^, Items);
OBSERVABLE_PROPERTY_RW(Windows::UI::Xaml::Interop::IBindableObservableVector ^, Items);
OBSERVABLE_PROPERTY_RW(bool, AreHistoryShortcutsEnabled);
OBSERVABLE_PROPERTY_RW(CalculatorApp::Common::Automation::NarratorAnnouncement^, HistoryAnnouncement);
OBSERVABLE_PROPERTY_RW(CalculatorApp::Common::Automation::NarratorAnnouncement ^, HistoryAnnouncement);
void OnHistoryItemAdded(_In_ unsigned int addedItemIndex);
COMMAND_FOR_METHOD(HideCommand, HistoryViewModel::OnHideCommand);
void OnHideCommand(_In_ Platform::Object^ e);
void OnHideCommand(_In_ Platform::Object ^ e);
COMMAND_FOR_METHOD(ClearCommand, HistoryViewModel::OnClearCommand);
void OnClearCommand(_In_ Platform::Object^ e);
void OnClearCommand(_In_ Platform::Object ^ e);
// events that are created
event HideHistoryClickedHandler^ HideHistoryClicked;
event HistoryItemClickedHandler^ HistoryItemClicked;
void ShowItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel^ e);
event HideHistoryClickedHandler ^ HideHistoryClicked;
event HistoryItemClickedHandler ^ HistoryItemClicked;
void ShowItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel ^ e);
void ClearHistory();
void RestoreCompleteHistory();
internal:
HistoryViewModel(_In_ CalculationManager::CalculatorManager* calculatorManager);
void SetCalculatorDisplay(CalculatorDisplay &calculatorDisplay);
internal : HistoryViewModel(_In_ CalculationManager::CalculatorManager* calculatorManager);
void SetCalculatorDisplay(CalculatorDisplay& calculatorDisplay);
void ReloadHistory(_In_ CalculatorApp::Common::ViewMode currentMode);
void DeleteItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel^ e);
void DeleteItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel ^ e);
// store history in app data functions
Platform::String^ SerializeHistoryItem(_In_ std::shared_ptr<CalculationManager::HISTORYITEM> const &item);
Platform::String ^ SerializeHistoryItem(_In_ std::shared_ptr<CalculationManager::HISTORYITEM> const& item);
void SaveHistory();
private:
CalculationManager::CalculatorManager* const m_calculatorManager;
CalculatorDisplay m_calculatorDisplay;
CalculationManager::CALCULATOR_MODE m_currentMode;
Platform::String^ m_localizedHistoryCleared;
Platform::String ^ m_localizedHistoryCleared;
void RestoreHistory(_In_ CalculationManager::CALCULATOR_MODE cMode);
CalculationManager::HISTORYITEM DeserializeHistoryItem(_In_ Platform::String^ historyItemKey, _In_ Windows::Storage::ApplicationDataContainer^ historyContainer);
Windows::Storage::ApplicationDataContainer^ GetHistoryContainer(_In_ CalculationManager::CALCULATOR_MODE cMode);
Platform::String^ GetHistoryContainerKey(_In_ CalculationManager::CALCULATOR_MODE cMode);
CalculationManager::HISTORYITEM DeserializeHistoryItem(_In_ Platform::String ^ historyItemKey,
_In_ Windows::Storage::ApplicationDataContainer ^ historyContainer);
Windows::Storage::ApplicationDataContainer ^ GetHistoryContainer(_In_ CalculationManager::CALCULATOR_MODE cMode);
Platform::String ^ GetHistoryContainerKey(_In_ CalculationManager::CALCULATOR_MODE cMode);
void ClearHistoryContainer(_In_ CalculationManager::CALCULATOR_MODE cMode);
void UpdateHistoryVectorLength(_In_ int newValue, _In_ CalculationManager::CALCULATOR_MODE cMode);
bool IsValid(_In_ CalculationManager::HISTORYITEM item);
void MakeHistoryClearedNarratorAnnouncement(Platform::String^ resourceKey, Platform::String^& formatVariable);
void MakeHistoryClearedNarratorAnnouncement(Platform::String ^ resourceKey, Platform::String ^ &formatVariable);
friend class CalculatorDisplay;
void UpdateItemSize();