Esempio n. 1
0
        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.");
            }
        }
Esempio n. 2
0
 public whitelist(FileExtensions incomingextensions)
 {
     InitializeComponent();
     extensions = incomingextensions;
     PopulateExtensionBoxes();
 }