Beispiel #1
0
        public void ShowContactsPermissionsWithTitle(string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
        {
            if (requestTitle.Length == 0)
            {
                requestTitle = @"Access Contacts?";
            }
            denyButtonTitle  = GetTitleForType(ClusterTitleType.Deny, denyButtonTitle);
            grantButtonTitle = GetTitleForType(ClusterTitleType.Request, grantButtonTitle);

            ABAuthorizationStatus status = ABAddressBook.GetAuthorizationStatus();

            if (status == ABAuthorizationStatus.NotDetermined)
            {
                _contactPermissionCompletionHandler = completionHandler;
                _preContactPermissionAlertView      = new UIAlertView(requestTitle, message, new AlertViewDelegate(this), denyButtonTitle, grantButtonTitle);
                _preContactPermissionAlertView.Show();
            }
            else
            {
                if (completionHandler != null)
                {
                    completionHandler((status == ABAuthorizationStatus.Authorized),
                                      ClusterDialogResult.NoActionTaken,
                                      ClusterDialogResult.NoActionTaken);
                }
            }
        }
Beispiel #2
0
        void FirePhotoPermissionCompletionHandler()
        {
            ALAuthorizationStatus status = ALAssetsLibrary.AuthorizationStatus;

            if (_photoPermissionCompletionHandler != null)
            {
                ClusterDialogResult userDialogResult   = ClusterDialogResult.Granted;
                ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
                if (status == ALAuthorizationStatus.NotDetermined)
                {
                    userDialogResult   = ClusterDialogResult.Denied;
                    systemDialogResult = ClusterDialogResult.NoActionTaken;
                }
                else if (status == ALAuthorizationStatus.Authorized)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Granted;
                }
                else if (status == ALAuthorizationStatus.Denied)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Denied;
                }
                else if (status == ALAuthorizationStatus.Restricted)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.ParentallyRestricted;
                }
                _photoPermissionCompletionHandler((status == ALAuthorizationStatus.Authorized),
                                                  userDialogResult,
                                                  systemDialogResult);
                _photoPermissionCompletionHandler = null;
            }
        }
Beispiel #3
0
        void FireContactPermissionCompletionHandler()
        {
            ABAuthorizationStatus status = ABAddressBook.GetAuthorizationStatus();

            if (_contactPermissionCompletionHandler != null)
            {
                ClusterDialogResult userDialogResult   = ClusterDialogResult.Granted;
                ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
                if (status == ABAuthorizationStatus.NotDetermined)
                {
                    userDialogResult   = ClusterDialogResult.Denied;
                    systemDialogResult = ClusterDialogResult.NoActionTaken;
                }
                else if (status == ABAuthorizationStatus.Authorized)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Granted;
                }
                else if (status == ABAuthorizationStatus.Denied)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Denied;
                }
                else if (status == ABAuthorizationStatus.Restricted)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.ParentallyRestricted;
                }
                _contactPermissionCompletionHandler((status == ABAuthorizationStatus.Authorized),
                                                    userDialogResult,
                                                    systemDialogResult);
                _contactPermissionCompletionHandler = null;
            }
        }
Beispiel #4
0
        void FireEventPermissionCompletionHandler(ClusterEventAuthorizationType eventType)
        {
            EKAuthorizationStatus status = EKEventStore.GetAuthorizationStatus(EKEquivalentEventType(eventType));

            if (_eventPermissionCompletionHandler != null)
            {
                ClusterDialogResult userDialogResult   = ClusterDialogResult.Granted;
                ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
                if (status == EKAuthorizationStatus.NotDetermined)
                {
                    userDialogResult   = ClusterDialogResult.Denied;
                    systemDialogResult = ClusterDialogResult.NoActionTaken;
                }
                else if (status == EKAuthorizationStatus.Authorized)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Granted;
                }
                else if (status == EKAuthorizationStatus.Denied)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Denied;
                }
                else if (status == EKAuthorizationStatus.Restricted)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.ParentallyRestricted;
                }
                _eventPermissionCompletionHandler((status == EKAuthorizationStatus.Authorized),
                                                  userDialogResult,
                                                  systemDialogResult);
                _eventPermissionCompletionHandler = null;
            }
        }
