-
Notifications
You must be signed in to change notification settings - Fork 16
/
AsyncOperationInt.h
28 lines (24 loc) · 1.06 KB
/
AsyncOperationInt.h
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
#pragma once
#include "AsyncOperationInt.g.h"
namespace winrt::test_component::implementation
{
class AsyncOperationInt : public AsyncOperationIntT<AsyncOperationInt>
{
winrt::Windows::Foundation::AsyncStatus status = winrt::Windows::Foundation::AsyncStatus::Started;
winrt::hresult errorCode = S_OK;
int32_t result = 0;
winrt::Windows::Foundation::AsyncOperationCompletedHandler<int32_t> completedHandler;
public:
AsyncOperationInt() = default;
uint32_t Id() { return 42; }
winrt::Windows::Foundation::AsyncStatus Status() { return status; }
winrt::hresult ErrorCode() { return errorCode; }
void Cancel();
void Close() {}
void Complete(int32_t result);
void CompleteWithError(winrt::hresult errorCode);
void Completed(winrt::Windows::Foundation::AsyncOperationCompletedHandler<int32_t> const& handler);
winrt::Windows::Foundation::AsyncOperationCompletedHandler<int32_t> Completed() { return completedHandler; }
int32_t GetResults();
};
}