private void loadPatternList()
        {
            Helpers.logMessageToFile("Loading patternList.xml");
            TextReader    r = new StreamReader(Path.Combine(Application.StartupPath, Path.Combine("xml", "patternList.xml")));
            XmlSerializer s = new XmlSerializer(typeof(patterns));

            this.patterns = (patterns)s.Deserialize(r);
            r.Close();
            Helpers.logMessageToFile(patterns.Items.Count + " patterns found");

            if (File.Exists(Path.Combine(Application.StartupPath, Path.Combine("xml", "customPatterns.xml"))))
            {
                Helpers.logMessageToFile("Loading customPatterns.xml");
                TextReader    r2 = new StreamReader(Path.Combine(Application.StartupPath, Path.Combine("xml", "customPatterns.xml")));
                XmlSerializer s2 = new XmlSerializer(typeof(patterns));
                this.customPatterns = (patterns)s2.Deserialize(r2);
                r2.Close();
                Helpers.logMessageToFile(customPatterns.Items.Count + " custom patterns found");
            }
            if (this.customPatterns == null)
            {
                this.customPatterns = new patterns();
            }
        }
        private void loadPatternList()
        {
            Helpers.logMessageToFile("Loading patternList.xml");
            TextReader r = new StreamReader(Path.Combine(Application.StartupPath,  Path.Combine("xml", "patternList.xml")));
            XmlSerializer s = new XmlSerializer(typeof(patterns));
            this.patterns = (patterns)s.Deserialize(r);
            r.Close();
            Helpers.logMessageToFile(patterns.Items.Count + " patterns found");

            if (File.Exists(Path.Combine(Application.StartupPath, Path.Combine("xml", "customPatterns.xml"))))
            {
                Helpers.logMessageToFile("Loading customPatterns.xml");
                TextReader r2 = new StreamReader(Path.Combine(Application.StartupPath, Path.Combine("xml", "customPatterns.xml")));
                XmlSerializer s2 = new XmlSerializer(typeof(patterns));
                this.customPatterns = (patterns)s2.Deserialize(r2);
                r2.Close();
                Helpers.logMessageToFile(customPatterns.Items.Count + " custom patterns found");
            }
            if (this.customPatterns == null) this.customPatterns = new patterns();
        }