Secondary formatting changes (#489)

Description of the changes:
Adjusted some of the values in .clang-format
Add clang-format-all.ps1
Fix path to .clang-format in Calculator.sln

How changes were validated:
Manual.
This commit is contained in:
Daniel Belcher
2019-05-02 16:48:33 -07:00
committed by GitHub
parent 2826d37056
commit 9f01c8168b
113 changed files with 1780 additions and 819 deletions

View File

@@ -41,7 +41,11 @@ DEPENDENCY_PROPERTY_INITIALIZATION(Calculator, IsStandard);
DEPENDENCY_PROPERTY_INITIALIZATION(Calculator, IsScientific);
DEPENDENCY_PROPERTY_INITIALIZATION(Calculator, IsProgrammer);
Calculator::Calculator() : m_doAnimate(false), m_isLastAnimatedInScientific(false), m_isLastAnimatedInProgrammer(false), m_resultAnimate(false)
Calculator::Calculator()
: m_doAnimate(false)
, m_isLastAnimatedInScientific(false)
, m_isLastAnimatedInProgrammer(false)
, m_resultAnimate(false)
{
SetFontSizeResources();
InitializeComponent();

View File

@@ -109,8 +109,9 @@ public
bool m_IsDigit = false;
Memory ^ m_memory;
void HistoryFlyout_Opened(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ args);
void HistoryFlyout_Closing(_In_ Windows::UI::Xaml::Controls::Primitives::FlyoutBase ^ sender,
_In_ Windows::UI::Xaml::Controls::Primitives::FlyoutBaseClosingEventArgs ^ args);
void HistoryFlyout_Closing(
_In_ Windows::UI::Xaml::Controls::Primitives::FlyoutBase ^ sender,
_In_ Windows::UI::Xaml::Controls::Primitives::FlyoutBaseClosingEventArgs ^ args);
void HistoryFlyout_Closed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ args);
void OnHideHistoryClicked();
void OnHideMemoryClicked();
@@ -121,8 +122,9 @@ public
bool m_fIsHistoryFlyoutOpen;
bool m_fIsMemoryFlyoutOpen;
void OnMemoryFlyoutOpened(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ args);
void OnMemoryFlyoutClosing(_In_ Windows::UI::Xaml::Controls::Primitives::FlyoutBase ^ sender,
_In_ Windows::UI::Xaml::Controls::Primitives::FlyoutBaseClosingEventArgs ^ args);
void OnMemoryFlyoutClosing(
_In_ Windows::UI::Xaml::Controls::Primitives::FlyoutBase ^ sender,
_In_ Windows::UI::Xaml::Controls::Primitives::FlyoutBaseClosingEventArgs ^ args);
void OnMemoryFlyoutClosed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ args);
void SetChildAsMemory();
void SetChildAsHistory();

View File

