wxr
2020-06-15 b8e94316e41eba72d927d5ca7d931b26139ee8ff
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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;
 
        /// <summary>
        /// 全局打印
        /// </summary>
        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);
        }
 
        /// <summary>
        /// 生成二维码
        /// </summary>
        public static UIImage createQRCode(string url, int size = 500)
        {
            //return HDLUtlisXM.CreateQRCode(url, size);
 
            return null;
        }
 
        /// <summary>
        /// 跳转打开APP或者App Store下载地址
        /// </summary>
        /// <param name="url"></param>
        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));
            //}
        }
 
        /// <summary>
        /// 跳转打开APP
        /// </summary>
        /// <param name="url"></param>
        public static void OpenApp(string url)
        {
            UIApplication.SharedApplication.OpenUrl(new Foundation.NSUrl(url));
        }
 
    }
}