blob: 899056dab0d4f86ab5f2fc60d3583ee0fe01b3c4 (
plain)
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
|
using System;
#if __UNIFIED__
using UIKit;
#else
using MonoTouch.UIKit;
#endif
namespace Xamarin.Forms
{
[AttributeUsage (AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class ExportRendererAttribute : HandlerAttribute {
internal bool Idiomatic { get; private set; }
internal UIUserInterfaceIdiom Idiom { get; private set; }
public ExportRendererAttribute (Type handler, Type target, UIUserInterfaceIdiom idiom)
: base (handler, target) {
Idiomatic = true;
Idiom = idiom;
}
public ExportRendererAttribute (Type handler, Type target)
: base (handler, target) {
Idiomatic = false;
}
public override bool ShouldRegister () {
return !Idiomatic || Idiom == UIDevice.CurrentDevice.UserInterfaceIdiom;
}
}
}
|