void UpdateComboBox() { LinkComboBox?.RemoveAll(); string mostRecentDocument = RecentStore.SharedRecentStore.GetMostRecent(); var recentDocuments = RecentStore.SharedRecentStore.GetRecents(); if (!string.IsNullOrEmpty(mostRecentDocument)) { LinkComboBox.StringValue = mostRecentDocument; } if (recentDocuments != null) { LinkComboBox.Completes = true; LinkComboBox.MaximumNumberOfLines = 12; foreach (NSString link_id in recentDocuments.Keys) { var title = (NSString)recentDocuments.ValueForKey(link_id); if (!string.IsNullOrWhiteSpace(title.ToString())) { LinkComboBox.Add(title); } else { LinkComboBox.Add(link_id); } } } }
void PopulateLinkComboBox() { string[] recents = GetRecents(); if (recents != null) { foreach (string recent_item in GetRecents()) { LinkComboBox.Add(new NSString(recent_item)); } } LinkComboBox.StringValue = "" + NSUserDefaults.StandardUserDefaults.StringForKey(LAST_DOCUMENT_KEY); }