コード例 #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.");
            }
        }
コード例 #2
0
ファイル: whitelist.xaml.cs プロジェクト: asobti/LOCCounter
 public whitelist(FileExtensions incomingextensions)
 {
     InitializeComponent();
     extensions = incomingextensions;
     PopulateExtensionBoxes();
 }