Esempio n. 1
0
        public List<CFGUtil> loadCFG(String sectionName)
        {
            dumpBuffer();
            lastWasBuffer = false;
            if(!File.Exists(filepath))
                return new List<CFGUtil>();

            String[] lines = File.ReadAllLines(filepath);

            bool sectionFound = false;
            for (int i = 0; i < lines.Length; i++)
            {
                if (lines[i].StartsWith("[" + sectionName) && !sectionFound)
                {
                    sectionFound = true;
                    continue;
                }

                if (lines[i].StartsWith("[") && sectionFound)
                    return buffer;

                if (sectionFound)
                {
                    CFGUtil r = new CFGUtil();
                    String[] t = lines[i].Split(";".ToCharArray(), 3, StringSplitOptions.None);
                    r.a = t[0];
                    r.b = t[1];
                    r.c = t[2];
                    buffer.Add(r);
                }
            }
            return buffer;
        }
Esempio n. 2
0
        public void bufferData(String a, String b, String c)
        {
            if (!lastWasBuffer)
            {
                dumpBuffer();

                lastWasBuffer = true;
            }
            CFGUtil l = new CFGUtil();
            l.a = a;
            l.b = b;
            l.c = c;

            buffer.Add(l);
        }