예제 #1
0
        // FIXME:  currently has a bug in support for section value names
        // including a '.'

        private string[] GetPathComponents(string name)
        {
            string key     = Paths.Basename(name, ".");
            string section = Paths.Suffix(name, _prefix);

//Console.WriteLine("section:  '{0}'; key:  '{1}'", section, key);

            string[] pe = section.Split('.');
            if ((_prefix != null && pe.Length >= 2) ||
                (_prefix == null && pe.Length >= 1))
            {
                section = section.Substring(0,
                                            section.Length - key.Length - 1);
            }
            else
            {
                section = key;
                key     = "";
            }

//Console.WriteLine("section:  '{0}'; key:  '{1}'", section, key);
            return(new string[] { section, key });
        }