コード例 #1
0
        static public void Init(Action <Action> uiDispatcher = null)
        {
            if (uiDispatcher == null)
            {
                var dispatcher = Application.Current.MainWindow.Dispatcher;

                C8o.defaultUiDispatcher = code =>
                {
                    dispatcher.BeginInvoke(code);
                };

                C8o.defaultIsUi = () =>
                {
                    return(Thread.CurrentThread == dispatcher.Thread);
                };
            }
            else
            {
                C8o.defaultUiDispatcher = uiDispatcher;
            }

            C8o.defaultBgDispatcher = (code) => {
                new Thread(() =>
                {
                    code();
                }).Start();
            };

            C8o.deviceUUID = new HardwareHelper().GetHardwareID();

            C8oHTTPsProxy.Init();
            C8oPlatformCommon.Init();
        }
コード例 #2
0
        static public void Init()
        {
            Handler mainLooperHandler = new Handler(Looper.MainLooper);

            C8o.defaultIsUi = () =>
            {
                return(Looper.MyLooper() == Looper.MainLooper);
            };

            C8o.defaultUiDispatcher = code =>
            {
                if (C8o.defaultIsUi())
                {
                    code.Invoke();
                }
                else
                {
                    mainLooperHandler.Post(code);
                }
            };

            C8o.deviceUUID = Android.OS.Build.Serial;

            C8oPlatformCommon.Init();
        }
コード例 #3
0
        static public void Init()
        {
            C8o.defaultIsUi = () =>
            {
                return(NSThread.IsMain);
            };

            C8o.defaultUiDispatcher = new NSObject().BeginInvokeOnMainThread;

            C8oPlatformCommon.Init();
        }