public static List <T> findElementsOfType <T>(KmlFile file, Type t) { List <object> tempList = new List <object>(); file.findElementsOfType <T>(tempList); List <T> result = tempList.ConvertAll(delegate(object x) { return((T)x); }); return(result); }
public static KmlFile fromFile(string filename, Logger log) { XmlDocument doc = new XmlDocument(); doc.Load(filename); KmlFile result = new KmlFile(doc, log); return(result); }
public static bool toFile(KmlFile doc, string filename) { try { XmlDocument result = doc.ToXml(); if (null != result) { result.Save(filename); return(true); } return(false); } catch (Exception ex) { Console.WriteLine(ex.Message); return(false); } }