@@ -25,7 +25,8 @@ using namespace Windows::UI::Xaml::Input;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
CalculatorProgrammerBitFlipPanel::CalculatorProgrammerBitFlipPanel() : m_updatingCheckedStates(false)
CalculatorProgrammerBitFlipPanel::CalculatorProgrammerBitFlipPanel()
: m_updatingCheckedStates(false)
{
InitializeComponent();
auto booleanToVisibilityConverter = ref new Converters::BooleanToVisibilityConverter;

View File

@@ -34,8 +34,10 @@ namespace CalculatorApp
void AssignFlipButtons();
void SetVisibilityBinding(_In_ Windows::UI::Xaml::FrameworkElement ^ element, _In_ Platform::String ^ path,
_In_ Windows::UI::Xaml::Data::IValueConverter ^ converter);
void SetVisibilityBinding(
_In_ Windows::UI::Xaml::FrameworkElement ^ element,
_In_ Platform::String ^ path,
_In_ Windows::UI::Xaml::Data::IValueConverter ^ converter);
void OnBitToggled(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void UpdateCheckedStates();

View File

@@ -20,7 +20,8 @@ using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::UI::ViewManagement;
using namespace Windows::UI::Core;
CalculatorProgrammerDisplayPanel::CalculatorProgrammerDisplayPanel() : m_isErrorVisualState(false)
CalculatorProgrammerDisplayPanel::CalculatorProgrammerDisplayPanel()
: m_isErrorVisualState(false)
{
InitializeComponent();
}

View File

@@ -23,7 +23,8 @@ using namespace Windows::UI::Xaml::Data;
using namespace CalculatorApp::Common;
using namespace Windows::UI::Xaml::Media;
CalculatorProgrammerRadixOperators::CalculatorProgrammerRadixOperators() : m_isErrorVisualState(false)
CalculatorProgrammerRadixOperators::CalculatorProgrammerRadixOperators()
: m_isErrorVisualState(false)
{
InitializeComponent();

View File

@@ -29,7 +29,8 @@ using namespace Windows::UI::Core;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
CalculatorScientificAngleButtons::CalculatorScientificAngleButtons() : m_isErrorVisualState(false)
CalculatorScientificAngleButtons::CalculatorScientificAngleButtons()
: m_isErrorVisualState(false)
{
InitializeComponent();
}

View File

@@ -68,8 +68,9 @@ void CalculatorScientificOperators::shiftButton_Check(_In_ Platform::Object ^ /*
SetOperatorRowVisibility();
}
void CalculatorScientificOperators::shiftButton_IsEnabledChanged(_In_ Platform::Object ^ /*sender*/,
_In_ Windows::UI::Xaml::DependencyPropertyChangedEventArgs ^ /*e*/)
void CalculatorScientificOperators::shiftButton_IsEnabledChanged(
_In_ Platform::Object ^ /*sender*/,
_In_ Windows::UI::Xaml::DependencyPropertyChangedEventArgs ^ /*e*/)
{
SetOperatorRowVisibility();
Common::KeyboardShortcutManager::ShiftButtonChecked(ShiftButton->IsEnabled && ShiftButton->IsChecked->Value);

View File

@@ -24,7 +24,8 @@ using namespace Windows::UI::Xaml::Navigation;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
CalculatorStandardOperators::CalculatorStandardOperators() : m_isErrorVisualState(false)
CalculatorStandardOperators::CalculatorStandardOperators()
: m_isErrorVisualState(false)
{
InitializeComponent();
}

View File

@@ -79,9 +79,10 @@ DateCalculator::DateCalculator()
DateDiff_ToDate->MaxDate = maxYear;
// Set the PlaceHolderText for CalendarDatePicker
DateTimeFormatter ^ dateTimeFormatter =
LocalizationService::GetRegionalSettingsAwareDateTimeFormatter(L"day month year", localizationSettings.GetCalendarIdentifier(),
ClockIdentifiers::TwentyFourHour); // Clock Identifier is not used
DateTimeFormatter ^ dateTimeFormatter = LocalizationService::GetRegionalSettingsAwareDateTimeFormatter(
L"day month year",
localizationSettings.GetCalendarIdentifier(),
ClockIdentifiers::TwentyFourHour); // Clock Identifier is not used
DateDiff_FromDate->DateFormat = L"day month year";
DateDiff_ToDate->DateFormat = L"day month year";
@@ -130,8 +131,8 @@ void DateCalculator::AddSubtract_DateChanged(_In_ CalendarDatePicker ^ sender, _
{
auto dateCalcViewModel = safe_cast<DateCalculatorViewModel ^>(this->DataContext);
dateCalcViewModel->StartDate = e->NewDate->Value;
TraceLogger::GetInstance().LogDateAddSubtractModeUsed(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()),
dateCalcViewModel->IsAddMode);
TraceLogger::GetInstance().LogDateAddSubtractModeUsed(
ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()), dateCalcViewModel->IsAddMode);
}
else
{
@@ -142,8 +143,8 @@ void DateCalculator::AddSubtract_DateChanged(_In_ CalendarDatePicker ^ sender, _
void CalculatorApp::DateCalculator::OffsetValue_Changed(_In_ Platform::Object ^ sender, _In_ SelectionChangedEventArgs ^ e)
{
auto dateCalcViewModel = safe_cast<DateCalculatorViewModel ^>(this->DataContext);
TraceLogger::GetInstance().LogDateAddSubtractModeUsed(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()),
dateCalcViewModel->IsAddMode);
TraceLogger::GetInstance().LogDateAddSubtractModeUsed(
ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()), dateCalcViewModel->IsAddMode);
}
void DateCalculator::OnCopyMenuItemClicked(_In_ Object ^ sender, _In_ RoutedEventArgs ^ e)

View File

@@ -29,12 +29,15 @@ namespace CalculatorApp
void SetDefaultFocus();
private:
void FromDate_DateChanged(_In_ Windows::UI::Xaml::Controls::CalendarDatePicker ^ sender,
_In_ Windows::UI::Xaml::Controls::CalendarDatePickerDateChangedEventArgs ^ e);
void ToDate_DateChanged(_In_ Windows::UI::Xaml::Controls::CalendarDatePicker ^ sender,
_In_ Windows::UI::Xaml::Controls::CalendarDatePickerDateChangedEventArgs ^ e);
void AddSubtract_DateChanged(_In_ Windows::UI::Xaml::Controls::CalendarDatePicker ^ sender,
_In_ Windows::UI::Xaml::Controls::CalendarDatePickerDateChangedEventArgs ^ e);
void FromDate_DateChanged(
_In_ Windows::UI::Xaml::Controls::CalendarDatePicker ^ sender,
_In_ Windows::UI::Xaml::Controls::CalendarDatePickerDateChangedEventArgs ^ e);
void ToDate_DateChanged(
_In_ Windows::UI::Xaml::Controls::CalendarDatePicker ^ sender,
_In_ Windows::UI::Xaml::Controls::CalendarDatePickerDateChangedEventArgs ^ e);
void AddSubtract_DateChanged(
_In_ Windows::UI::Xaml::Controls::CalendarDatePicker ^ sender,
_In_ Windows::UI::Xaml::Controls::CalendarDatePickerDateChangedEventArgs ^ e);
void OffsetValue_Changed(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Controls::SelectionChangedEventArgs ^ e);
void OnCopyMenuItemClicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void OnLoaded(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);

View File

@@ -63,7 +63,8 @@ namespace CalculatorApp::VisualStates
}
}
MainPage::MainPage() : m_model(ref new ApplicationViewModel())
MainPage::MainPage()
: m_model(ref new ApplicationViewModel())
{
InitializeComponent();

View File

@@ -49,8 +49,9 @@ public
void OnNavPaneOpened(_In_ Microsoft::UI::Xaml::Controls::NavigationView ^ sender, _In_ Platform::Object ^ args);
void OnNavPaneClosed(_In_ Microsoft::UI::Xaml::Controls::NavigationView ^ sender, _In_ Platform::Object ^ args);
void OnNavSelectionChanged(_In_ Platform::Object ^ sender, _In_ Microsoft::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs ^ e);
void OnNavItemInvoked(Microsoft::UI::Xaml::Controls::NavigationView ^ /*sender*/,
_In_ Microsoft::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs ^ e);
void OnNavItemInvoked(
Microsoft::UI::Xaml::Controls::NavigationView ^ /*sender*/,
_In_ Microsoft::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs ^ e);
void OnAboutButtonClick(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Controls::ItemClickEventArgs ^ e);
void OnAboutFlyoutOpened(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);

View File

@@ -35,7 +35,8 @@ using namespace Windows::UI::ViewManagement;
DEPENDENCY_PROPERTY_INITIALIZATION(Memory, RowHeight);
Memory::Memory() : m_isErrorVisualState(false)
Memory::Memory()
: m_isErrorVisualState(false)
{
InitializeComponent();
m_memoryItemFlyout = safe_cast<MenuFlyout ^>(Resources->Lookup("MemoryContextMenu"));

View File

@@ -31,7 +31,8 @@ using namespace CalculatorApp::Common;
DEPENDENCY_PROPERTY_INITIALIZATION(NumberPad, ButtonStyle);
NumberPad::NumberPad() : m_isErrorVisualState(false)
NumberPad::NumberPad()
: m_isErrorVisualState(false)
{
InitializeComponent();

View File

@@ -26,11 +26,17 @@ public
}
internal : virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language) = Windows::UI::Xaml::Data::IValueConverter::Convert;
^ Convert(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language) = Windows::UI::Xaml::Data::IValueConverter::Convert;
virtual Platform::Object
^ ConvertBack(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language) = Windows::UI::Xaml::Data::IValueConverter::ConvertBack;
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language) = Windows::UI::Xaml::Data::IValueConverter::ConvertBack;
private:
Windows::UI::Xaml::ResourceDictionary ^ m_delighters;

View File

@@ -20,7 +20,8 @@ using namespace Windows::Foundation::Collections;
namespace CalculatorApp
{
TitleBar::TitleBar() : m_coreTitleBar(CoreApplication::GetCurrentView()->TitleBar)
TitleBar::TitleBar()
: m_coreTitleBar(CoreApplication::GetCurrentView()->TitleBar)
{
m_uiSettings = ref new UISettings();
m_accessibilitySettings = ref new AccessibilitySettings();
@@ -163,7 +164,7 @@ namespace CalculatorApp
void TitleBar::OnWindowActivated(_In_ Object ^ /*sender*/, _In_ WindowActivatedEventArgs ^ e)
{
VisualStateManager::GoToState(this, e->WindowActivationState == CoreWindowActivationState::Deactivated ? WindowNotFocused->Name : WindowFocused->Name,
false);
VisualStateManager::GoToState(
this, e->WindowActivationState == CoreWindowActivationState::Deactivated ? WindowNotFocused->Name : WindowFocused->Name, false);
}
}

View File

@@ -45,7 +45,9 @@ using namespace Windows::UI::ViewManagement;
// There are 10,000 intervals in 1 ms.
static const long long DURATION_500_MS = 10000 * 500;
UnitConverter::UnitConverter() : m_meteredConnectionOverride(false), m_isAnimationEnabled(false)
UnitConverter::UnitConverter()
: m_meteredConnectionOverride(false)
, m_isAnimationEnabled(false)
{
m_layoutDirection = LocalizationService::GetInstance()->GetFlowDirection();
m_FlowDirectionHorizontalAlignment = m_layoutDirection == ::FlowDirection::RightToLeft ? ::HorizontalAlignment::Right : ::HorizontalAlignment::Left;