using System;
using UIKit;
namespace Shared
{
public class HDLUtils
{
public static int RectCornerTopLeft = 1;
public static int RectCornerTopRight = 2;
public static int RectCornerBottomLeft = 4;
public static int RectCornerBottomRight = 8;
///
/// 全局打印
///
public static void WriteLine(object mes)
{
#if DEBUG
Console.WriteLine (mes);
#endif
}
public static void RestartApp() {
//Com.Hdl.Widget.
BaseApplicationDelegate DD = (BaseApplicationDelegate)UIApplication.SharedApplication.Delegate;
DD.setHDLRootViewController();
}
public static UIColor GetUIColorWithUint(uint uintColor)
{
byte r, g, b, a;
r = (byte)(uintColor / 256 / 256 % 256);
g = (byte)(uintColor / 256 % 256);
b = (byte)(uintColor % 256);
a = (byte)(uintColor / 256 / 256 / 256 % 256);
return UIKit.UIColor.FromRGBA(r, g, b, a);
}
///
/// 生成二维码
///
public static UIImage createQRCode(string url, int size = 500)
{
//return HDLUtlisXM.CreateQRCode(url, size);
return null;
}
///
/// 跳转打开APP或者App Store下载地址
///
///
public static void OpenUrl(string url)
{
UIApplication.SharedApplication.OpenUrl(new Foundation.NSUrl(url));
//if (UIApplication.SharedApplication.CanOpenUrl(new Foundation.NSUrl(url)))
//{
// UIApplication.SharedApplication.OpenUrl(new Foundation.NSUrl(url));
//}
}
///
/// 跳转打开APP
///
///
public static void OpenApp(string url)
{
UIApplication.SharedApplication.OpenUrl(new Foundation.NSUrl(url));
}
}
}