public override void Bolter(FileInfo f, TypeFileBank typefile) { if (!f.Name.ToLower().EndsWith(".xml", StringComparison.Ordinal)) { return; } try { ParsingXml(f, typefile); } catch (Exception e) { Log.Logger("Ошибка при парсинге xml", e, f); } }
public void ParsingXml(FileInfo f, TypeFileBank typefile) { using (StreamReader sr = new StreamReader(f.ToString(), Encoding.Default)) { var ftext = sr.ReadToEnd(); ftext = ClearText.ClearString(ftext); XmlDocument doc = new XmlDocument(); doc.LoadXml(ftext); string jsons = JsonConvert.SerializeXmlNode(doc); JObject json = JObject.Parse(jsons); switch (typefile) { case TypeFileBank.Bank: Bank44 b = new Bank44(f, json); b.Parsing(); break; } } }
public virtual void Bolter(FileInfo f, TypeFileBank typefile) { }