Пример #1
0
            public override void Clicked(UIAlertView alertview, nint buttonIndex)
            {
                if (alertview == _parent._preAVPermissionAlertView)
                {
                    if (buttonIndex == alertview.CancelButtonIndex)
                    {
                        // User said NO, jerk.
                        _parent.FireAVPermissionCompletionHandlerWithType((ClusterAVAuthorizationType)(int)alertview.Tag);
                    }
                    else
                    {
                        // User granted access, now show the REAL permissions dialog
                        _parent.ShowActualAVPermissionAlertWithType((ClusterAVAuthorizationType)(int)alertview.Tag);
                    }

                    _parent._preAVPermissionAlertView = null;
                }
                else if (alertview == _parent._prePhotoPermissionAlertView)
                {
                    if (buttonIndex == alertview.CancelButtonIndex)
                    {
                        // User said NO, jerk.
                        _parent.FirePhotoPermissionCompletionHandler();
                    }
                    else
                    {
                        // User granted access, now show the REAL permissions dialog
                        _parent.ShowActualPhotoPermissionAlert();
                    }

                    _parent._prePhotoPermissionAlertView = null;
                }
                else if (alertview == _parent._preContactPermissionAlertView)
                {
                    if (buttonIndex == alertview.CancelButtonIndex)
                    {
                        // User said NO, that jerk.
                        _parent.FireContactPermissionCompletionHandler();
                    }
                    else
                    {
                        // User granted access, now try to trigger the real contacts access
                        _parent.ShowActualContactPermissionAlert();
                    }
                }
                else if (alertview == _parent._preEventPermissionAlertView)
                {
                    if (buttonIndex == alertview.CancelButtonIndex)
                    {
                        // User said NO, that jerk.
                        _parent.FireEventPermissionCompletionHandler((ClusterEventAuthorizationType)((int)alertview.Tag));
                    }
                    else
                    {
                        // User granted access, now try to trigger the real contacts access
                        _parent.ShowActualEventPermissionAlert((ClusterEventAuthorizationType)((int)alertview.Tag));
                    }
                }
                else if (alertview == _parent._preLocationPermissionAlertView)
                {
                    if (buttonIndex == alertview.CancelButtonIndex)
                    {
                        // User said NO, that jerk.
                        _parent.FireLocationPermissionCompletionHandler();
                    }
                    else
                    {
                        // User granted access, now try to trigger the real location access
                        _parent.ShowActualLocationPermissionAlert();
                    }
                }
            }