зеркало из https://github.com/microsoft/TestWinRT.git
Added event properties to benchmark event sources (#50)
This commit is contained in:
Родитель
a4ed612db0
Коммит
45c6a357c0
|
@ -177,4 +177,30 @@ namespace winrt::BenchmarkComponent::implementation
|
|||
{
|
||||
}
|
||||
|
||||
int32_t ClassWithMarshalingRoutines::IntProperty()
|
||||
{
|
||||
return _int;
|
||||
}
|
||||
void ClassWithMarshalingRoutines::IntProperty(int32_t value)
|
||||
{
|
||||
_int = value;
|
||||
_intChanged(*this, _int);
|
||||
}
|
||||
winrt::event_token ClassWithMarshalingRoutines::IntPropertyChanged(EventHandler<int32_t> const& handler)
|
||||
{
|
||||
return _intChanged.add(handler);
|
||||
}
|
||||
void ClassWithMarshalingRoutines::IntPropertyChanged(winrt::event_token const& token) noexcept
|
||||
{
|
||||
_intChanged.remove(token);
|
||||
}
|
||||
void ClassWithMarshalingRoutines::RaiseIntChanged()
|
||||
{
|
||||
_intChanged(*this, _int);
|
||||
}
|
||||
void ClassWithMarshalingRoutines::CallForInt(BenchmarkComponent::ProvideInt const& provideInt)
|
||||
{
|
||||
_int = provideInt();
|
||||
}
|
||||
|
||||
}
|
|
@ -46,6 +46,9 @@ namespace winrt::BenchmarkComponent::implementation
|
|||
Windows::Foundation::IReference<INT32> createNullableObject();
|
||||
Windows::Foundation::IReferenceArray<int> createArrayObject();
|
||||
|
||||
int32_t _int = 0;
|
||||
winrt::event<Windows::Foundation::EventHandler<int32_t>> _intChanged;
|
||||
|
||||
public:
|
||||
ClassWithMarshalingRoutines();
|
||||
|
||||
|
@ -72,6 +75,13 @@ namespace winrt::BenchmarkComponent::implementation
|
|||
|
||||
BenchmarkComponent::WrappedClass NewWrappedClassObject();
|
||||
void NewWrappedClassObject(BenchmarkComponent::WrappedClass val);
|
||||
|
||||
int32_t IntProperty();
|
||||
void IntProperty(int32_t value);
|
||||
winrt::event_token IntPropertyChanged(Windows::Foundation::EventHandler<int32_t> const& handler);
|
||||
void IntPropertyChanged(winrt::event_token const& token) noexcept;
|
||||
void RaiseIntChanged();
|
||||
void CallForInt(BenchmarkComponent::ProvideInt const& provideInt);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ namespace BenchmarkComponent
|
|||
Double DoubleProperty{ get; set; };
|
||||
}
|
||||
|
||||
delegate Int32 ProvideInt();
|
||||
|
||||
// Class intended to help with benchmarking QueryInterface for the default and non default interfaces.
|
||||
[default_interface]
|
||||
runtimeclass ClassWithMultipleInterfaces :
|
||||
|
@ -57,5 +59,10 @@ namespace BenchmarkComponent
|
|||
IInspectable ExistingTypeErasedArrayObject{ get; set; };
|
||||
|
||||
WrappedClass NewWrappedClassObject{ get; set; };
|
||||
|
||||
Int32 IntProperty;
|
||||
event Windows.Foundation.EventHandler<Int32> IntPropertyChanged;
|
||||
void RaiseIntChanged();
|
||||
void CallForInt(ProvideInt provideInt);
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче