Beispiel #1
0
        static void compare()
        {
            bool          save        = false;
            List <string> structFiles = new List <string>(Directory.GetFiles(structuresDir));

            foreach (string structPath in structFiles)
            {
                string fileName = System.IO.Path.GetFileName(structPath);
                string key      = System.IO.Path.GetFileNameWithoutExtension(structPath);
                if (structures.FindIndex(s => s.Key == key) == -1)
                {
                    save = true;
                    structures.Add(new StructureInfo()
                    {
                        Path      = structPath,
                        FileName  = GuessName.Result(key, NameType.File),
                        TableName = GuessName.Result(key, NameType.Table)
                    });
                }
            }

            if (save)
            {
                Save();
            }
        }
Beispiel #2
0
 static void create()
 {
     using (StreamWriter sw = new StreamWriter(File.Create(infoPath))
     {
         AutoFlush = true
     })
     {
         foreach (string filePath in Directory.GetFiles(structuresDir))
         {
             string structName = System.IO.Path.GetFileNameWithoutExtension(filePath);
             string infoString = string.Format(@"{0}|{1}|{2}|{3}|{4}", structName, filePath, GuessName.Result(structName, NameType.File), GuessName.Result(structName, NameType.Table), string.Empty);
             sw.WriteLine(infoString);
         }
     }
 }