Пример #1
0
        public bool LoadWzFile(string name)
        {
            try
            {
                WzFile wzf = new WzFile(Path.Combine(baseDir, Capitalize(name) + ".wz"), version);

                WzFileParseStatus parseStatus = wzf.ParseWzFile();
                if (parseStatus != WzFileParseStatus.Success)
                {
                    MessageBox.Show("Error parsing " + name + ".wz (" + parseStatus.GetErrorDescription() + ")");
                    return(false);
                }

                name                = name.ToLower();
                wzFiles[name]       = wzf;
                wzFilesUpdated[wzf] = false;
                wzDirs[name]        = new WzMainDirectory(wzf);
                return(true);
            }
            catch (Exception)
            {
                //HaRepackerLib.Warning.Error("Error initializing " + name + ".wz (" + e.Message + ").\r\nCheck that the directory is valid and the file is not in use.");
                return(false);
            }
        }
Пример #2
0
        public bool LoadDataWzFile(string name)
        {
            try
            {
                WzFile wzf = new WzFile(Path.Combine(baseDir, Capitalize(name) + ".wz"), version);

                string parseErrorMessage = string.Empty;
                bool   parseSuccess      = wzf.ParseWzFile(out parseErrorMessage);

                name                = name.ToLower();
                wzFiles[name]       = wzf;
                wzFilesUpdated[wzf] = false;
                wzDirs[name]        = new WzMainDirectory(wzf);
                foreach (WzDirectory mainDir in wzf.WzDirectory.WzDirectories)
                {
                    wzDirs[mainDir.Name.ToLower()] = new WzMainDirectory(wzf, mainDir);
                }
                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show("Error initializing " + name + ".wz (" + e.Message + ").\r\nCheck that the directory is valid and the file is not in use.");
                return(false);
            }
        }
Пример #3
0
        public bool LoadWzFile(string name)
        {
            bool hasError = false;

            name = name.ToLower();

            foreach (string path in Directory.GetFiles(baseDir, Capitalize(name) + "*.wz"))
            {
                string fileName = Path.GetFileNameWithoutExtension(path).ToLower();

                try
                {
                    WzFile wzf = new WzFile(path, version);
                    wzf.ParseWzFile();
                    wzFiles[fileName]   = wzf;
                    wzFilesUpdated[wzf] = false;
                    wzDirs[fileName]    = new WzMainDirectory(wzf);
                }
                catch (Exception e)
                {
                    HaRepackerLib.Warning.Error("Error initializing " + name + ".wz (" + e.Message + ").\r\nCheck that the directory is valid and the file is not in use.");
                    hasError = true;
                }
            }

            return(!hasError);
        }
Пример #4
0
 public bool LoadWzFile(string name)
 {
     try
     {
         WzFile wzf = new WzFile(Path.Combine(baseDir, Capitalize(name) + ".wz"), version);
         wzf.ParseWzFile();
         name                = name.ToLower();
         wzFiles[name]       = wzf;
         wzFilesUpdated[wzf] = false;
         wzDirs[name]        = new WzMainDirectory(wzf);
         return(true);
     }
     catch (Exception e)
     {
         HaRepackerLib.Warning.Error("Error initializing " + name + ".wz (" + e.Message + ").\r\nCheck that the directory is valid and the file is not in use.");
         return(false);
     }
 }
Пример #5
0
 public bool LoadWzFile(string name)
 {
     try
     {
         WzFile wzf = new WzFile(Path.Combine(baseDir, Capitalize(name) + ".wz"), version);
         wzf.ParseWzFile();
         name = name.ToLower();
         wzFiles[name] = wzf;
         wzFilesUpdated[wzf] = false;
         wzDirs[name] = new WzMainDirectory(wzf);
         return true;
     }
     catch (Exception e)
     {
         HaRepackerLib.Warning.Error("Error initializing " + name + ".wz (" + e.Message + ").\r\nCheck that the directory is valid and the file is not in use.");
         return false;
     }
 }
Пример #6
0
 public bool LoadDataWzFile(string name)
 {
     try
     {
         WzFile wzf = new WzFile(Path.Combine(baseDir, Capitalize(name) + ".wz"), version);
         wzf.ParseWzFile();
         name = name.ToLower();
         wzFiles[name] = wzf;
         wzFilesUpdated[wzf] = false;
         wzDirs[name] = new WzMainDirectory(wzf);
         foreach (WzDirectory mainDir in wzf.WzDirectory.WzDirectories)
         {
             wzDirs[mainDir.Name.ToLower()] = new WzMainDirectory(wzf, mainDir);
         }
         return true;
     }
     catch (Exception e)
     {
         MessageBox.Show("Error initializing " + name + ".wz (" + e.Message + ").\r\nCheck that the directory is valid and the file is not in use.");
         return false;
     }
 }