public override bool FinishedLaunching (UIApplication app, NSDictionary options) { Current = this; // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // Create the database file var sqliteFilename = "TodoItemDB.db3"; // we need to put in /Library/ on iOS5.1 to meet Apple's iCloud terms // (they don't want non-user-generated data in Documents) string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder var path = Path.Combine(libraryPath, sqliteFilename); conn = new SQLiteConnection(path); TodoManager = new TodoItemManager(conn); // create our nav controller navController = new UINavigationController (); // create our Todo list screen homeViewController = new Screens.HomeScreen (); // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller this._navController = new UINavigationController (); // create our home controller based on the device if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { this._homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone(); } else { // this._viewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null); } // push the view controller onto the nav controller and show the window this._navController.PushViewController(this._homeViewController, false); window.RootViewController = this._navController; window.MakeKeyAndVisible (); return true; }
public SettingsTableSource(UITableViewController controller, string cellID) { this.cellID = cellID; this.controller = controller; // Set up the NSDateFormatter this.dateFormatter = new NSDateFormatter(); this.dateFormatter.DateStyle = NSDateFormatterStyle.None; this.dateFormatter.TimeStyle = NSDateFormatterStyle.Short; // Set up the UIDatePicker this.timePicker = new UIDatePicker(); timePicker.Mode = UIDatePickerMode.Time; timePicker.Date = NSDate.Now; timePicker.Hidden = true; this.timePickerIsShowing = false; this.dayPickerDay = 1; this.dayPickerUnit = "Days"; // Set up the UIPickerView this.dayPicker = new UIPickerView(); this.dayPicker.DataSource = new DayPickerSource(); this.dayPicker.Delegate = new DayPickerDelegate(this); this.dayPicker.Hidden = true; this.dayPickerIsShowing = false; }
// This method is invoked when the application has loaded its UI and its ready to run public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Console.WriteLine ("AppDelegate.FinishedLaunching"); window = new UIWindow (UIScreen.MainScreen.Bounds); var nc = new UINavigationController (); navigation_controller = nc; var lvc = new LoginSettingsViewController () { AppDelegate = this }; nc.PushViewController (lvc, false); room_list_controller = new UITableViewController (); room_controller = new UITableViewController (); nc.TopViewController.Title = "MonoTouchLingr"; window.AddSubview (nc.View); window.MakeKeyAndVisible (); if (File.Exists (cfgfile)) { string [] lines = File.ReadAllLines (cfgfile); //Login (lines [0], lines [1]); lvc.ViewLoaded += delegate { lvc.UserName = lines [0]; lvc.Password = lines [1]; }; } return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Current = this; // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); TodoContractMngr = new TodoContractManager("http://40.118.255.235:8000", "http://40.118.255.235/eth/v1.2"); // create our nav controller navController = new UINavigationController (); // create our Todo list screen homeViewController = new Screens.HomeScreen (); // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
/// <summary> /// Views the did load. /// </summary> public override void ViewDidLoad () { base.ViewDidLoad (); // Register the tableview's datasource TableView.Source = new MainMenuTableSource (this); // Create a search results table var searchResultsController = new UITableViewController (UITableViewStyle.Plain); var searchSource = new SearchResultsTableSource (this); searchResultsController.TableView.Source = searchSource; // Create search updater and wire it up var searchUpdater = new SearchResultsUpdator (); searchUpdater.UpdateSearchResults += (searchText) => { // Preform search and reload search table searchSource.Search(searchText); searchResultsController.TableView.ReloadData(); }; // Create a new search controller SearchController = new UISearchController (searchResultsController); SearchController.SearchResultsUpdater = searchUpdater; // Display the search controller SearchController.SearchBar.Frame = new CGRect (SearchController.SearchBar.Frame.X, SearchController.SearchBar.Frame.Y, SearchController.SearchBar.Frame.Width, 44f); TableView.TableHeaderView = SearchController.SearchBar; DefinesPresentationContext = true; }
public AddressLookupTableSource(UITableViewController lookupController, List<Prediction> data, string cellId,OnAddressSelected onAddressSelected) { this.CellId = cellId; this.controller = lookupController; this.data = data; this.OnAddressSelected = onAddressSelected; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller navController = new UINavigationController (); // create our home controller based on the device if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone(); } else { // homeViewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null); } // Styling UINavigationBar.Appearance.TintColor = UIColor.FromRGB (38, 117 ,255); // nice blue UITextAttributes ta = new UITextAttributes(); ta.Font = UIFont.FromName ("AmericanTypewriter-Bold", 0f); UINavigationBar.Appearance.SetTitleTextAttributes(ta); ta.Font = UIFont.FromName ("AmericanTypewriter", 0f); UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal); // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); // Create some sample data contents.Add (new Rss { Title = "TUAW", Detail = "The Unofficial Apple Weblog", Badge = "17" }); contents.Add (new Rss { Title = "High Caffine Content", Detail = "Steven Troughton Smith", Badge = "2" }); contents.Add (new Rss { Title = "Smoking Apples", Detail = "Blog about Apple Software...", Badge = "145" }); contents.Add (new Rss { Title = "Daring Fireball", Detail = "The musings of John Gruber", Badge = "0" }); contents.Add (new Rss { Title = "tmdvs.me", Detail = "Long detail text to test update by tonymillion on github", Badge = "2345" }); // Build a tableview tableViewController = new UITableViewController (); tableViewController.TableView.Frame = new RectangleF (0, 20, this.window.Frame.Width, this.window.Frame.Height - 20); tableViewController.TableView.Source = new TableViewSource (contents); tableViewController.Title = "Tim's RSS Reader"; tableViewController.NavigationItem.RightBarButtonItem = tableViewController.EditButtonItem; // Add to the navigation controller navigationController = new UINavigationController (tableViewController); // Add to the window, and show window.AddSubview (navigationController.View); window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller navController = new UINavigationController (); // create our home controller based on the device if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { homeViewController = new Screens.HomeScreen(); } else { // sample does not contain an iPad UI // homeViewController = new Screens.iPadHomeScreen (); } // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller this._navController = new UINavigationController (); // create our home controller based on the device if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { this._homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone (); } else { // this._viewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null); } // push the view controller onto the nav controller and show the window this._navController.PushViewController (this._homeViewController, false); window.RootViewController = this._navController; window.MakeKeyAndVisible (); // enable this to see logging //NativeCSS.SetDebugLogging(true); // To live edit, cd to styles.css and run "python -m SimpleHTTPServer" NativeCSS.StyleWithCSS("styles.css", new Uri("http://localhost:8000/styles.css"), RemoteContentRefreshPeriod.EveryFiveSeconds); return true; }
public AMSDataTableSource(List<TodoItem> toDodata, UITableViewController controller, string cellId, UIStoryboard storyboard) { this.data = toDodata; this.controller = controller; this.CellId = cellId; this.OptStoryboard = storyboard; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller navController = new UINavigationController (); // create our Todo list screen homeViewController = new Screens.HomeScreen (); // UIApplication.SharedApplication.KeyWindow.TintColor = UIColor.White; // navController.NavigationBar.BarTintColor = UIColor.FromRGB (0x91, 0xCA, 0x47); // green theme // navController.NavigationBar.TintColor = UIColor.White; // navController.NavigationBar.BarTintColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E); navController.NavigationBar.TintColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E); // 6FA22E dark-green navController.NavigationBar.BarTintColor = UIColor.FromRGB (0xCF, 0xEF, 0xA7); // CFEFA7 light-green UINavigationBar.Appearance.SetTitleTextAttributes (new UITextAttributes () { // TextColor = UIColor.White, TextColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E), // 6FA22E dark-green TextShadowColor = UIColor.Clear }); // push the view controller onto the nav controller and show the window navController.PushViewController (homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
public TopCommittersConfigTableSource(UITableViewController controller) : base(SmeedeeApp.Instance.AvailableWidgets.Where(e => e.SettingsType == typeof(TopCommittersConfigTableViewController)).First()) { this.controller = controller; model = new TopCommitters(); countSelected = countValues.IndexOf(model.NumberOfCommitters); timeSelected = timeValues.IndexOf(model.TimePeriod); }
void ReleaseDesignerOutlets () { if (dataSource != null) { dataSource.Dispose (); dataSource = null; } if (@delegate != null) { @delegate.Dispose (); @delegate = null; } }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { UITableViewController tableVC = new UITableViewController(UITableViewStyle.Plain); UINavigationController navController = new UINavigationController(new MyViewController()); NVSlideMenuController slideMenuController = new NVSlideMenuController(tableVC, navController); window = new UIWindow(UIScreen.MainScreen.Bounds); window.RootViewController = slideMenuController; window.MakeKeyAndVisible(); return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { Current = this; // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller navController = new UINavigationController (); // create our home controller based on the device // if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { homeViewController = new Tasky.Screens.iPhone.Home.PhoneHomeScreen(); // } else { // homeViewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null); // } // Styling UINavigationBar.Appearance.TintColor = UIColor.FromRGB (38, 117 ,255); // nice blue UITextAttributes ta = new UITextAttributes(); ta.Font = UIFont.FromName ("AmericanTypewriter-Bold", 0f); UINavigationBar.Appearance.SetTitleTextAttributes(ta); ta.Font = UIFont.FromName ("AmericanTypewriter", 0f); UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal); var sqliteFilename = "TaskDB.xml"; // we need to put in /Library/ on iOS5.1 to meet Apple's iCloud terms // (they don't want non-user-generated data in Documents) string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder string libraryPath = Path.Combine (documentsPath, "../Library/"); // Library folder var path = Path.Combine(libraryPath, sqliteFilename); var xmlStorage = new XmlStorageImplementation (); TaskMgr = new TaskManager(path, xmlStorage); // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
public IndexedTableSource(Person[] people, UITableViewController owner) { this.owner = owner; indexedTableItems = new Dictionary<string, List<Person>>(); foreach (var person in people) { if (indexedTableItems.ContainsKey(person.FullName[0].ToString())) { indexedTableItems[person.FullName[0].ToString()].Add(person); } else { indexedTableItems.Add(person.FullName[0].ToString(), new List<Person> { person }); } } keys = indexedTableItems.Keys.ToArray(); }
public MainTabController() { news = new SlideoutNavigationController (); // instantiate the table view from the storyboard UIStoryboard board = UIStoryboard.FromName ("MainStoryboard", null); // dashboard if some favourites saved otherwise the plain // table view if (AppDelegate.IsLoggedIn()) { tableNews = (HomeController)board.InstantiateViewController ("homecontroller"); } else { tableNews = (NewsController)board.InstantiateViewController ("newscontroller"); } var menu = (MenuController)board.InstantiateViewController ("menucontroller"); news.TopView = tableNews; news.MenuViewLeft = menu; pictures = new SlideoutNavigationController (); //tablePictures = (PicturesController)board.InstantiateViewController ("picturesController"); tablePictures = new PicturesController (); menu = (MenuController)board.InstantiateViewController ("menucontroller"); pictures.TopView = tablePictures; pictures.MenuViewLeft = menu; pictures.DisplayNavigationBarOnLeftMenu = false; liveScore = new UINavigationController (); LiveScoreViewController liveScoreScroll = (LiveScoreViewController)board.InstantiateViewController ("lscv"); liveScore.PushViewController(liveScoreScroll, false); if (((AppDelegate)UIApplication.SharedApplication.Delegate).IsSeven) { liveScore.NavigationBar.BarTintColor = UIColor.Black; } else { liveScore.NavigationBar.SetBackgroundImage (UIImage.FromFile ("./Assets/navbar.png"), MonoTouch.UIKit.UIBarMetrics.Default); } video = new SlideoutNavigationController (); menu = (MenuController)board.InstantiateViewController ("menucontroller"); video.TopView = new VideoController (); video.MenuViewLeft = menu; video.DisplayNavigationBarOnLeftMenu = false; ViewControllers = new UIViewController[] { news, pictures, video, liveScore }; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); var viewController = new UITableViewController(); var tableData = new string[] { "Apple Fruit", "Pear Fruit", "Carrot Vegetable", "Tomato Fruit", "Cucumber Not sure", "Potato Vegetable", "Orange Fruit", "Banana Fruit", }; viewController.TableView.Source = new MyTableSource(tableData); window.RootViewController = viewController; window.MakeKeyAndVisible(); return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller navController = new UINavigationController (); // create our Todo list screen homeViewController = new Screens.HomeScreen (); // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Tasky.Shared.BusinessLayer.Managers.BackendlessInit.Init(); // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); // create our nav controller navController = new UINavigationController(); navController.Title = "Tasky Pro"; // create our home controller based on the device if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { homeViewController = new Tasky.Screens.iPhone.HomeScreen(); } else { homeViewController = new Tasky.Screens.iPhone.HomeScreen(); // TODO: replace with iPad screen if we implement for iPad } // Styling UINavigationBar.Appearance.TintColor = UIColor.FromRGB(38, 117, 255); // nice blue UITextAttributes ta = new UITextAttributes(); ta.Font = UIFont.FromName("AmericanTypewriter-Bold", 0f); UINavigationBar.Appearance.SetTitleTextAttributes(ta); ta.Font = UIFont.FromName("AmericanTypewriter", 0f); UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal); // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible(); return(true); }
// Show fields the user can choose to sort results with (must be one of the group by fields). private void ShowOrderByFields(object sender, EventArgs e) { // Create a new table. UITableViewController sortFieldsTable = new UITableViewController(UITableViewStyle.Plain); // Get the current list of group fields and create/update the sort field choices. List <KeyValuePair <string, bool> > sortFieldChoices = _groupByFields.Where(field => field.Value).ToList(); foreach (KeyValuePair <string, bool> sortChoice in sortFieldChoices) { // If this group field is not in the list of available order fields, add it to the list. OrderFieldOption existingOption = _orderByFields.Find(opt => opt.OrderInfo.FieldName == sortChoice.Key); if (existingOption == null) { existingOption = new OrderFieldOption(false, new OrderBy(sortChoice.Key, SortOrder.Ascending)); _orderByFields.Add(existingOption); } } // Also make sure to remove any order by fields that were removed as 'group by' fields. for (int i = _orderByFields.Count - 1; i >= 0; i--) { // If this field is not in the grouped field list, remove it from the order fields list. OrderFieldOption opt = _orderByFields.ElementAt(i); KeyValuePair <string, bool> existingGroupField = sortFieldChoices.FirstOrDefault(field => field.Key == opt.OrderInfo.FieldName); if (existingGroupField.Key == null) { _orderByFields.RemoveAt(i); } } // Set the data source on the table. sortFieldsTable.TableView.Source = new OrderByFieldsDataSource(_orderByFields); // Show the table view. NavigationController.PushViewController(sortFieldsTable, true); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Current = this; // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible(); TodoDB = new TodoDatabase(); // create our nav controller navController = new UINavigationController(); list = new TodoListViewController(); // push the view controller onto the nav controller and show the window navController.PushViewController(list, false); window.RootViewController = navController; window.MakeKeyAndVisible(); return(true); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Current = this; // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible(); // Create the database file var sqliteFilename = "TodoItemDB.db3"; // we need to put in /Library/ on iOS5.1 to meet Apple's iCloud terms // (they don't want non-user-generated data in Documents) string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder string libraryPath = Path.Combine(documentsPath, "..", "Library"); // Library folder var path = Path.Combine(libraryPath, sqliteFilename); conn = new SQLiteConnection(path); TodoManager = new TodoItemManager(conn); // create our nav controller navController = new UINavigationController(); // create our Todo list screen homeViewController = new Screens.HomeScreen(); // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible(); return(true); }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { Current = this; // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); TodoDB = new TodoDatabase(); // create our nav controller navController = new UINavigationController (); list = new TodoListViewController(); // push the view controller onto the nav controller and show the window navController.PushViewController(list, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
private void ShowStatDefinitions(object sender, EventArgs e) { // Create a new UIPickerView and assign a model that will show fields and statistic types UIPickerView statisticPicker = new UIPickerView(); statisticPicker.Model = _statsPickerModel; // Create a new table UITableViewController statsTable = new UITableViewController(UITableViewStyle.Plain); // Create an instance of a custom data source to show statistic definitions in the table // Pass in the list of statistic definitions and the picker (for defining new ones) StatisticDefinitionsDataSource statDefsDataSource = new StatisticDefinitionsDataSource(_statisticDefinitions, statisticPicker); // Set the data source on the table statsTable.TableView.Source = statDefsDataSource; // Put the table in edit mode (to show add and delete buttons) statDefsDataSource.WillBeginTableEditing(statsTable.TableView); statsTable.SetEditing(true, true); // Show the table view this.NavigationController.PushViewController(statsTable, true); }
public void RenderRssStream(Stream stream) { var doc = XDocument.Load (new XmlTextReader (stream)); var items = doc.XPathSelectElements ("./rss/channel/item/title"); XElement a = null; // // Since this is invoked on a separated thread, make sure that // we call UIKit only from the main thread. // InvokeOnMainThread (delegate { var table = new UITableViewController (); navigationController.PushViewController (table, true); // Put the data on a string [] so we can use our existing // UITableView renderer for strings. string [] entries = new string [items.Count ()]; int i = 0; foreach (var e in items) entries [i++] = e.Value; TableViewSelector.Configure (table.View as UITableView, entries); }); }
public MenuTableViewSource(UITableViewController controller, string[] data) { this.data = data; this.controller = controller; }
string cellIdentifier = "taskcell"; // set in the Storyboard public RootTableSource(List <DataSet> items, UITableViewController parent) { tableItems = items; this.parentController = parent; }
public HotDogDataSource(List <HotDog> hotDogs, UITableViewController callingController) { this.hotDogs = hotDogs; }
public SamplesDataSource(UITableViewController controller, List <Object> data) { this.data = data; this.controller = controller; }
public TableViewSource(UITableViewController controller) : base() { _Controller = controller; }
public MenuTableSource(string[] speakers, UITableViewController tvc) { data = speakers; controller = tvc; }
public SpeakersTableSource (List<Speaker> speakers, UITableViewController tvc) { data = speakers; controller = tvc; }
void SetScrollToTop(UITableViewController tvc) { if (tvc == null) return; var offset = scroller.ContentOffset; offset.Y += Parent.TopOffset; var enabled = tvc.View.Frame.Contains (offset); tvc.TableView.ScrollsToTop = enabled; }
public SpeakersTableSource(List <Speaker> speakers, UITableViewController tvc) { data = speakers; controller = tvc; }
public DisasterListTableSource(List <DisasterViewModel> items, UITableViewController parent) { DisasterListItems = items; Parent = parent; }
public ContactSource(UITableViewController controller) { Controller = controller; }
public NamesDataSource(List <ServiceModel> names, UITableViewController callingController) { this.namesList = names; this.sourceController = callingController; }
public async static Task TableRowSelectedAsync(UITableView tableView, NSIndexPath indexPath, ExtensionTableSource tableSource, CredentialProviderViewController cpViewController, UITableViewController controller, IPasswordRepromptService passwordRepromptService, string loginAddSegue) { tableView.DeselectRow(indexPath, true); tableView.EndEditing(true); if (tableSource.Items == null || tableSource.Items.Count() == 0) { controller.PerformSegue(loginAddSegue, tableSource); return; } var item = tableSource.Items.ElementAt(indexPath.Row); if (item == null) { cpViewController.CompleteRequest(); return; } if (item.Reprompt != Bit.Core.Enums.CipherRepromptType.None && !await passwordRepromptService.ShowPasswordPromptAsync()) { return; } if (!string.IsNullOrWhiteSpace(item.Username) && !string.IsNullOrWhiteSpace(item.Password)) { string totp = null; var storageService = ServiceContainer.Resolve<IStorageService>("storageService"); var disableTotpCopy = await storageService.GetAsync<bool?>(Bit.Core.Constants.DisableAutoTotpCopyKey); if (!disableTotpCopy.GetValueOrDefault(false)) { var userService = ServiceContainer.Resolve<IUserService>("userService"); var canAccessPremiumAsync = await userService.CanAccessPremiumAsync(); if (!string.IsNullOrWhiteSpace(item.Totp) && (canAccessPremiumAsync || item.CipherView.OrganizationUseTotp)) { var totpService = ServiceContainer.Resolve<ITotpService>("totpService"); totp = await totpService.GetCodeAsync(item.Totp); } } cpViewController.CompleteRequest(item.Id, item.Username, item.Password, totp); } else if (!string.IsNullOrWhiteSpace(item.Username) || !string.IsNullOrWhiteSpace(item.Password) || !string.IsNullOrWhiteSpace(item.Totp)) { var sheet = Dialogs.CreateActionSheet(item.Name, controller); if (!string.IsNullOrWhiteSpace(item.Username)) { sheet.AddAction(UIAlertAction.Create(AppResources.CopyUsername, UIAlertActionStyle.Default, a => { UIPasteboard clipboard = UIPasteboard.General; clipboard.String = item.Username; var alert = Dialogs.CreateMessageAlert(AppResources.CopyUsername); controller.PresentViewController(alert, true, () => { controller.DismissViewController(true, null); }); })); } if (!string.IsNullOrWhiteSpace(item.Password)) { sheet.AddAction(UIAlertAction.Create(AppResources.CopyPassword, UIAlertActionStyle.Default, a => { UIPasteboard clipboard = UIPasteboard.General; clipboard.String = item.Password; var alert = Dialogs.CreateMessageAlert( string.Format(AppResources.ValueHasBeenCopied, AppResources.Password)); controller.PresentViewController(alert, true, () => { controller.DismissViewController(true, null); }); })); } if (!string.IsNullOrWhiteSpace(item.Totp)) { sheet.AddAction(UIAlertAction.Create(AppResources.CopyTotp, UIAlertActionStyle.Default, async a => { var totp = await tableSource.GetTotpAsync(item); if (string.IsNullOrWhiteSpace(totp)) { return; } UIPasteboard clipboard = UIPasteboard.General; clipboard.String = totp; var alert = Dialogs.CreateMessageAlert( string.Format(AppResources.ValueHasBeenCopied, AppResources.VerificationCodeTotp)); controller.PresentViewController(alert, true, () => { controller.DismissViewController(true, null); }); })); } sheet.AddAction(UIAlertAction.Create(AppResources.Cancel, UIAlertActionStyle.Cancel, null)); controller.PresentViewController(sheet, true, null); } else { var alert = Dialogs.CreateAlert(null, AppResources.NoUsernamePasswordConfigured, AppResources.Ok); controller.PresentViewController(alert, true, null); } }
public EmailServerDataSource(UITableViewController owner) { this.owner = owner; }
public Delegate(UITableViewController aController, ISaveSupport aSaveSupport, IImageXmlIdListener aListener) { iController = aController; iSaveSupport = aSaveSupport; iListener = aListener; }
public MenuTableSource (string[] speakers, UITableViewController tvc) { data = speakers; controller = tvc; }
public ImageData(UITableViewController <T> controller, T data) { this.controller = controller; this.data = data; }
public TableSource(List <string> items, UITableViewController controller) { Items = items; Controller = controller; }
public RecentEventTableSource(List<EventItem> items, UITableViewController owner) { TableItems = items; this.owner = owner; }
public CategoryDataSource(UITableViewController controller, List<TreeItem> data) { this.data = data; this.controller = controller; }
public SamplesDataSource(UITableViewController controller, List<Object> data) { this.data = data; this.controller = controller; }
public TaskTableDelegate(UITableViewController parentController, IEnumerable <Task> tasks) { _parentController = parentController; _tasks = tasks.ToList(); _detailManager = new TaskDetailPageManager(parentController); }
public SamplesDataSource(UITableViewController controller, IList <Sample> data) { _data = data; _controller = controller; }
public TableSource(List <TableItem> items, UITableViewController owner) { tableItems = items; this.owner = owner; }
public CategoryListSource(List <Category> categories, UITableViewController viewController) { this.categories = categories; parentView = viewController as CategoriesController; }
public SessionsTableSource (List<Session> sessions, UITableViewController tvc) { data = sessions; grouping = GetSessionsGroupedByDate(); controller = tvc; }
public MenuTableViewControllerSource(string[] items, UITableViewController tvc) { data = items; controller = tvc; }
public CategoryDataSource(UITableViewController controller, List <SearchableTreeNode> data) { _data = data; _controller = controller; }
public TableViewSource(UITableViewController owner) { // Save the view that contains the UITableView ownerVC = owner; }
public SessionsTableSource(List <Session> sessions, UITableViewController tvc) { data = sessions; grouping = GetSessionsGroupedByDate(); controller = tvc; }
private async void ExecuteStatisticsQuery(object sender, EventArgs e) { // Remove the placeholder "Add statistic" row (if it exists). StatisticDefinition placeholderRow = _statisticDefinitions.LastOrDefault(); if (placeholderRow != null && placeholderRow.OutputAlias == "") { _statisticDefinitions.Remove(placeholderRow); } // Verify that there is at least one statistic definition. if (!_statisticDefinitions.Any()) { ShowAlert("Statistical Query", "Please define at least one statistic for the query."); return; } // Create the statistics query parameters, pass in the list of statistic definitions. StatisticsQueryParameters statQueryParams = new StatisticsQueryParameters(_statisticDefinitions); // Specify the selected group fields (if any). if (_groupByFields != null) { foreach (KeyValuePair <string, bool> groupField in _groupByFields.Where(field => field.Value)) { statQueryParams.GroupByFieldNames.Add(groupField.Key); } } // Specify the fields to order by (if any). if (_orderByFields != null) { foreach (OrderFieldOption orderBy in _orderByFields) { statQueryParams.OrderByFields.Add(orderBy.OrderInfo); } } // Ignore counties with missing data statQueryParams.WhereClause = "\"State\" IS NOT NULL"; // Execute the statistical query with these parameters and await the results. try { StatisticsQueryResult statQueryResult = await _usStatesTable.QueryStatisticsAsync(statQueryParams); // Get results formatted as a dictionary (group names and their associated dictionary of results). Dictionary <string, IReadOnlyDictionary <string, object> > resultsLookup = statQueryResult.ToDictionary(result => string.Join(", ", result.Group.Values), result => result.Statistics); // Create an instance of a custom data source to display the results. StatisticQueryResultsDataSource statResultsDataSource = new StatisticQueryResultsDataSource(resultsLookup); // Create a new table with a grouped style for displaying rows. UITableViewController statResultsTable = new UITableViewController(UITableViewStyle.Grouped) { // Set the table view data source. TableView = { Source = statResultsDataSource } }; // Show the table view. NavigationController.PushViewController(statResultsTable, true); } catch (ArcGISWebException exception) { ShowAlert("There was a problem performing the query.", exception.ToString()); } }