/// <summary> /// Get all references that match a search string. /// </summary> /// <param name="searchString">Search string.</param> /// <returns>All references that matches the search string.</returns> public static ReferenceList GetReferences(String searchString) { ReferenceList references = new ReferenceList(); // Get data from web service. references = new ReferenceList(); foreach (WebReference webReference in WebServiceClient.GetReferencesBySearchString(searchString)) { references.Add(new Reference(webReference.Id, webReference.Name, webReference.Year, webReference.Text)); } return(references); }
/// <summary> /// Get all references from web service. /// </summary> private static void LoadReferences() { ReferenceList references; if (References.IsNull()) { // Get data from web service. references = new ReferenceList(true); foreach (WebReference webReference in WebServiceClient.GetReferences()) { references.Add(new Reference(webReference.Id, webReference.Name, webReference.Year, webReference.Text)); } References = references; } }