-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathStaticClass.cpp
More file actions
45 lines (38 loc) · 1.2 KB
/
Copy pathStaticClass.cpp
File metadata and controls
45 lines (38 loc) · 1.2 KB
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
#include "pch.h"
#include "StaticClass.h"
#include "StaticClass.g.cpp"
namespace winrt::test_component::implementation
{
test_component::Fruit StaticClass::s_fruit = test_component::Fruit::Orange;
test_component::Fruit StaticClass::EnumProperty()
{
return s_fruit;
}
void StaticClass::EnumProperty(test_component::Fruit const& value)
{
s_fruit = value;
}
hstring StaticClass::InEnum(test_component::Signed const& value)
{
switch (value)
{
case test_component::Signed::First: return L"First";
case test_component::Signed::Second: return L"Second";
case test_component::Signed::Third: return L"Third";
default: throw hresult_invalid_argument();
}
}
hstring StaticClass::InNonBlittableStruct(test_component::NonBlittableStruct const& value)
{
hstring result{};
for (int32_t i = 0; i < value.Third; i++)
{
result = result + value.First + value.Second + value.Fourth;
}
return result;
}
void StaticClass::TakeBase(test_component::Base const& base)
{
base.DoTheThing();
}
}