2021-10-25 21:40:19 +08:00
|
|
|
#include "pch.h"
|
|
|
|
#include "PatternSnippet.h"
|
|
|
|
#include "PatternSnippet.g.cpp"
|
|
|
|
|
2022-05-11 22:38:12 +08:00
|
|
|
namespace winrt::PowerRenameUI::implementation
|
2021-10-25 21:40:19 +08:00
|
|
|
{
|
|
|
|
PatternSnippet::PatternSnippet(hstring const& code, hstring const& description) :
|
|
|
|
m_code{ code }, m_description{ description }
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
hstring PatternSnippet::Code()
|
|
|
|
{
|
|
|
|
return m_code;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PatternSnippet::Code(hstring const& value)
|
|
|
|
{
|
|
|
|
if (m_code != value)
|
|
|
|
{
|
|
|
|
m_code = value;
|
2022-05-11 22:38:12 +08:00
|
|
|
m_propertyChanged(*this, Microsoft::UI::Xaml::Data::PropertyChangedEventArgs{ L"Code" });
|
2021-10-25 21:40:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
hstring PatternSnippet::Description()
|
|
|
|
{
|
|
|
|
return m_description;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PatternSnippet::Description(hstring const& value)
|
|
|
|
{
|
|
|
|
if (m_description != value)
|
|
|
|
{
|
|
|
|
m_description = value;
|
2022-05-11 22:38:12 +08:00
|
|
|
m_propertyChanged(*this, Microsoft::UI::Xaml::Data::PropertyChangedEventArgs{ L"Description" });
|
2021-10-25 21:40:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-11 22:38:12 +08:00
|
|
|
winrt::event_token PatternSnippet::PropertyChanged(winrt::Microsoft::UI::Xaml::Data::PropertyChangedEventHandler const& handler)
|
2021-10-25 21:40:19 +08:00
|
|
|
{
|
|
|
|
return m_propertyChanged.add(handler);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PatternSnippet::PropertyChanged(winrt::event_token const& token) noexcept
|
|
|
|
{
|
|
|
|
m_propertyChanged.remove(token);
|
|
|
|
}
|
|
|
|
}
|