private void PopulateExtensions() { string filename = "whitelist.xml"; try { var deserializer = new System.Xml.Serialization.XmlSerializer(typeof(FileExtensions)); FileStream fs = new FileStream(filename, FileMode.Open); XmlReader reader = new XmlTextReader(fs); extensions = (FileExtensions)deserializer.Deserialize(reader); fs.Close(); reader.Close(); LogToBox("Whitelist loaded"); } catch { extensions = null; btnWhitelist.Visibility = System.Windows.Visibility.Hidden; LogToBox("Failed to load whitelist. Won't ignore any files."); } }
public whitelist(FileExtensions incomingextensions) { InitializeComponent(); extensions = incomingextensions; PopulateExtensionBoxes(); }