public override void ViewDidLoad() { base.ViewDidLoad(); this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem( UIImage.FromBundle("BackArrow"), UIBarButtonItemStyle.Plain, (sender, args) => { NavigationController.PopViewController(true); }), true); this.Title = selectedService; TableView.TableFooterView = new UIView(); this.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem( UIBarButtonSystemItem.Add, (sender, args) => { var alert = UIAlertController.Create("Upload File", "Uploads photos to Cloud Ctorage", UIAlertControllerStyle.ActionSheet); alert.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, null)); alert.AddAction(UIAlertAction.Create("Take a Photo", UIAlertActionStyle.Default, action => CameraPhoto())); alert.AddAction(UIAlertAction.Create("Choose a Photo", UIAlertActionStyle.Default, action => UploadImage())); PresentViewController(alert, animated: true, completionHandler: null); }), true); activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White); activityIndicator.Frame = new CGRect(150, 120, 30, 30); activityIndicator.Center = View.Center; View.AddSubview(activityIndicator); activityIndicator.BringSubviewToFront(View); activityIndicator.Color = UIColor.LightGray; activityIndicator.StartAnimating(); cloudStorageLogic = new CloudStorageLogic(); if (selectedService == "Box") { cloudStorage = new CRBox("qnskodzvd2naq16xowc40t43fug2848n", "cQE7Sf9DzZqChjvCTxIMTp3ye6hynhTd"); } else if (selectedService == "Dropbox") { cloudStorage = new CRDropbox("38nu3lwdvyaqs78", "c95g0wfkdv6ua2d"); } else if (selectedService == "Google Drive") { CRGoogleDrive drive = new CRGoogleDrive("1007170750392-r3p483hu2q02nsp45679dbqsbt9po8h0.apps.googleusercontent.com", "", "com.cloudrail.unifiedcloudstorage:/oauth2redirect", "State"); drive.UseAdvancedAuthentication(); cloudStorage = drive; } else if (selectedService == "One Drive") { cloudStorage = new CROneDrive("000000004018F12F", "lGQPubehDO6eklir1GQmIuCPFfzwihMo"); } else if (selectedService == "One Drive for Business") { cloudStorage = new CROneDriveBusiness("", ""); } else if (selectedService == "Egnynte") { cloudStorage = new CREgnyte("cloudrailcloudtest", "k9y879bha2kmsyyqx4urtnaz", "TsgByd2YZqsJPyYMDhEB6ctAYQ6kP35qYTnEG9urPKq2eNNXRF", "https://www.cloudrailauth.com/auth", "State"); } //First Service Called (delay it by 500 millseconds for Advanced Authentication) PerformSelector(new Selector("GetRootFilesFolders"), null, 1.0f); }
public override void ViewDidLoad() { base.ViewDidLoad(); this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem( UIImage.FromBundle("BackArrow"), UIBarButtonItemStyle.Plain, (sender, args) => { NavigationController.PopViewController(true); }), true); this.Title = selectedService; TableView.TableFooterView = new UIView(); this.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem( UIBarButtonSystemItem.Add, (sender, args) => { var alert = UIAlertController.Create("Upload File", "Uploads photos to Cloud Ctorage", UIAlertControllerStyle.ActionSheet); alert.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, null)); alert.AddAction(UIAlertAction.Create("Take a Photo", UIAlertActionStyle.Default, action => CameraPhoto())); alert.AddAction(UIAlertAction.Create("Choose a Photo", UIAlertActionStyle.Default, action => UploadImage())); PresentViewController(alert, animated: true, completionHandler: null); }), true); activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White); activityIndicator.Frame = new CGRect(150, 120, 30, 30); activityIndicator.Center = View.Center; View.AddSubview(activityIndicator); activityIndicator.BringSubviewToFront(View); activityIndicator.Color = UIColor.LightGray; activityIndicator.StartAnimating(); cloudStorageLogic = new CloudStorageLogic(); //Setup: //https://cloudrail.com/integrations/interfaces/CloudStorage;serviceIds=Box,Dropbox,Egnyte,GoogleDrive,OneDrive,OneDriveBusiness,PCloud;platformId=XamarinIOS;tab=setup if (selectedService == "Box") { cloudStorage = new CRBox("Box Client Identifier", "Box Client Secret"); } else if (selectedService == "Dropbox") { CRDropbox dropbox = new CRDropbox("Dropbox Client Identifier", "Dropbox Client Secret", "https://auth.cloudrail.com/com.cloudrail.unifiedcloudstorage", "State"); dropbox.UseAdvancedAuthentication(); cloudStorage = dropbox; } else if (selectedService == "Google Drive") { //NOTE: Only Need Client Identifier CRGoogleDrive drive = new CRGoogleDrive("Google Drive Client Identifier", "", "com.cloudrail.unifiedcloudstorage:/oauth2redirect", "State"); drive.UseAdvancedAuthentication(); cloudStorage = drive; } else if (selectedService == "One Drive") { cloudStorage = new CROneDrive("OneDrive Client Identifier", "OneDrive Client Secret"); } else if (selectedService == "One Drive for Business") { cloudStorage = new CROneDriveBusiness("OneDrive Business Client Identifier", "OneDrive Business Client Secret"); } else if (selectedService == "Egnynte") { cloudStorage = new CREgnyte("Your Egnyte Domain", "Your Egnyte API Key", "Your Egnyte Shared Secret", "https://www.cloudrailauth.com/auth", "State"); } else if (selectedService == "PCloud") { cloudStorage = new CRPCloud("PCloud Client Identifier", "PCloud Client Secret"); } //First Service Called (delay it by 500 millseconds for Advanced Authentication) PerformSelector(new Selector("GetRootFilesFolders"), null, 1.0f); }