Beispiel #5
0
        public void ShowLocationPermissionsForAuthorizationType(ClusterLocationAuthorizationType authorizationType, string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
        {
            if (requestTitle.Length == 0)
            {
                requestTitle = @"Access Location?";
            }
            denyButtonTitle  = GetTitleForType(ClusterTitleType.Deny, denyButtonTitle);
            grantButtonTitle = GetTitleForType(ClusterTitleType.Request, grantButtonTitle);

            var status = CLLocationManager.Status;

            if (status == CLAuthorizationStatus.NotDetermined)
            {
                _locationPermissionCompletionHandler = completionHandler;
                _locationAuthorizationType           = authorizationType;
                _preLocationPermissionAlertView      = new UIAlertView(requestTitle, message, new AlertViewDelegate(this), denyButtonTitle, grantButtonTitle);
                _preLocationPermissionAlertView.Show();
            }
            else
            {
                if (completionHandler != null)
                {
                    completionHandler(LocationAuthorizationStatusPermitsAccess(status),
                                      ClusterDialogResult.NoActionTaken,
                                      ClusterDialogResult.NoActionTaken);
                }
            }
        }
Beispiel #6
0
        void FireAVPermissionCompletionHandlerWithType(ClusterAVAuthorizationType mediaType)
        {
            AVAuthorizationStatus status = AVCaptureDevice.GetAuthorizationStatus(AVEquivalentMediaType(mediaType));

            if (_avPermissionCompletionHandler != null)
            {
                ClusterDialogResult userDialogResult   = ClusterDialogResult.Granted;
                ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
                if (status == AVAuthorizationStatus.NotDetermined)
                {
                    userDialogResult   = ClusterDialogResult.Denied;
                    systemDialogResult = ClusterDialogResult.NoActionTaken;
                }
                else if (status == AVAuthorizationStatus.Authorized)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Granted;
                }
                else if (status == AVAuthorizationStatus.Denied)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Denied;
                }
                else if (status == AVAuthorizationStatus.Restricted)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.ParentallyRestricted;
                }
                _avPermissionCompletionHandler((status == AVAuthorizationStatus.Authorized),
                                               userDialogResult,
                                               systemDialogResult);
                _avPermissionCompletionHandler = null;
            }
        }
Beispiel #7
0
        void FireLocationPermissionCompletionHandler()
        {
            var status = CLLocationManager.Status;

            if (_locationPermissionCompletionHandler != null)
            {
                ClusterDialogResult userDialogResult   = ClusterDialogResult.Granted;
                ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
                if (status == CLAuthorizationStatus.NotDetermined)
                {
                    userDialogResult   = ClusterDialogResult.Denied;
                    systemDialogResult = ClusterDialogResult.NoActionTaken;
                }
                else if (LocationAuthorizationStatusPermitsAccess(status))
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Granted;
                }
                else if (status == CLAuthorizationStatus.Denied)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.Denied;
                }
                else if (status == CLAuthorizationStatus.Restricted)
                {
                    userDialogResult   = ClusterDialogResult.Granted;
                    systemDialogResult = ClusterDialogResult.ParentallyRestricted;
                }
                _locationPermissionCompletionHandler((LocationAuthorizationStatusPermitsAccess(status)),
                                                     userDialogResult,
                                                     systemDialogResult);
                _locationPermissionCompletionHandler = null;
            }
            if (_locationManager != null)
            {
                _locationManager.StopUpdatingLocation();
                _locationManager = null;
            }
        }
