public bool ImportPackages(GameModel model)
        {
            if (model == null)
            {
                throw new ArgumentException("model argument cannot be null");
            }
            if (Directory.Exists(ConfigurationManager.GetImportPath(model)))
            {
                IFileSystemManager fs = GetFileSystem(model);
                bool IsOpened         = false;
                try {
                    IsOpened = fs.Open(FileAccess.Write, 16, ConfigurationManager.GetHFPath(model), ConfigurationManager.GetPFPath(model));
                } catch {
                    IsOpened = false;
                }

                if (!IsOpened)
                {
                    OnFileSystemOpenError();
                    return(false);
                }
                try {
                    return(fs.WriteDirectory(ConfigurationManager.GetImportPath(model), true));
                } finally {
                    fs.Close();
                }
            }
            return(true);
        }
Esempio n. 2
0
 protected override void OnClose()
 {
     if (FileSystem != null)
     {
         if (FileSystem.IsOpened)
         {
             FileSystem.Close();
         }
     }
 }