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.
50 lines
2.0 KiB
C++
50 lines
2.0 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
//
|
|
// CalculatorScientificOperators.xaml.h
|
|
// Declaration of the CalculatorScientificOperators class
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include "Views/CalculatorScientificOperators.g.h"
|
|
#include "Views/NumberPad.xaml.h"
|
|
#include "Converters/BooleanNegationConverter.h"
|
|
#include "Converters/VisibilityNegationConverter.h"
|
|
#include "CalcViewModel/StandardCalculatorViewModel.h"
|
|
|
|
namespace CalculatorApp
|
|
{
|
|
[Windows::Foundation::Metadata::WebHostHidden] public ref class CalculatorScientificOperators sealed
|
|
{
|
|
public:
|
|
CalculatorScientificOperators();
|
|
property CalculatorApp::ViewModel::StandardCalculatorViewModel^ Model
|
|
{
|
|
CalculatorApp::ViewModel::StandardCalculatorViewModel^ get() {
|
|
return static_cast<CalculatorApp::ViewModel::StandardCalculatorViewModel^>(this->DataContext);
|
|
}
|
|
}
|
|
|
|
DEPENDENCY_PROPERTY_OWNER(CalculatorScientificOperators);
|
|
DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(bool, IsErrorVisualState, false);
|
|
DEPENDENCY_PROPERTY_WITH_DEFAULT(bool, IsWideLayout, false);
|
|
|
|
bool IsShiftEnabled(bool isWideLayout, bool isErrorState)
|
|
{
|
|
return !(isWideLayout || isErrorState);
|
|
}
|
|
void OpenParenthesisButton_GotFocus(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
|
Platform::String ^ ParenthesisCountToString(unsigned int count);
|
|
|
|
private:
|
|
void ShortLayout_Completed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
|
|
void WideLayout_Completed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
|
|
void OnIsErrorVisualStatePropertyChanged(bool oldValue, bool newValue);
|
|
void shiftButton_Check(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
|
|
void shiftButton_IsEnabledChanged(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::DependencyPropertyChangedEventArgs ^ e);
|
|
void SetOperatorRowVisibility();
|
|
};
|
|
}
|