Beispiel #1
0
        /// <summary> U3DXT internal. </summary>
        protected void _Init()
        {
            _service.RequestAccessToAccounts(_accountType, _options, delegate(bool granted, NSError error) {
                CoreXT.RunOnMainThread(delegate() {
                    if (granted)
                    {
                        var accounts = _service.FindAccounts(_accountType);
                        if ((accounts != null) && (accounts.Length > 0))
                        {
                            _account = accounts[0] as ACAccount;
                            if (_initializationCompletedHandlers != null)
                            {
                                _initializationCompletedHandlers(this, EventArgs.Empty);
                            }
                            return;
                        }
                    }

                    _account = null;
                    if (_initializationFailedHandlers != null)
                    {
                        _initializationFailedHandlers(this, (error != null) ? new U3DXTErrorEventArgs(error) : new U3DXTErrorEventArgs(0, "", "No account setup or permission denied."));
                    }
                });
            });
        }