forked from xamarin-automation-service/uitest-pop-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlatformQuery.cs
39 lines (35 loc) · 882 Bytes
/
PlatformQuery.cs
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
using System;
using Xamarin.UITest;
using Xamarin.UITest.Queries;
namespace Xamarin.UITest.POPSample
{
public class PlatformQuery
{
public Func<AppQuery, AppQuery> Android
{
set
{
if (AppManager.Platform == Platform.Android)
current = value;
}
}
public Func<AppQuery, AppQuery> iOS
{
set
{
if (AppManager.Platform == Platform.iOS)
current = value;
}
}
Func<AppQuery, AppQuery> current;
public Func<AppQuery, AppQuery> Current
{
get
{
if (current == null)
throw new NullReferenceException("Trait not set for current platform");
return current;
}
}
}
}