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

@@ -356,9 +356,11 @@ void App::OnAppLaunch(IActivatedEventArgs ^ args, String ^ argument)
auto activatedEventArgs = dynamic_cast<IApplicationViewActivatedEventArgs ^>(args);
if ((activatedEventArgs != nullptr) && (activatedEventArgs->CurrentlyShownApplicationViewId != 0))
{
create_task(ApplicationViewSwitcher::TryShowAsStandaloneAsync(frameService->GetViewId(), ViewSizePreference::Default,
activatedEventArgs->CurrentlyShownApplicationViewId,
ViewSizePreference::Default))
create_task(ApplicationViewSwitcher::TryShowAsStandaloneAsync(
frameService->GetViewId(),
ViewSizePreference::Default,
activatedEventArgs->CurrentlyShownApplicationViewId,
ViewSizePreference::Default))
.then(
[safeFrameServiceCreation](bool viewShown) {
// SafeFrameServiceCreation is used to automatically remove the frame
@@ -385,8 +387,8 @@ void App::OnAppLaunch(IActivatedEventArgs ^ args, String ^ argument)
if (activationViewSwitcher != nullptr)
{
activationViewSwitcher->ShowAsStandaloneAsync(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()),
ViewSizePreference::Default);
activationViewSwitcher->ShowAsStandaloneAsync(
ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()), ViewSizePreference::Default);
TraceLogger::GetInstance().LogNewWindowCreationEnd(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()));
TraceLogger::GetInstance().LogPrelaunchedAppActivatedByUser();
}

View File

