-
Notifications
You must be signed in to change notification settings - Fork 16
/
Simple.cpp
80 lines (70 loc) · 2.33 KB
/
Simple.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "pch.h"
#include "Simple.h"
#include "Simple.g.cpp"
namespace winrt::test_component::implementation
{
winrt::event<Windows::Foundation::EventHandler<Windows::Foundation::IInspectable>> Simple::s_staticEvent = {};
void Simple::Method()
{
throw hresult_not_implemented();
}
Windows::Foundation::IReference<int32_t> Simple::Reference(Windows::Foundation::DateTime const&)
{
throw hresult_not_implemented();
}
Windows::Foundation::IAsyncOperation<int32_t> Simple::Operation(Windows::Foundation::DateTime)
{
throw hresult_not_implemented();
}
Windows::Foundation::IAsyncAction Simple::Action(Windows::Foundation::DateTime)
{
throw hresult_not_implemented();
}
Windows::Foundation::IInspectable Simple::Object(Windows::Foundation::DateTime const&)
{
throw hresult_not_implemented();
}
winrt::event_token Simple::SignalEvent(test_component::Delegates::SignalDelegate const& handler)
{
return m_signalEvent.add(handler);
}
void Simple::SignalEvent(winrt::event_token const& token) noexcept
{
m_signalEvent.remove(token);
}
void Simple::FireEvent()
{
m_signalEvent();
m_inEvent(L"You're Fired");
auto args = test_component::SimpleEventArgs{};
m_simpleEvent(*this, args);
}
winrt::event_token Simple::InEvent(test_component::Delegates::InDelegate const& handler)
{
return m_inEvent.add(handler);
}
void Simple::InEvent(winrt::event_token const& token) noexcept
{
m_inEvent.remove(token);
}
event_token Simple::StaticEvent(Windows::Foundation::EventHandler<IInspectable> const& handler)
{
return s_staticEvent.add(handler);
}
void Simple::StaticEvent(event_token token)
{
s_staticEvent.remove(token);
}
void Simple::FireStaticEvent()
{
s_staticEvent(nullptr,nullptr);
}
winrt::event_token Simple::SimpleEvent(Windows::Foundation::TypedEventHandler<test_component::Simple, test_component::SimpleEventArgs> const& handler)
{
return m_simpleEvent.add(handler);
}
void Simple::SimpleEvent(winrt::event_token const& token) noexcept
{
m_simpleEvent.remove(token);
}
}