private void SaveMixedList(TextWriter w, List <string[]> list, MixedList listType)
        {
            for (int i = 0; i < list.Count; ++i)
            {
                string   newLine = "";
                string[] line    = list[i];
                for (int j = 0; j < line.Length && j < listType.NumberOfFields(); ++j)
                {
                    switch (listType.GetFieldType(j))
                    {
                    case DataTypes.Integer:
                        newLine += int.Parse(line[j]).ToString();
                        break;

                    case DataTypes.Double:
                        newLine += Double.Parse(line[j]).ToString();
                        break;

                    case DataTypes.String:
                        newLine += line[j];
                        break;
                    }

                    if (j < line.Length - 1)
                    {
                        newLine += " ";
                    }
                }
                w.WriteLine(newLine);
            }
        }
        public ConfiguratedFile()
        {
            FileStructure  = new List <DataNode[]>();
            MixedListTypes = new Dictionary <string, MixedList>();

            StreamReader s = File.OpenText("vartypes.in");

            //Load all the variable types
            string read = s.ReadLine();

            while (read != null)
            {
                string[] split = read.Split(new[] { ' ', '\t' });
                if (split.Length > 0)
                {
                    var mixedList = new MixedList();

                    string name = split[0];
                    for (int i = 1; i < split.Length; ++i)
                    {
                        switch (split[i])
                        {
                        case "i":
                            mixedList.AddNewFieldType(DataTypes.Integer);
                            break;

                        case "d":
                            mixedList.AddNewFieldType(DataTypes.Double);
                            break;

                        case "s":
                            mixedList.AddNewFieldType(DataTypes.String);
                            break;
                        }
                    }

                    MixedListTypes.Add(name, mixedList);
                }

                read = s.ReadLine();
            }

            s.Close();
        }