using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace TINK.View
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
	public partial class InfoPage : ContentPage
	{
		public InfoPage ()
		{
			InitializeComponent ();

#if __IOS__
var resourcePrefix = "TINK.iOS.";
#endif
#if __ANDROID__
            var resourcePrefix = "TINK.Droid.";
#endif
#if WINDOWS_PHONE
var resourcePrefix = "TINK.WinPhone.";
#endif

            Debug.WriteLine("Using this resource prefix: " + resourcePrefix);
            // note that the prefix includes the trailing period '.' that is required
            var assembly = typeof(InfoPage).GetTypeInfo().Assembly;
            Stream stream = assembly.GetManifestResourceStream
                (resourcePrefix + "HtmlResouces.Info.html");
            var l_oHtmlViewSource = new HtmlWebViewSource
            {
                Html = (new StreamReader(stream, Encoding.UTF8)).ReadToEnd()
            };
            InfoWebView.Source = l_oHtmlViewSource;
        }
    }
}