Ejemplo n.º 1
0
 /// <summary>
 /// Validates the UI text file (localization file) for being compatible with ManagedUI.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="throwOnError">if set to <c>true</c> [throw on error].</param>
 /// <returns></returns>
 public static bool ValidateUITextFile(string file, bool throwOnError = true)
 {
     try
     {
         var data = new ResourcesData();
         data.InitFromWxl(System.IO.File.ReadAllBytes(file));
     }
     catch (Exception e)
     {
         //may need to do extra logging; not important for now
         if (throwOnError)
         {
             throw new Exception("Localization file is incompatible with ManagedUI.", e);
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }