Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Clear();

            string[] exts = new string[] { "*.wav" };



            // find something NOT in RR directory

            PathProcessor pathProc = new PathProcessor(
                delegate(string path, Boolean load)
            {
                try
                {
                    string conatiningDir = Path.GetDirectoryName(path);
                    // is in RR?
                    Boolean isRR = false;
                    for (int i = 1; i <= 9; i++)
                    {
                        if (conatiningDir.EndsWith("\\RR" + i))
                        {
                            isRR = true; break;
                        }
                    }
                    if (isRR)
                    {
                        return(true);
                    }

                    // no
                    _processFile(path);
                    didSomething = true;
                    return(false);                 //stop?
                }
                catch
                {
                }

                return(false);
            }, exts);

            didSomething = true;
            while (didSomething)
            {
                didSomething = false;
                pathProc.Process(fileFieldAndBrowser1.FileName, true);
            }


            string filename = fileFieldAndBrowser1.FileName;

            textBox1.AppendText(filename);
            textBox1.AppendText(Environment.NewLine);
        }