コード例 #1
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            PrivacyDetailViewController viewController = null;

            DataClass selected = (DataClass)TableView.IndexPathForSelectedRow.Row;

            viewController       = PrivacyDetailViewController.CreateFor(selected);
            viewController.Title = selected.ToString();

            NavigationController.PushViewController(viewController, true);
        }
コード例 #2
0
		void Setup(PrivacyDetailViewController vc, DataClass type)
		{
			IPrivacyManager manager = null;
			switch (type) {
				case DataClass.Reminders:
					manager = new EKEntityPrivacyManager (EKEntityType.Reminder);
					break;

				case DataClass.Calendars:
					manager = new EKEntityPrivacyManager (EKEntityType.Event);
					break;

				case DataClass.Facebook:
					manager = new SocialNetworkPrivacyManager (ACAccountType.Facebook);
					break;

				case DataClass.Twitter:
					manager = new SocialNetworkPrivacyManager (ACAccountType.Twitter);
					break;

				case DataClass.SinaWeibo:
					manager = new SocialNetworkPrivacyManager (ACAccountType.SinaWeibo);
					break;

				case DataClass.TencentWeibo:
					manager = new SocialNetworkPrivacyManager (ACAccountType.TencentWeibo);
					break;

				case DataClass.Notifications:
					manager = new NotificationsPrivacyManager ((AppDelegate)UIApplication.SharedApplication.Delegate);
					break;

				case DataClass.Contacts:
					manager = new AddressBookPrivacyManager ();
					break;

				case DataClass.Photos:
					manager = new PhotoPrivacyManager ();
					break;

				case DataClass.Video:
					manager = new VideoCapturePrivacyManager ();
					break;

				case DataClass.Microphone:
					manager = new MicrophonePrivacyManager ();
					break;

				case DataClass.Bluetooth:
					manager = new BluetoothPrivacyManager ();
					break;

				case DataClass.Advertising:
					manager = new AdvertisingPrivacyManager ();
					break;

				default:
					throw new NotImplementedException ();
			}

			vc.PrivacyManager = manager;
		}
