示例#1
0
 static public int typeArraySize(string name)
 {
     if (isType(name))
     {
         TypeDictionaryBase tdb = (TypeDictionaryBase)dictionary.types[name.ToLower()];
         return(tdb.ArraySize);
     }
     return(1);
 }
示例#2
0
 private void readFolder(string path, HashSet <DictionaryBase> collection)
 {
     if (Directory.Exists(path))
     {
         string[] files = System.IO.Directory.GetFiles(path, "*.xpo");
         foreach (string file in files)
         {
             string             name = file.Substring(path.Length + 1, file.Length - path.Length - 5);
             TypeDictionaryBase d    = new TypeDictionaryBase();
             d.Name = name;
             collection.Add(d);
         }
     }
 }
示例#3
0
        private void init(string path)
        {
            types  = new Hashtable();
            enums  = new Hashtable();
            fields = new Hashtable();
            TypeDictionaryBase.readFile("..\\..\\Dictionary\\types.txt", types);
            EnumDictionaryBase.readFile("..\\..\\Dictionary\\enums.txt", enums);
            TypeDictionaryBase.readFile("Dictionary\\types.txt", types);
            EnumDictionaryBase.readFile("Dictionary\\enums.txt", enums);
            FieldDictionaryBase.readFile("Dictionary\\fields.txt", fields);

            TypeDictionaryBase.readFolder(path + "\\Data Dictionary\\Extended Data Types", types);
            EnumDictionaryBase.readFolder(path + "\\Data Dictionary\\Base Enums", enums);
            FieldDictionaryBase.readFolder(path + "\\Data Dictionary\\Tables", fields);
        }
示例#4
0
 public static void readFolder(string path, Hashtable collection)
 {
     if (Directory.Exists(path))
     {
         string[] files = System.IO.Directory.GetFiles(path, "*.xpo");
         foreach (string file in files)
         {
             string             name = file.Substring(path.Length + 1, file.Length - path.Length - 5);
             TypeDictionaryBase d    = new TypeDictionaryBase();
             d.Name = name;
             if (!collection.ContainsKey(d.Key))
             {
                 d.ArraySize = TypeDictionaryBase.readArrayLength(file);
                 collection.Add(name.ToLower(), d);
             }
         }
     }
 }
示例#5
0
 static public void readFile(string filename, Hashtable collection)
 {
     if (File.Exists(filename))
     {
         using (StreamReader reader = new StreamReader(filename))
         {
             string line = reader.ReadLine();
             while (line != null)
             {
                 TypeDictionaryBase d      = new TypeDictionaryBase();
                 string[]           values = line.Split(';');
                 d.Name      = values[0];
                 d.ArraySize = Int32.Parse(values[1]);
                 if (!collection.ContainsKey(d.Key))
                 {
                     collection.Add(d.Name.ToLower(), d);
                 }
                 line = reader.ReadLine();
             }
         }
     }
 }
示例#6
0
 private void readFile(string filename, HashSet <DictionaryBase> collection)
 {
     if (File.Exists(filename))
     {
         using (StreamReader reader = new StreamReader(filename))
         {
             string line = reader.ReadLine();
             while (line != null)
             {
                 TypeDictionaryBase d      = new TypeDictionaryBase();
                 string[]           values = line.Split(';');
                 d.Name = values[0];
                 if (values.Length > 1)
                 {
                     d.ArraySize = Int32.Parse(values[1]);
                 }
                 collection.Add(d);
                 line = reader.ReadLine();
             }
         }
     }
 }