Ejemplo n.º 1
0
            static public void Read(DspAudioTestForm form)
            {
                FileInfo f = FilePath;

                if (!f.Exists)
                {
                    return;                            // use defaults
                }
                string content = File.ReadAllText(f.FullName);

                foreach (Regex rx in Expressions)
                {
                    Match m = rx.Match(content);

                    Debug.WriteLine(string.Format("Match Content: {0}", content));
                    Debug.WriteLine(string.Format("IsMatch: {0}, Name: {1}, Value: {2}", rx.IsMatch(content), m.Groups[1].Value, m.Groups[2].Value));

                    string test = m.Groups[1].Value;
                    switch (test)
                    {
//							case "IsFileViewVisible": form.IsFileViewVisible = Boolean.Parse(m.Groups[2].Value); break;
                    case "IsFileListVisible": form.IsFileListVisible = Boolean.Parse(m.Groups[2].Value); break;

                    case "IsWaveVisible": form.IsWaveVisible = Boolean.Parse(m.Groups[2].Value); break;
                    }
                }
                f = null;
            }
Ejemplo n.º 2
0
            static public void Save(DspAudioTestForm form)
            {
                FileInfo f = FilePath;

                Clear(f);
                using (FileStream fs = File.Open(f.FullName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None))
                    using (TextWriter writer = new StreamWriter(fs))
                    {
                        writer.Write("IsFileListVisible = {0}\n", form.IsFileListVisible);
                        writer.Write("IsWaveVisible = {0}\n", form.IsWaveVisible);
                        writer.Write("IsFileViewVisible = {0}\n", form.IsWaveVisible);
                    }
                f = null;
            }