Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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;
            }
        }