@@ -47,7 +47,9 @@ namespace CalculatorApp
{
public:
SafeFrameWindowCreation(_In_ WindowFrameService ^ frameService, App ^ parent)
: m_frameService(frameService), m_frameOpenedInWindow(false), m_parent(parent)
: m_frameService(frameService)
, m_frameOpenedInWindow(false)
, m_parent(parent)
{
}

View File

@@ -9,7 +9,8 @@ namespace CalculatorApp
{
ref class AlwaysSelectedCollectionView sealed : public Windows::UI::Xaml::DependencyObject, public Windows::UI::Xaml::Data::ICollectionView
{
internal : AlwaysSelectedCollectionView(Windows::UI::Xaml::Interop::IBindableVector ^ source) : m_currentPosition(-1)
internal : AlwaysSelectedCollectionView(Windows::UI::Xaml::Interop::IBindableVector ^ source)
: m_currentPosition(-1)
{
m_source = source;
@@ -47,8 +48,8 @@ namespace CalculatorApp
throw ref new Platform::NotImplementedException();
}
property Windows::Foundation::Collections::IObservableVector<Platform::Object ^> ^ CollectionGroups {
virtual Windows::Foundation::Collections::IObservableVector<Platform::Object
^> ^ get() = Windows::UI::Xaml::Data::ICollectionView::CollectionGroups::get
virtual Windows::Foundation::Collections::IObservableVector<
Platform::Object ^> ^ get() = Windows::UI::Xaml::Data::ICollectionView::CollectionGroups::get
{
return ref new Platform::Collections::Vector<Platform::Object ^>();
}
@@ -80,8 +81,9 @@ namespace CalculatorApp
// restore the selection to the way we wanted it to begin with
if (m_currentPosition >= 0 && m_currentPosition < static_cast<int>(m_source->Size))
{
this->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler([this]() { m_currentChanged(this, nullptr); }));
this->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]() {
m_currentChanged(this, nullptr);
}));
}
return false;
}
@@ -167,14 +169,14 @@ namespace CalculatorApp
{
throw ref new Platform::NotImplementedException();
}
virtual unsigned int
GetMany(unsigned int /*startIndex*/,
Platform::WriteOnlyArray<Platform::Object ^> ^ /*items*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::GetMany
virtual unsigned int GetMany(
unsigned int /*startIndex*/,
Platform::WriteOnlyArray<Platform::Object ^> ^ /*items*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::GetMany
{
throw ref new Platform::NotImplementedException();
}
virtual Windows::Foundation::Collections::IVectorView<Platform::Object ^> ^ GetView() = Windows::Foundation::Collections::IVector<Platform::Object
^>::GetView
virtual Windows::Foundation::Collections::IVectorView<Platform::Object ^> ^ GetView() = Windows::Foundation::Collections::IVector<
Platform::Object ^>::GetView
{
throw ref new Platform::NotImplementedException();
}
@@ -263,8 +265,11 @@ namespace CalculatorApp
private:
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
{
auto result = dynamic_cast<Windows::UI::Xaml::Interop::IBindableVector ^>(value);
if (result)
@@ -275,8 +280,11 @@ namespace CalculatorApp
}
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
{
return Windows::UI::Xaml::DependencyProperty::UnsetValue;
}

View File

@@ -58,8 +58,8 @@ namespace CalculatorApp
#pragma region Tracing methods
void AppLifecycleLogger::LogAppLifecycleEvent(hstring const& eventName, LoggingFields const& fields) const
{
m_appLifecycleProvider.LogEvent(eventName, fields, LoggingLevel::Information,
LoggingOptions(MICROSOFT_KEYWORD_TELEMETRY | WINEVENT_KEYWORD_RESPONSE_TIME));
m_appLifecycleProvider.LogEvent(
eventName, fields, LoggingLevel::Information, LoggingOptions(MICROSOFT_KEYWORD_TELEMETRY | WINEVENT_KEYWORD_RESPONSE_TIME));
}
#pragma endregion

View File

@@ -50,7 +50,9 @@ DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, DisplayStringExpression);
StringReference CalculationResult::s_FocusedState(L"Focused");
StringReference CalculationResult::s_UnfocusedState(L"Unfocused");
CalculationResult::CalculationResult() : m_isScalingText(false), m_haveCalculatedMax(false)
CalculationResult::CalculationResult()
: m_isScalingText(false)
, m_haveCalculatedMax(false)
{
}

View File

@@ -9,7 +9,8 @@ using namespace Windows::UI::Xaml::Automation::Peers;
namespace CalculatorApp::Controls
{
CalculationResultAutomationPeer::CalculationResultAutomationPeer(FrameworkElement ^ owner) : FrameworkElementAutomationPeer(owner)
CalculationResultAutomationPeer::CalculationResultAutomationPeer(FrameworkElement ^ owner)
: FrameworkElementAutomationPeer(owner)
{
}

View File

@@ -155,8 +155,9 @@ void OverflowTextBlock::UpdateScrollButtons()
ShowHideScrollButtons(::Visibility::Collapsed, ::Visibility::Collapsed);
}
// We have more number on both side. Show both arrows
else if ((m_expressionContainer->HorizontalOffset > 0)
&& (m_expressionContainer->HorizontalOffset < (m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth)))
else if (
(m_expressionContainer->HorizontalOffset > 0)
&& (m_expressionContainer->HorizontalOffset < (m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth)))
{
ShowHideScrollButtons(::Visibility::Visible, ::Visibility::Visible);
}

View File

@@ -10,7 +10,8 @@ using namespace Windows::Foundation::Collections;
namespace CalculatorApp::Controls
{
OverflowTextBlockAutomationPeer::OverflowTextBlockAutomationPeer(OverflowTextBlock ^ owner) : FrameworkElementAutomationPeer(owner)
OverflowTextBlockAutomationPeer::OverflowTextBlockAutomationPeer(OverflowTextBlock ^ owner)
: FrameworkElementAutomationPeer(owner)
{
}

View File

@@ -14,11 +14,17 @@ namespace CalculatorApp
{
public:
virtual Platform::Object
^ Convert(_In_ Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, _In_ Platform::Object ^ parameter,
_In_ Platform::String ^ language);
^ Convert(
_In_ Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
_In_ Platform::Object ^ parameter,
_In_ Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(_In_ Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, _In_ Platform::Object ^ parameter,
_In_ Platform::String ^ language);
^ ConvertBack(
_In_ Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
_In_ Platform::Object ^ parameter,
_In_ Platform::String ^ language);
};
}
}

View File

@@ -16,8 +16,11 @@ namespace CalculatorApp
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language);
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}
}

View File

@@ -23,8 +23,11 @@ namespace CalculatorApp
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language);
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
/// <summary>
@@ -38,8 +41,11 @@ namespace CalculatorApp
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language);
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}

View File

@@ -13,8 +13,11 @@ namespace CalculatorApp
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language);
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
public
@@ -24,8 +27,11 @@ namespace CalculatorApp
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language);
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}
}

View File

@@ -16,8 +16,11 @@ namespace CalculatorApp
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language);
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}
}

View File

@@ -16,8 +16,11 @@ namespace CalculatorApp
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter,
Platform::String ^ language);
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}
}

View File

@@ -13,7 +13,9 @@ namespace Numbers
ref class MemorySlot sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
MemorySlot(int slotPosition, Platform::String ^ value) : m_SlotPosition(slotPosition), m_SlotValue(value)
MemorySlot(int slotPosition, Platform::String ^ value)
: m_SlotPosition(slotPosition)
, m_SlotValue(value)
{
}
@@ -35,7 +37,10 @@ namespace Numbers
{
public:
StandardCalculatorViewModel()
: m_DisplayValue("1234569"), m_DisplayStringExpression("14560 x 1890"), m_DegreeButtonContent("Deg"), m_IsMemoryEmpty(false)
: m_DisplayValue("1234569")
, m_DisplayStringExpression("14560 x 1890")
, m_DegreeButtonContent("Deg")
, m_IsMemoryEmpty(false)
{
m_MemorizedNumbers = ref new Platform::Collections::Vector<MemorySlot ^>();
for (int i = 1000; i < 1100; i++)

View File

@@ -21,11 +21,15 @@ namespace Numbers
ref class CategoryViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
CategoryViewModel(Platform::String ^ name) : m_Name(name), m_NegateVisibility(Windows::UI::Xaml::Visibility::Collapsed)
CategoryViewModel(Platform::String ^ name)
: m_Name(name)
, m_NegateVisibility(Windows::UI::Xaml::Visibility::Collapsed)
{
}
CategoryViewModel(Platform::String ^ name, Windows::UI::Xaml::Visibility negateVisibility) : m_Name(name), m_NegateVisibility(negateVisibility)
CategoryViewModel(Platform::String ^ name, Windows::UI::Xaml::Visibility negateVisibility)
: m_Name(name)
, m_NegateVisibility(negateVisibility)
{
}
@@ -39,7 +43,9 @@ namespace Numbers
ref class UnitViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
UnitViewModel(Platform::String ^ unit, Platform::String ^ abbr) : m_Name(unit), m_Abbreviation(abbr)
UnitViewModel(Platform::String ^ unit, Platform::String ^ abbr)
: m_Name(unit)
, m_Abbreviation(abbr)
{
}
@@ -53,7 +59,8 @@ namespace Numbers
ref class UnitConverterSupplementaryResultViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
UnitConverterSupplementaryResultViewModel(Platform::String ^ value, Platform::String ^ unit, Platform::String ^ abbr) : m_Value(value)
UnitConverterSupplementaryResultViewModel(Platform::String ^ value, Platform::String ^ unit, Platform::String ^ abbr)
: m_Value(value)
{
m_Unit = ref new UnitViewModel(unit, abbr);
}
@@ -68,7 +75,11 @@ namespace Numbers
ref class UnitConverterViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
UnitConverterViewModel() : m_Value1("Åy24"), m_Value2("Åy183"), m_Value1Active(true), m_Value2Active(false)
UnitConverterViewModel()
: m_Value1("Åy24")
, m_Value2("Åy183")
, m_Value1Active(true)
, m_Value2Active(false)
{
m_SupplementaryResults = ref new Platform::Collections::Vector<UnitConverterSupplementaryResultViewModel ^>();
m_SupplementaryResults->Append(ref new UnitConverterSupplementaryResultViewModel("128", "Kilograms", "Kgs"));

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;

View File

@@ -43,8 +43,8 @@ public
WindowFrameService(_In_ Windows::UI::Xaml::Controls::Frame ^ viewFrame, Platform::WeakReference parent);
void InitializeFrameService(bool createdByUs);
void OnConsolidated(_In_ Windows::UI::ViewManagement::ApplicationView ^ sender,
_In_ Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs ^ e);
void
OnConsolidated(_In_ Windows::UI::ViewManagement::ApplicationView ^ sender, _In_ Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs ^ e);
void OnClosed(_In_ Windows::UI::Core::CoreWindow ^ sender, _In_ Windows::UI::Core::CoreWindowEventArgs ^ args);
void LogOnViewClosed(_In_ Windows::UI::Core::CoreWindow ^ coreWindow);