public string[] get_urls(string[] xml_ids, string[] option_ids, List <xml_offer> offers) { string[] urls = xml_ids.Except(option_ids).ToArray(); if (urls == null) { return(null); } string url /*, id_op*/; Regex r_url = new Regex(@"(.*/\d+)/"); for (int i = 0; i < urls.Length; i++) { xml_offer offer = offers.Find(ul => ul.id == urls[i]); url = r_url.Match(offer.url).Groups[1].Value; urls[i] = url; } return(urls); }
public string get_property(string property, xml_offer op) { if (property == "") { } try { FieldInfo i = typeof(xml_offer).GetField(property.ToLower()); if (i == null) { return(""); } object value = i.GetValue(op); if (value == null) { return(""); } return(value.ToString()); } catch { return(""); } }