Exemple #1
0
        public static Dictionary <string, string[]> prjsupbl(_Dictionary <string, string> bandlistdic, string project)
        {
            Dictionary <string, string[]> retdic = new Dictionary <string, string[]>();

            foreach (KeyValuePair <string, string> kvp in bandlistdic)
            {
                if (kvp.Key.EndsWith(project))
                {
                    string   k  = kvp.Key.Split('_')[0];
                    string[] bl = kvp.Value.Split(' ');
                    retdic.Add(k, bl);
                }
            }
            return(retdic);
        }
Exemple #2
0
        public static _Dictionary <string, string> readconfig(string fn, char sp = '=')
        {
            _Dictionary <string, string> retdic = new _Dictionary <string, string>();

            string[] lines = File.ReadAllLines(fn);
            foreach (string line in lines)
            {
                if (!line.StartsWith("#"))
                {
                    string[] kvp = line.Split(sp);
                    if (kvp.Count() > 1)
                    {
                        retdic.Add(kvp[0].Trim(), kvp[1].Trim());
                    }
                }

                // Use a tab to indent each line of the file.
            }
            return(retdic);
        }