Exemple #1
0
 public void ConvertAll(string hbmDirectory, string mapDirectory, string nameSpace)
 {
     string[] files = Directory.GetFiles(hbmDirectory, "*" + HbmFileUtility.NHibernateFileExtension);
     foreach (string hbmFilePath in files)
     {
         try
         {
             _writeToConsole(hbmFilePath);
             foreach (var classInfo in HbmFileUtility.LoadFile(hbmFilePath))
             {
                 ConvertFile(classInfo, nameSpace, mapDirectory);
             }
         }
         catch (Exception ex)
         {
             _writeToError("Caught exception processing file " + Path.GetFileName(hbmFilePath) + ": " + ex);
         }
     }
     _writeToConsole("done...");
 }
Exemple #2
0
        private void ConvertDirectoryRecursively(string directory, string nameSpace)
        {
            string[] files = Directory.GetFiles(directory, "*" + HbmFileUtility.NHibernateFileExtension);
            foreach (string hbmFilePath in files)
            {
                try
                {
                    _writeToConsole(hbmFilePath);
                    foreach (var classInfo in HbmFileUtility.LoadFile(hbmFilePath))
                    {
                        ConvertFile(classInfo, nameSpace, directory);
                    }
                }
                catch (Exception ex)
                {
                    _writeToError("Caught exception processing file " + Path.GetFileName(hbmFilePath) + ": " + ex);
                }
            }

            foreach (string subDirectory in Directory.GetDirectories(directory))
            {
                ConvertDirectoryRecursively(subDirectory, nameSpace);
            }
        }