public static EPGSearch FromXML(string theXML) { EPGSearch newSearch = new EPGSearch(); XmlSerializer serializer = new XmlSerializer(newSearch.GetType()); StringReader sr = new StringReader(theXML); try { return (EPGSearch)serializer.Deserialize(sr); } catch { return null; } }
public static EPGSearch FromXML(string theXML) { EPGSearch newSearch = new EPGSearch(); XmlSerializer serializer = new XmlSerializer(newSearch.GetType()); StringReader sr = new StringReader(theXML); try { return((EPGSearch)serializer.Deserialize(sr)); } catch { return(null); } }
public static string TVProgrammesMatchingSearch(EPGSearch theSearch) { List<TVProgramme> matchedProgs = null; bool wereTruncated = false; //if (theSearch.LimitToDateRange) TODO // matchedProgs = EPGManager.mcData.SearchTVProgrammesByDateRange(theSearch.DateRange, theSearch.TextToSearch, theSearch.TextType, theSearch.MatchType, out wereTruncated); //else matchedProgs = EPGManager.SearchTVProgrammes(theSearch.TextToSearch, theSearch.TextType, theSearch.MatchType, out wereTruncated); return XMLHelper.Serialize<List<TVProgramme>>(matchedProgs); }