void ShowFileListing(string caption, int basePathId) { FreeFileListingViewController(); fileListingViewController = new FileListingViewController(caption, basePathId); fileListingViewController.OpenFile += HandleOpenFile; fileListingViewController.Done += FreeFileListingViewController; if (Utilities.UserInterfaceIdiomIsPhone) { appViewController.PresentViewController(fileListingViewController, true, null); } else { pop = new UIPopoverController(fileListingViewController); pop.PresentFromRect( appViewController.TableView.TableHeaderView.Frame, appViewController.TableView.TableHeaderView, UIPopoverArrowDirection.Up, true); } }
public override void ViewWillAppear(bool animated) { if (Root.Count != 0) { if (!Utilities.UserInterfaceIdiomIsPhone) { if (receivedDocumentsSection != null) { receivedDocumentsSection.Clear(); receivedDocumentsSection.AddAll(recent.GetElements()); } if (transferredDocumentsSection != null) { transferredDocumentsSection.Clear(); transferredDocumentsSection.AddAll(local.GetElements()); } } return; } Theme.Configure("AxCrypt", this); receivedDocumentsSection = new Section(); transferredDocumentsSection = new Section(); if (Utilities.UserInterfaceIdiomIsPhone) { receivedDocumentsSection.Add(new ThemedStringElement("Received documents", OnRecentFilesButtonTapped)); transferredDocumentsSection.Add(new ThemedStringElement("Transferred documents", OnLocalFilesButtonTapped)); if (Utilities.iPhone5OrPad) { // We've got plenty of vertical space to be a little more verbose receivedDocumentsSection.Footer = "documents received from other apps"; transferredDocumentsSection.Footer = "documents transferred from iTunes"; } } else { receivedDocumentsSection.Caption = "Documents received from other Apps"; receivedDocumentsSection.Footer = " "; recent = new FileListingViewController(String.Empty, BasePath.ReceivedFilesId); recent.OpenFile += AppDelegate.Current.HandleOpenFile; receivedDocumentsSection.AddAll(recent.GetElements()); transferredDocumentsSection.Caption = "Documents transferred via iTunes"; transferredDocumentsSection.Footer = " "; local = new FileListingViewController(String.Empty, BasePath.TransferredFilesId); local.OpenFile += AppDelegate.Current.HandleOpenFile; transferredDocumentsSection.AddAll(local.GetElements()); } Root.Add(new[] { receivedDocumentsSection, transferredDocumentsSection, }); if (!Utilities.UserInterfaceIdiomIsPhone) { Root.Add(new Section(String.Empty)); } Root.Add(new [] { new Section { new ThemedStringElement("About", OnAboutButtonTapped), new ThemedStringElement("Frequently Asked Questions", OnFaqButtonTapped), new ThemedStringElement("Troubleshooting", OnTroubleshootingButtonTapped), new ThemedStringElement("Feedback", OnFeedbackButtonTapped) }, }); TableView.ScrollEnabled = receivedDocumentsSection.Count + receivedDocumentsSection.Count > 20; base.ViewWillAppear(animated); }
public override void ViewWillAppear(bool animated) { if (Root.Count != 0) { if (!Utilities.UserInterfaceIdiomIsPhone) { if (receivedDocumentsSection != null) { receivedDocumentsSection.Clear (); receivedDocumentsSection.AddAll (recent.GetElements ()); } if (transferredDocumentsSection != null) { transferredDocumentsSection.Clear (); transferredDocumentsSection.AddAll (local.GetElements ()); } } return; } Theme.Configure ("AxCrypt", this); receivedDocumentsSection = new Section (); transferredDocumentsSection = new Section(); if (Utilities.UserInterfaceIdiomIsPhone) { receivedDocumentsSection.Add (new ThemedStringElement ("Received documents", OnRecentFilesButtonTapped)); transferredDocumentsSection.Add (new ThemedStringElement("Transferred documents", OnLocalFilesButtonTapped)); if (Utilities.iPhone5OrPad) { // We've got plenty of vertical space to be a little more verbose receivedDocumentsSection.Footer = "documents received from other apps"; transferredDocumentsSection.Footer = "documents transferred from iTunes"; } } else { receivedDocumentsSection.Caption = "Documents received from other Apps"; receivedDocumentsSection.Footer = " "; recent = new FileListingViewController (String.Empty, BasePath.ReceivedFilesId); recent.OpenFile += AppDelegate.Current.HandleOpenFile; receivedDocumentsSection.AddAll (recent.GetElements()); transferredDocumentsSection.Caption = "Documents transferred via iTunes"; transferredDocumentsSection.Footer = " "; local = new FileListingViewController (String.Empty, BasePath.TransferredFilesId); local.OpenFile += AppDelegate.Current.HandleOpenFile; transferredDocumentsSection.AddAll (local.GetElements()); } Root.Add (new[] { receivedDocumentsSection, transferredDocumentsSection, }); if (!Utilities.UserInterfaceIdiomIsPhone) { Root.Add (new Section(String.Empty)); } Root.Add (new [] { new Section { new ThemedStringElement("About", OnAboutButtonTapped), new ThemedStringElement("Frequently Asked Questions", OnFaqButtonTapped), new ThemedStringElement("Troubleshooting", OnTroubleshootingButtonTapped), new ThemedStringElement("Feedback", OnFeedbackButtonTapped) }, }); TableView.ScrollEnabled = receivedDocumentsSection.Count + receivedDocumentsSection.Count > 20; base.ViewWillAppear (animated); }