Beispiel #8
0
        public void ShowAVPermissionsWithType(ClusterAVAuthorizationType mediaType, string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
        {
            if (requestTitle.Length == 0)
            {
                switch (mediaType)
                {
                case ClusterAVAuthorizationType.Camera:
                    requestTitle = @"Access Camera?";
                    break;

                default:
                    requestTitle = @"Access Microphone?";
                    break;
                }
            }
            denyButtonTitle  = GetTitleForType(ClusterTitleType.Deny, denyButtonTitle);
            grantButtonTitle = GetTitleForType(ClusterTitleType.Request, grantButtonTitle);

            AVAuthorizationStatus status = AVCaptureDevice.GetAuthorizationStatus(AVMediaType.Video);

            if (status == AVAuthorizationStatus.NotDetermined)
            {
                _avPermissionCompletionHandler = completionHandler;
                _preAVPermissionAlertView      = new UIAlertView(requestTitle, message, new AlertViewDelegate(this), denyButtonTitle, grantButtonTitle);
                _preAVPermissionAlertView.Tag  = (nint)(int)mediaType;
                _preAVPermissionAlertView.Show();
            }
            else
            {
                if (completionHandler != null)
                {
                    completionHandler((status == AVAuthorizationStatus.Authorized),
                                      ClusterDialogResult.NoActionTaken,
                                      ClusterDialogResult.NoActionTaken);
                }
            }
        }
Beispiel #9
0
        public void ShowEventPermissionsWithType(ClusterEventAuthorizationType eventType, string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
        {
            if (requestTitle.Length == 0)
            {
                switch (eventType)
                {
                case ClusterEventAuthorizationType.Event:
                    requestTitle = @"Access Calendar?";
                    break;

                default:
                    requestTitle = @"Access Reminders?";
                    break;
                }
            }
            denyButtonTitle  = GetTitleForType(ClusterTitleType.Deny, denyButtonTitle);
            grantButtonTitle = GetTitleForType(ClusterTitleType.Request, grantButtonTitle);

            var status = EKEventStore.GetAuthorizationStatus(EKEquivalentEventType(eventType));

            if (status == EKAuthorizationStatus.NotDetermined)
            {
                _eventPermissionCompletionHandler = completionHandler;
                _preEventPermissionAlertView      = new UIAlertView(requestTitle, message, new AlertViewDelegate(this), denyButtonTitle, grantButtonTitle);
                _preEventPermissionAlertView.Tag  = (nint)(int)eventType;
                _preEventPermissionAlertView.Show();
            }
            else
            {
                if (completionHandler != null)
                {
                    completionHandler((status == EKAuthorizationStatus.Authorized),
                                      ClusterDialogResult.NoActionTaken,
                                      ClusterDialogResult.NoActionTaken);
                }
            }
        }
        public void ShowAVPermissionsWithType(ClusterAVAuthorizationType mediaType, string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
        {
            if (requestTitle.Length == 0)
            {
                switch (mediaType)
                {
                    case ClusterAVAuthorizationType.Camera:
                        requestTitle = @"Access Camera?";
                        break;

                    default:
                        requestTitle = @"Access Microphone?";
                        break;
                }
            }
            denyButtonTitle = GetTitleForType (ClusterTitleType.Deny, denyButtonTitle);
            grantButtonTitle = GetTitleForType (ClusterTitleType.Request, grantButtonTitle);

            AVAuthorizationStatus status = AVCaptureDevice.GetAuthorizationStatus (AVMediaType.Video);
            if (status == AVAuthorizationStatus.NotDetermined)
            {
                _avPermissionCompletionHandler = completionHandler;
                _preAVPermissionAlertView = new UIAlertView (requestTitle, message, new AlertViewDelegate (this), denyButtonTitle, grantButtonTitle);
                _preAVPermissionAlertView.Tag = (nint)(int)mediaType;
                _preAVPermissionAlertView.Show ();
            }
            else
            {
                if (completionHandler != null)
                {
                    completionHandler ((status == AVAuthorizationStatus.Authorized),
                        ClusterDialogResult.NoActionTaken,
                        ClusterDialogResult.NoActionTaken);
                }
            }
        }
        public void ShowLocationPermissionsForAuthorizationType(ClusterLocationAuthorizationType authorizationType, string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
        {
            if (requestTitle.Length == 0)
            {
                requestTitle = @"Access Location?";
            }
            denyButtonTitle = GetTitleForType (ClusterTitleType.Deny, denyButtonTitle);
            grantButtonTitle = GetTitleForType (ClusterTitleType.Request, grantButtonTitle);

            var status = CLLocationManager.Status;
            if (status == CLAuthorizationStatus.NotDetermined)
            {
                _locationPermissionCompletionHandler = completionHandler;
                _locationAuthorizationType = authorizationType;
                _preLocationPermissionAlertView = new UIAlertView (requestTitle, message, new AlertViewDelegate (this), denyButtonTitle, grantButtonTitle);
                _preLocationPermissionAlertView.Show ();
            }
            else
            {
                if (completionHandler != null)
                {
                    completionHandler (LocationAuthorizationStatusPermitsAccess (status),
                        ClusterDialogResult.NoActionTaken,
                        ClusterDialogResult.NoActionTaken);
                }
            }
        }
Beispiel #12
0
 public void ShowLocationPermissionsWithTitle(string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
 {
     ShowLocationPermissionsForAuthorizationType(ClusterLocationAuthorizationType.Always, requestTitle, message, denyButtonTitle, grantButtonTitle, completionHandler);
 }
 public void ShowLocationPermissionsWithTitle(string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
 {
     ShowLocationPermissionsForAuthorizationType (ClusterLocationAuthorizationType.Always, requestTitle, message, denyButtonTitle, grantButtonTitle, completionHandler);
 }
        public void ShowPhotoPermissionsWithTitle(string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
        {
            if (requestTitle.Length == 0)
            {
                requestTitle = @"Access Photos?";
            }
            denyButtonTitle = GetTitleForType (ClusterTitleType.Deny, denyButtonTitle);
            grantButtonTitle = GetTitleForType (ClusterTitleType.Request, grantButtonTitle);

            ALAuthorizationStatus status = ALAssetsLibrary.AuthorizationStatus;
            if (status == ALAuthorizationStatus.NotDetermined)
            {
                _photoPermissionCompletionHandler = completionHandler;
                _prePhotoPermissionAlertView = new UIAlertView (requestTitle, message, new AlertViewDelegate (this), denyButtonTitle, grantButtonTitle);
                _prePhotoPermissionAlertView.Show ();
            }
            else
            {
                if (completionHandler != null)
                {
                    completionHandler ((status == ALAuthorizationStatus.Authorized),
                        ClusterDialogResult.NoActionTaken,
                        ClusterDialogResult.NoActionTaken);
                }
            }
        }
 public void ShowMicrophonePermissionsWithTitle(string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
 {
     ShowAVPermissionsWithType (ClusterAVAuthorizationType.Microphone, requestTitle, message, denyButtonTitle, grantButtonTitle, completionHandler);
 }
 void FireContactPermissionCompletionHandler()
 {
     ABAuthorizationStatus status = ABAddressBook.GetAuthorizationStatus ();
     if (_contactPermissionCompletionHandler != null)
     {
         ClusterDialogResult userDialogResult = ClusterDialogResult.Granted;
         ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
         if (status == ABAuthorizationStatus.NotDetermined)
         {
             userDialogResult = ClusterDialogResult.Denied;
             systemDialogResult = ClusterDialogResult.NoActionTaken;
         }
         else if (status == ABAuthorizationStatus.Authorized)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Granted;
         }
         else if (status == ABAuthorizationStatus.Denied)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Denied;
         }
         else if (status == ABAuthorizationStatus.Restricted)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.ParentallyRestricted;
         }
         _contactPermissionCompletionHandler ((status == ABAuthorizationStatus.Authorized),
             userDialogResult,
             systemDialogResult);
         _contactPermissionCompletionHandler = null;
     }
 }
 void FireAVPermissionCompletionHandlerWithType(ClusterAVAuthorizationType mediaType)
 {
     AVAuthorizationStatus status = AVCaptureDevice.GetAuthorizationStatus (AVEquivalentMediaType (mediaType));
     if (_avPermissionCompletionHandler != null)
     {
         ClusterDialogResult userDialogResult = ClusterDialogResult.Granted;
         ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
         if (status == AVAuthorizationStatus.NotDetermined)
         {
             userDialogResult = ClusterDialogResult.Denied;
             systemDialogResult = ClusterDialogResult.NoActionTaken;
         }
         else if (status == AVAuthorizationStatus.Authorized)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Granted;
         }
         else if (status == AVAuthorizationStatus.Denied)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Denied;
         }
         else if (status == AVAuthorizationStatus.Restricted)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.ParentallyRestricted;
         }
         _avPermissionCompletionHandler ((status == AVAuthorizationStatus.Authorized),
             userDialogResult,
             systemDialogResult);
         _avPermissionCompletionHandler = null;
     }
 }
Beispiel #18
0
 public void ShowMicrophonePermissionsWithTitle(string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
 {
     ShowAVPermissionsWithType(ClusterAVAuthorizationType.Microphone, requestTitle, message, denyButtonTitle, grantButtonTitle, completionHandler);
 }
        public void ShowEventPermissionsWithType(ClusterEventAuthorizationType eventType, string requestTitle, string message, string denyButtonTitle, string grantButtonTitle, ClusterPrePermissionCompletionHandler completionHandler)
        {
            if (requestTitle.Length == 0)
            {
                switch (eventType)
                {
                    case ClusterEventAuthorizationType.Event:
                        requestTitle = @"Access Calendar?";
                        break;

                    default:
                        requestTitle = @"Access Reminders?";
                        break;
                }
            }
            denyButtonTitle = GetTitleForType (ClusterTitleType.Deny, denyButtonTitle);
            grantButtonTitle = GetTitleForType (ClusterTitleType.Request, grantButtonTitle);

            var status = EKEventStore.GetAuthorizationStatus (EKEquivalentEventType (eventType));
            if (status == EKAuthorizationStatus.NotDetermined)
            {
                _eventPermissionCompletionHandler = completionHandler;
                _preEventPermissionAlertView = new UIAlertView (requestTitle, message, new AlertViewDelegate (this), denyButtonTitle, grantButtonTitle);
                _preEventPermissionAlertView.Tag = (nint)(int)eventType;
                _preEventPermissionAlertView.Show ();
            }
            else
            {
                if (completionHandler != null)
                {
                    completionHandler ((status == EKAuthorizationStatus.Authorized),
                        ClusterDialogResult.NoActionTaken,
                        ClusterDialogResult.NoActionTaken);
                }
            }
        }
 void FirePhotoPermissionCompletionHandler()
 {
     ALAuthorizationStatus status = ALAssetsLibrary.AuthorizationStatus;
     if (_photoPermissionCompletionHandler != null)
     {
         ClusterDialogResult userDialogResult = ClusterDialogResult.Granted;
         ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
         if (status == ALAuthorizationStatus.NotDetermined)
         {
             userDialogResult = ClusterDialogResult.Denied;
             systemDialogResult = ClusterDialogResult.NoActionTaken;
         }
         else if (status == ALAuthorizationStatus.Authorized)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Granted;
         }
         else if (status == ALAuthorizationStatus.Denied)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Denied;
         }
         else if (status == ALAuthorizationStatus.Restricted)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.ParentallyRestricted;
         }
         _photoPermissionCompletionHandler ((status == ALAuthorizationStatus.Authorized),
             userDialogResult,
             systemDialogResult);
         _photoPermissionCompletionHandler = null;
     }
 }
 void FireLocationPermissionCompletionHandler()
 {
     var status = CLLocationManager.Status;
     if (_locationPermissionCompletionHandler != null)
     {
         ClusterDialogResult userDialogResult = ClusterDialogResult.Granted;
         ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
         if (status == CLAuthorizationStatus.NotDetermined)
         {
             userDialogResult = ClusterDialogResult.Denied;
             systemDialogResult = ClusterDialogResult.NoActionTaken;
         }
         else if (LocationAuthorizationStatusPermitsAccess (status))
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Granted;
         }
         else if (status == CLAuthorizationStatus.Denied)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Denied;
         }
         else if (status == CLAuthorizationStatus.Restricted)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.ParentallyRestricted;
         }
         _locationPermissionCompletionHandler ((LocationAuthorizationStatusPermitsAccess (status)),
             userDialogResult,
             systemDialogResult);
         _locationPermissionCompletionHandler = null;
     }
     if (_locationManager != null)
     {
         _locationManager.StopUpdatingLocation ();
         _locationManager = null;
     }
 }
 void FireEventPermissionCompletionHandler(ClusterEventAuthorizationType eventType)
 {
     EKAuthorizationStatus status = EKEventStore.GetAuthorizationStatus (EKEquivalentEventType (eventType));
     if (_eventPermissionCompletionHandler != null)
     {
         ClusterDialogResult userDialogResult = ClusterDialogResult.Granted;
         ClusterDialogResult systemDialogResult = ClusterDialogResult.Granted;
         if (status == EKAuthorizationStatus.NotDetermined)
         {
             userDialogResult = ClusterDialogResult.Denied;
             systemDialogResult = ClusterDialogResult.NoActionTaken;
         }
         else if (status == EKAuthorizationStatus.Authorized)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Granted;
         }
         else if (status == EKAuthorizationStatus.Denied)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.Denied;
         }
         else if (status == EKAuthorizationStatus.Restricted)
         {
             userDialogResult = ClusterDialogResult.Granted;
             systemDialogResult = ClusterDialogResult.ParentallyRestricted;
         }
         _eventPermissionCompletionHandler ((status == EKAuthorizationStatus.Authorized),
             userDialogResult,
             systemDialogResult);
         _eventPermissionCompletionHandler = null;
     }
 }