summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Extensions/KeyboardExtensions.cs
blob: 000b6bb2140fdbbdfb056376d2c4f0205781a187 (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
31
32
33
34
35
36
37
38
39
40
41
42
namespace Xamarin.Forms.Platform.Tizen
{
	public static class KeyboardExtensions
	{
		/// <summary>
		/// Creates an instance of ElmSharp.Keyboard reflecting the provided Xamarin.Forms.Keyboard instance
		/// </summary>
		/// <returns>Keyboard type corresponding to the provided Xamarin.Forms.Keyboard</returns>
		/// <param name="keyboard">The Xamarin.Forms.Keyboard class instance to be converted to ElmSharp.Keyboard.</param>
		public static Native.Keyboard ToNative(this Keyboard keyboard)
		{
			if (keyboard is TextKeyboard)
			{
				return Native.Keyboard.Normal;
			}
			else if (keyboard is NumericKeyboard)
			{
				return Native.Keyboard.Number;
			}
			else if (keyboard is TelephoneKeyboard)
			{
				return Native.Keyboard.PhoneNumber;
			}
			else if (keyboard is EmailKeyboard)
			{
				return Native.Keyboard.Email;
			}
			else if (keyboard is UrlKeyboard)
			{
				return Native.Keyboard.Url;
			}
			else if (keyboard is ChatKeyboard)
			{
				return Native.Keyboard.Emoticon;
			}
			else
			{
				return Native.Keyboard.Normal;
			}
		}
	}
}