Removing Tizen.Xamarin.Forms.Extensions
[profile/tv/apps/dotnet/mediahub.git] / TVMediaHub / TVMediaHub.Tizen / Extensions / ToastProxy.cs
1 using System;
2 using Xamarin.Forms;
3
4 namespace Tizen.Xamarin.Forms.Extension
5 {
6     /// <summary>
7     /// This class is for the internal use by toast.
8     /// </summary>
9     internal class ToastProxy : IToast
10     {
11         IToast _toastProxy = null;
12
13         public ToastProxy()
14         {
15             _toastProxy = DependencyService.Get<IToast>(DependencyFetchTarget.NewInstance);
16
17             if (_toastProxy == null)
18                 throw new Exception("RealObject is null, Internal instance via DependecyService was not created.");
19         }
20
21         public int Duration
22         {
23             get
24             {
25                 return _toastProxy.Duration;
26             }
27
28             set
29             {
30                 _toastProxy.Duration = value;
31             }
32         }
33
34         public string Text
35         {
36             get
37             {
38                 return _toastProxy.Text;
39             }
40
41             set
42             {
43                 _toastProxy.Text = value;
44             }
45         }
46
47         public void Dismiss()
48         {
49             _toastProxy.Dismiss();
50         }
51
52         public void Show()
53         {
54             _toastProxy.Show();
55         }
56     }
57 }