public static FileType GetFileType(Configuration config, string name) { FileType result = new FileType(); result._config = config; result._name = name; result.LoadData(); if (result._extensions.Count > 0) return result; else return null; }
public static List<FileType> GetFileTypes(Configuration config) { List<FileType> result = new List<FileType>(); if (config != null && config.Items.ContainsKey("PG_SPAWFM_FILETYPES")) { foreach (XmlNode ft in config["PG_SPAWFM_FILETYPES"].XmlNode.ChildNodes) { FileType ftype = new FileType(); ftype._config = config; ftype._name = ft.Attributes["name"].Value; ftype.LoadData(); result.Add(ftype); } } return result; }