2017-09-28 14:52:27 +03:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using Xamarin.Forms.Internals;
|
|
|
|
|
using Xamarin.Forms.Platform.GTK;
|
|
|
|
|
|
|
|
|
|
namespace Xamarin.Forms
|
|
|
|
|
{
|
2018-09-20 22:11:20 +03:00
|
|
|
|
public static class Forms
|
|
|
|
|
{
|
|
|
|
|
internal static string BarTextColor = "Xamarin.BarTextColor";
|
|
|
|
|
internal static string BarBackgroundColor = "Xamarin.BarBackgroundColor";
|
2017-09-28 14:52:27 +03:00
|
|
|
|
|
2018-09-20 22:11:20 +03:00
|
|
|
|
const string LogFormat = "[{0}] {1}";
|
2017-09-28 14:52:27 +03:00
|
|
|
|
|
2018-09-20 22:11:20 +03:00
|
|
|
|
public static bool IsInitialized { get; private set; }
|
2017-09-28 14:52:27 +03:00
|
|
|
|
|
2018-09-20 22:11:20 +03:00
|
|
|
|
public static void Init(IEnumerable<Assembly> rendererAssemblies = null)
|
|
|
|
|
{
|
|
|
|
|
if (IsInitialized)
|
|
|
|
|
return;
|
2017-09-28 14:52:27 +03:00
|
|
|
|
|
2018-09-20 22:11:20 +03:00
|
|
|
|
Log.Listeners.Add(new DelegateLogListener((c, m) => Debug.WriteLine(LogFormat, c, m)));
|
2017-09-28 14:52:27 +03:00
|
|
|
|
|
2018-09-20 22:11:20 +03:00
|
|
|
|
Registrar.ExtraAssemblies = rendererAssemblies?.ToArray();
|
2017-09-28 14:52:27 +03:00
|
|
|
|
|
2018-09-20 22:11:20 +03:00
|
|
|
|
IsInitialized = true;
|
2017-09-28 14:52:27 +03:00
|
|
|
|
|
2018-09-20 22:11:20 +03:00
|
|
|
|
Device.SetIdiom(TargetIdiom.Desktop);
|
|
|
|
|
Device.PlatformServices = new GtkPlatformServices();
|
|
|
|
|
Device.Info = new GtkDeviceInfo();
|
|
|
|
|
Color.SetAccent(Color.FromHex("#3498DB"));
|
|
|
|
|
ExpressionSearch.Default = new GtkExpressionSearch();
|
2017-09-28 14:52:27 +03:00
|
|
|
|
|
2018-09-20 22:11:20 +03:00
|
|
|
|
Registrar.RegisterAll(new[]
|
|
|
|
|
{
|
|
|
|
|
typeof(ExportCellAttribute),
|
|
|
|
|
typeof(ExportImageSourceHandlerAttribute),
|
|
|
|
|
typeof(ExportRendererAttribute)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-09-28 14:52:27 +03:00
|
|
|
|
}
|