コード例 #3
0
        public static PrivacyDetailViewController CreateFor(DataClass selected)
        {
            PrivacyDetailViewController viewController = null;

            switch (selected)
            {
            case DataClass.Location:
                viewController = new LocationPrivacyViewController();
                break;

            case DataClass.Notifications:
                viewController = new NotificationsPrivacyController();
                break;

            case DataClass.Calendars:
                viewController = new EKEntityPrivacyController(EKEntityType.Event);
                break;

            case DataClass.Reminders:
                viewController = new EKEntityPrivacyController(EKEntityType.Reminder);
                break;

            case DataClass.Contacts:
                viewController = new AddressBookPrivacyController();
                break;

            case DataClass.Photos:
                viewController = new PhotoPrivacyController();
                break;

            case DataClass.Video:
                viewController = new VideoCapturePrivacyController();
                break;

            case DataClass.Microphone:
                viewController = new MicrophonePrivacyController();
                break;

            case DataClass.Bluetooth:
                viewController = new BluetoothPrivacyController();
                break;

            case DataClass.Motion:
                viewController = new MotionPrivacyController();
                break;

            case DataClass.Facebook:
                viewController = new SocialNetworkPrivacyController(ACAccountType.Facebook);
                break;

            case DataClass.Twitter:
                viewController = new SocialNetworkPrivacyController(ACAccountType.Twitter);
                break;

            case DataClass.SinaWeibo:
                viewController = new SocialNetworkPrivacyController(ACAccountType.SinaWeibo);
                break;

            case DataClass.TencentWeibo:
                viewController = new SocialNetworkPrivacyController(ACAccountType.TencentWeibo);
                break;

            case DataClass.Advertising:
                viewController = new AdvertisingPrivacyController();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            viewController.Title = selected.ToString();
            return(viewController);
        }
コード例 #4
0
        public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
        {
            PrivacyDetailViewController viewController =
                segue.DestinationViewController as PrivacyDetailViewController;

            DataClass selected = (DataClass)TableView.IndexPathForSelectedRow.Row;

            viewController.Title = selected.ToString();

            switch (selected)
            {
            case DataClass.Location:
                viewController.CheckAccess = delegate {
                    CheckLocationServicesAuthorizationStatus(CLLocationManager.Status);
                };
                viewController.RequestAccess = RequestLocationServicesAuthorization;
                break;

            case DataClass.Contacts:
                viewController.CheckAccess   = CheckAddressBookAccess;
                viewController.RequestAccess = RequestAddressBookAccess;
                break;

            case DataClass.Calendars:
                viewController.CheckAccess = delegate {
                    CheckEventStoreAccess(EKEntityType.Event);
                };
                viewController.RequestAccess = delegate {
                    RequestEventStoreAccess(EKEntityType.Event);
                };
                break;

            case DataClass.Reminders:
                viewController.CheckAccess = delegate {
                    CheckEventStoreAccess(EKEntityType.Reminder);
                };
                viewController.RequestAccess = delegate {
                    RequestEventStoreAccess(EKEntityType.Reminder);
                };
                break;

            case DataClass.Photos:
                viewController.CheckAccess   = CheckPhotosAuthorizationStatus;
                viewController.RequestAccess = delegate {
                    RequestPhotoAccess(false);
                    RequestPhotoAccess(true);
                };
                break;

            case DataClass.Microphone:
                viewController.CheckAccess   = null;
                viewController.RequestAccess = delegate {
                    RequestMicrophoneAccess(true);
                    RequestMicrophoneAccess(false);
                };
                break;

            case DataClass.Bluetooth:
                viewController.CheckAccess   = CheckBluetoothAccess;
                viewController.RequestAccess = RequestBluetoothAccess;
                break;

            case DataClass.Facebook:
                viewController.CheckAccess = delegate {
                    CheckSocialAccountAuthorizationStatus(ACAccountType.Facebook);
                };
                viewController.RequestAccess = RequestFacebookAccess;
                break;

            case DataClass.Twitter:
                viewController.CheckAccess = delegate {
                    CheckSocialAccountAuthorizationStatus(ACAccountType.Twitter);
                };
                viewController.RequestAccess = RequestTwitterAccess;
                break;

            case DataClass.SinaWeibo:
                viewController.CheckAccess = delegate {
                    CheckSocialAccountAuthorizationStatus(ACAccountType.SinaWeibo);
                };
                viewController.RequestAccess = RequestSinaWeiboAccess;
                break;

            case DataClass.TencentWeibo:
                viewController.CheckAccess = delegate {
                    CheckSocialAccountAuthorizationStatus(ACAccountType.TencentWeibo);
                };
                viewController.RequestAccess = RequestTencentWeiboAccess;
                break;

            case DataClass.Advertising:
                viewController.CheckAccess   = AdvertisingIdentifierStatus;
                viewController.RequestAccess = null;
                break;
            }
        }
コード例 #5
0
        void Setup(PrivacyDetailViewController vc, DataClass type)
        {
            IPrivacyManager manager = null;

            switch (type)
            {
            case DataClass.Reminders:
                manager = new EKEntityPrivacyManager(EKEntityType.Reminder);
                break;

            case DataClass.Calendars:
                manager = new EKEntityPrivacyManager(EKEntityType.Event);
                break;

            case DataClass.Facebook:
                manager = new SocialNetworkPrivacyManager(ACAccountType.Facebook);
                break;

            case DataClass.Twitter:
                manager = new SocialNetworkPrivacyManager(ACAccountType.Twitter);
                break;

            case DataClass.SinaWeibo:
                manager = new SocialNetworkPrivacyManager(ACAccountType.SinaWeibo);
                break;

            case DataClass.TencentWeibo:
                manager = new SocialNetworkPrivacyManager(ACAccountType.TencentWeibo);
                break;

            case DataClass.Notifications:
                manager = new NotificationsPrivacyManager((AppDelegate)UIApplication.SharedApplication.Delegate);
                break;

            case DataClass.Contacts:
                manager = new AddressBookPrivacyManager();
                break;

            case DataClass.Photos:
                manager = new PhotoPrivacyManager();
                break;

            case DataClass.Video:
                manager = new VideoCapturePrivacyManager();
                break;

            case DataClass.Microphone:
                manager = new MicrophonePrivacyManager();
                break;

            case DataClass.Bluetooth:
                manager = new BluetoothPrivacyManager();
                break;

            case DataClass.Advertising:
                manager = new AdvertisingPrivacyManager();
                break;

            default:
                throw new NotImplementedException();
            }

            vc.PrivacyManager = manager;
        }