private static MemberImport MapImport(XmlNode node) { var m = new MemberImport(); var username = node.SelectSingleNode("username"); var email = node.SelectSingleNode("email"); if (username != null && email != null) { m.Username = username.InnerText; m.Email = email.InnerText; var website = node.SelectSingleNode("website"); if (website != null) { m.Website = website.InnerText; } var twitter = node.SelectSingleNode("twitter"); if (twitter != null) { var twit = twitter.InnerText.Replace("http://", "").Replace("https://", ""); if (twit.IndexOf("/", StringComparison.CurrentCultureIgnoreCase) >= 0) { m.Twitter = twit.Split('/')[1]; } else { m.Twitter = twit; } } var points = node.SelectSingleNode("points"); if (points != null) { try { m.Points = Convert.ToInt32(points.InnerText); } catch { // Don't need to do anything } } var isadmin = node.SelectSingleNode("isadmin"); if (isadmin != null) { try { m.IsAdmin = Convert.ToBoolean(isadmin.InnerText); } catch { // Don't need to do anything } } return m; } return null; }
private static MemberImport MapImport(XmlNode node) { var m = new MemberImport(); var username = node.SelectSingleNode("username"); var email = node.SelectSingleNode("email"); if (username != null && email != null) { m.Username = username.InnerText; m.Email = email.InnerText; var website = node.SelectSingleNode("website"); if (website != null) { m.Website = website.InnerText; } var twitter = node.SelectSingleNode("twitter"); if (twitter != null) { var twit = twitter.InnerText.Replace("http://", "").Replace("https://", ""); if (twit.IndexOf("/", StringComparison.CurrentCultureIgnoreCase) >= 0) { m.Twitter = twit.Split('/')[1]; } else { m.Twitter = twit; } } var points = node.SelectSingleNode("points"); if (points != null) { try { m.Points = Convert.ToInt32(points.InnerText); } catch { // Don't need to do anything } } var isadmin = node.SelectSingleNode("isadmin"); if (isadmin != null) { try { m.IsAdmin = Convert.ToBoolean(isadmin.InnerText); } catch { // Don't need to do anything } } return(m); } return(null); }