public PackageCreator(IFileSystem fileSystem, IZipFileService zipFileService, IPackageLogger logger, IAssemblyFileFinder assemblyFinder)
 {
     _fileSystem = fileSystem;
     _zipFileService = zipFileService;
     _logger = logger;
     _assemblyFinder = assemblyFinder;
 }
Example #2
0
 public UpdateZipFilesJob(IConfiguration configuration, IZipFileService zipFileService, ISettingRepository settingRepository, ILogger <UpdateZipFilesJob> logger, IDateTimeNowWrapper dateTimeNowWrapper)
 {
     _configuration      = configuration;
     _zipFileService     = zipFileService;
     _settingRepository  = settingRepository;
     _logger             = logger;
     _dateTimeNowWrapper = dateTimeNowWrapper;
 }
Example #3
0
 public BigZipController(IZipFileService zipFileService,
                         IUserService userService,
                         ILogger logger)
     : base(logger)
 {
     this._zipFileService = zipFileService;
     this._userService    = userService;
 }
Example #4
0
 private DesktopReferenceDataFileService NewService(
     IDesktopReferenceDataConfiguration desktopConfig     = null,
     IDesktopReferenceDataFileNameService fileNameService = null,
     IZipFileService zipFileService = null,
     ILogger logger = null)
 {
     return(new DesktopReferenceDataFileService(desktopConfig, fileNameService, zipFileService, logger));
 }
Example #5
0
        private void PerformIOC()
        {
            IoCContainer.ResoloveDependencies();

            _conFileService = IoCContainer.Resolve <IConFileService>();
            _zipFileService = IoCContainer.Resolve <IZipFileService>();
            _xmlFileService = IoCContainer.Resolve <IXmlFileService>();
            _docTypeService = IoCContainer.Resolve <IDocTypeService>();
            _manCoService   = IoCContainer.Resolve <IManCoService>();
        }
Example #6
0
        /// <summary>
        /// 
        /// </summary>
        public MainWindow()
        {
            _zipFileRepository = RepositoryManager.GetInstanceOf<IZipFileRepository>();
            _gameRepository = RepositoryManager.GetInstanceOf<IMameGameRepository>();
            _settingsService = ServiceManager.GetInstanceOf<IMameMinerSettingsService>();
            _zipFileService = ServiceManager.GetInstanceOf<IZipFileService>();

            InitializeComponent();

            SetStatus("Main Window Created");
        }
Example #7
0
 public QuickSearchController(
     IGridRunService gridRunService,
     IXmlFileService xmlFileService,
     IZipFileService zipFileService,
     IUserService userService,
     ILogger logger)
     : base(logger)
 {
     _gridRunService      = gridRunService;
     _xmlFileService      = xmlFileService;
     this._zipFileService = zipFileService;
     this._userService    = userService;
 }
 public void UpdateZipFilesTestShouldCreateTwoBatches(string value)
 {
     if (value == "dk")
     {
         _packageBuilder.Setup(x => x.BuildPackageContentV2(It.IsAny <DateTime>(), ZipFileOrigin.Dk)).Returns(new List <byte[]>());
     }
     if (value == "all")
     {
         _packageBuilder.Setup(x => x.BuildPackageContentV2(It.IsAny <DateTime>(), ZipFileOrigin.All)).Returns(new List <byte[]>());
     }
     _zipFileService = new ZipFileService(_configuration, _packageBuilder.Object, _zipFileInfoService.Object, _fileSystem.Object);
     _zipFileService.UpdateZipFiles(DateTime.Now.AddDays(-1), DateTime.Now);
     _fileSystem.Verify(x => x.WriteAllBytes(It.IsAny <string>(), It.IsAny <byte[]>()), Times.Exactly(2));
 }
Example #9
0
        /// <summary>
        /// 
        /// </summary>
        public MainWindow()
        {
            _zipFileRepository = RepositoryManager.GetInstanceOf<IZipFileRepository>();
            _gameRepository = RepositoryManager.GetInstanceOf<IMameGameRepository>();
            _settingsService = ServiceManager.GetInstanceOf<IMameMinerSettingsService>();
            _zipFileService = ServiceManager.GetInstanceOf<IZipFileService>();

            InitializeComponent();

            SetStatus("Main Window Created");

            if (_settingsService.GetMameExecutablePath() == string.Empty || _settingsService.GetMameExportPath() == string.Empty || _settingsService.GetMameImportPath() == string.Empty)
            {
                new SettingsWindow(_settingsService).ShowDialog();
            }
        }
Example #10
0
 /// <summary>
 /// Default Constructor.
 /// </summary>
 /// <param name="engine">The nexdox engine containing all the streams.</param>
 /// <param name="appInfo">Application Info created by NexdoxLaunch and passed to the program on declaration.</param>
 public Allocation(
     NexdoxEngine engine,
     ApplicationInfo appInfo,
     IConFileService conFileService,
     IXmlFileService xmlFileService,
     IZipFileService zipFileService,
     IDocTypeService docTypeService,
     IManCoService manCoService)
 {
     this._engine    = engine;
     this._appInfo   = appInfo;
     _conFileService = conFileService;
     _xmlFileService = xmlFileService;
     _zipFileService = zipFileService;
     _docTypeService = docTypeService;
     _manCoService   = manCoService;
 }
Example #11
0
        protected override void beforeEach()
        {
            const string projectName = "TestProject";

            theInput = new NewCommandInput
            {
                ProjectName = projectName
            };
            fileSystem      = MockRepository.GenerateStub <IFileSystem>();
            zipService      = MockRepository.GenerateStub <IZipFileService>();
            keywordReplacer = MockRepository.GenerateStub <IKeywordReplacer>();
            processFactory  = MockRepository.GenerateStub <IProcessFactory>();

            fileSystem.Stub(x => x.FindFiles(Arg <string> .Is.Anything, Arg <FileSet> .Is.NotNull)).Return(new string[0]);

            ClassUnderTest.FileSystem = fileSystem;
            ClassUnderTest.ZipService = zipService;
        }
        public AdminController(
            IOrchardServices orchardServices,
            IContentManager contentManager,
            IModuleGeneratorService moduleGeneratorService,
            IZipFileService zipFileService,
            ShellSettings shellSettings,
            ShellBlueprint shellBlueprint,
            IAppDataFolder appDataFolder)
        {
            _orchardServices        = orchardServices;
            _contentManager         = contentManager;
            _moduleGeneratorService = moduleGeneratorService;
            _zipFileService         = zipFileService;
            _shellSettings          = shellSettings;
            _shellBlueprint         = shellBlueprint;
            _appDataFolder          = appDataFolder;

            Logger = NullLogger.Instance;
            T      = NullLocalizer.Instance;
        }
        public AdminController(
            IOrchardServices orchardServices,
            IContentManager contentManager,
            IModuleGeneratorService moduleGeneratorService,
            IZipFileService zipFileService,
            ShellSettings shellSettings,
            ShellBlueprint shellBlueprint,
            IAppDataFolder appDataFolder)
        {
            _orchardServices = orchardServices;
            _contentManager = contentManager;
            _moduleGeneratorService = moduleGeneratorService;
            _zipFileService = zipFileService;
            _shellSettings = shellSettings;
            _shellBlueprint = shellBlueprint;
            _appDataFolder = appDataFolder;

            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }
Example #14
0
 public PackageExploder(IZipFileService service, IPackageExploderLogger logger, IFileSystem fileSystem)
 {
     _service = service;
     _logger = logger;
     _fileSystem = fileSystem;
 }
Example #15
0
        public void SaveToDatabase(IXmlFileService xmlFileService,
                                   IZipFileService zipFileService, IConFileService conFileService, IDocTypeService docTypeService, IManCoService manCoService, ApplicationInfo appInfo)
        {
            try
            {
                NexdoxMessaging.SendMessage("    Adding Data to SQL Database", true, this);
                foreach (ZipPackage zp in Statics.zipPackage)
                {
                    switch (Path.GetExtension(zp.FileName).ToLower())
                    {
                    case ".xml":

                        DocType docType = docTypeService.GetDocType(zp.DocumentType);
                        if (docType == null)
                        {
                            throw new Exception(string.Format("Document type {0} not found in unity database", zp.DocumentType));
                        }

                        ManCo manCo = manCoService.GetManCo(zp.ManCoID);
                        if (manCo == null)
                        {
                            throw new Exception(string.Format("Man Co {0} not found in unity database", zp.ManCoID));
                        }

                        xmlFileService.CreateXmlFile(
                            Statics.zipPackage.DocumentSetID.ToString(),
                            zp.FileName,
                            zp.ParentZipFileName,
                            zp.Offshore,
                            docType.Id,
                            manCo.Id,
                            0,
                            string.Empty,
                            zp.FileName,
                            DateTime.Now,
                            appInfo.NexdoxGlobalRunID.ToString(),
                            File.GetLastWriteTime(appInfo.InputPath));
                        break;

                    case ".zip":
                        if (zp.IsBigZip)
                        {
                            zipFileService.CreateBigZipFile(Statics.zipPackage.DocumentSetID.ToString(), zp.FileName, File.GetLastWriteTime(appInfo.InputPath));
                        }
                        else
                        {
                            zipFileService.CreateLittleZipFile(Statics.zipPackage.DocumentSetID.ToString(), zp.FileName, zp.ParentZipFileName, File.GetLastWriteTime(appInfo.InputPath));
                        }
                        break;

                    case ".con":
                        conFileService.CreateConFile(Statics.zipPackage.DocumentSetID.ToString(), zp.FileName, zp.ParentZipFileName, File.GetLastWriteTime(appInfo.InputPath));
                        break;
                    }

                    /*SqlCommand sqlComm = new SqlCommand("sp_InsertInputFile", sqlConn);
                     * sqlComm.CommandType = CommandType.StoredProcedure;
                     *
                     * SqlParameter InputFileName = sqlComm.Parameters.Add("@INPUTFILENAME", SqlDbType.VarChar);
                     * InputFileName.Direction = ParameterDirection.Input;
                     * InputFileName.Value = zp.FileName;
                     *
                     * SqlParameter DocType = sqlComm.Parameters.Add("@DOCTYPE", SqlDbType.VarChar);
                     * DocType.Direction = ParameterDirection.Input;
                     * DocType.Value = zp.DocumentType;
                     *
                     * SqlParameter ParentDocFileName = sqlComm.Parameters.Add("@PARENTDOCFILENAME", SqlDbType.VarChar);
                     * ParentDocFileName.Direction = ParameterDirection.Input;
                     * ParentDocFileName.Value = zp.ParentZipFileName;
                     *
                     * SqlParameter BigZip = sqlComm.Parameters.Add("@BIGZIP", SqlDbType.Bit);
                     * BigZip.Direction = ParameterDirection.Input;
                     * BigZip.Value = zp.IsBigZip;
                     *
                     * SqlParameter LittleZip = sqlComm.Parameters.Add("@LITTLEZIP", SqlDbType.Bit);
                     * LittleZip.Direction = ParameterDirection.Input;
                     * LittleZip.Value = zp.IsLittleZip;
                     *
                     * SqlParameter DocumentSetID = sqlComm.Parameters.Add("@DOCUMENTSET_ID", SqlDbType.UniqueIdentifier);
                     * DocumentSetID.Direction = ParameterDirection.Input;
                     * DocumentSetID.Value = Statics.zipPackage.DocumentSetID;
                     *
                     * SqlParameter OffShore = sqlComm.Parameters.Add("@OFFSHORE", SqlDbType.Bit);
                     * OffShore.Direction = ParameterDirection.Input;
                     * OffShore.Value = zp.Offshore;
                     *
                     * SqlParameter ManCo = sqlComm.Parameters.Add("@MANCO", SqlDbType.VarChar);
                     * ManCo.Direction = ParameterDirection.Input;
                     * ManCo.Value = zp.ManCoID.ToString();
                     *
                     * SqlParameter Domicile = sqlComm.Parameters.Add("@DOMICILE", SqlDbType.VarChar);
                     * Domicile.Direction = ParameterDirection.Input;
                     * Domicile.Value = zp.Domicile;
                     *
                     * SqlParameter StatusID = sqlComm.Parameters.Add("@STATUS_ID", SqlDbType.Int);
                     * StatusID.Direction = ParameterDirection.Input;
                     * StatusID.Value = zp.StatusID;
                     *
                     * SqlParameter InputDateCreation = sqlComm.Parameters.Add("@INPUTCREATIONDATE", SqlDbType.DateTime);
                     * InputDateCreation.Direction = ParameterDirection.Input;
                     * InputDateCreation.Value = zp.InputCreationDate;
                     *
                     * SqlDataReader myReader = sqlComm.ExecuteReader();
                     * myReader.Close();*/
                }
            }
            catch (Exception e)
            {
                throw NexdoxMessaging.Exception(e.Message, this);
            }
        }
Example #16
0
 public PackageExploder(IZipFileService service, IPackageExploderLogger logger, IFileSystem fileSystem)
 {
     _service    = service;
     _logger     = logger;
     _fileSystem = fileSystem;
 }
 public DesktopReferenceDataFileService(IDesktopReferenceDataConfiguration desktopRefDataConfig, IDesktopReferenceDataFileNameService desktopReferenceDataFileNameService, IZipFileService zipFileService, ILogger logger)
 {
     _desktopRefDataConfig = desktopRefDataConfig;
     _desktopReferenceDataFileNameService = desktopReferenceDataFileNameService;
     _zipFileService = zipFileService;
     _logger         = logger;
 }
Example #18
0
        public RomDetailsView(MameGame game)
        {
            InitializeComponent();
            _game = game;

            if (_game == null)
                return;

            _zipFileRepository = RepositoryManager.GetInstanceOf<IZipFileRepository>();
            _zipFileService = ServiceManager.GetInstanceOf<IZipFileService>();
            _settingsService = ServiceManager.GetInstanceOf<IMameMinerSettingsService>();

            this.GameNameTextBlock.Text = _game.GameName;
            this.GameDescriptionTextBlock.Text = _game.GameDescription;

            Task.Factory.StartNew(() =>
            {

                var hasDuplicates = _game.GroupBy(x => x.RomName).Any(g => g.Count() > 1);

                var sb = new StringBuilder();
                sb.AppendLine(string.Format("Report for : {0}.", game.GameDescription));
                sb.AppendLine(string.Format("Number of Players : {0}.", game.NumberOfPlayers));

                sb.AppendLine("==== Report on Game ====");
                sb.AppendLine(string.Format("Game Driver Status : {0}", game.GameState.ToString()));
                sb.AppendLine(string.Format("Bad Dump? : {0}", game.Any(g => g.BadDump)));
                sb.AppendLine(string.Format("Bad CRC? : {0}", game.Any(g => g.BadCRC)));
                sb.AppendLine(string.Format("Bad SHA1?: {0}", game.Any(g => g.BadSHA1)));

                if (game.Any(g => g.BadDump))
                {
                    sb.AppendLine("At least one rom in the collection is recognized as beeing a bad dump. You may not be able to run this game.");
                }

                if(game.GameState == GameWorkingStateEnum.Preliminary)
                {
                    sb.AppendLine("This game is ony preliminarily developed in Mame. Do not expect it to run.");

                }

                if (hasDuplicates)
                {
                    sb.AppendLine("At least one rom is a duplicate entry from listrom results. You may not be able to run this game.");
                }

                sb.AppendLine("==== Report on Roms ====");
                var missing = _zipFileRepository.FindMissingRoms(game);

                if (missing.Any())
                {
                    foreach (var m in missing)
                    {
                        sb.AppendLine(string.Format("Missing Rom with name of {0}", m.RomName, m.CRC));
                    }

                    sb.AppendLine("You may not be able to play a game generated with missing roms.");
                }
                else
                {
                    sb.AppendLine("No roms missing.");
                }

                Dispatcher.Invoke(() => GameDetailsTextBlock.Text = sb.ToString());

            });
        }
Example #19
0
 public BottleRepository(IFileSystem fileSystem, IZipFileService zipService, DeploymentSettings settings)
 {
     _fileSystem = fileSystem;
     _zipService = zipService;
     _settings = settings;
 }
Example #20
0
 public FileController(IZipFileService zipFileService)
 {
     _zipFileService = zipFileService;
 }
 public void SetUp()
 {
     _zipFileRepository = new Mock <IZipFileRepository>();
     _zipFileService    = new ZipFileService(_zipFileRepository.Object);
 }
Example #22
0
 public UnzipTemplate(IZipFileService zipFileService)
 {
     _zipFileService = zipFileService;
 }
Example #23
0
 public void UpdateZipFilesTestShouldCreateFourBatches()
 {
     _zipFileService = new ZipFileService(_configuration, _packageBuilder.Object, _zipFileInfoService.Object, _fileSystem.Object);
     _zipFileService.UpdateZipFiles(DateTime.Now.AddDays(-1), DateTime.Now);
     _fileSystem.Verify(x => x.WriteAllBytes(It.IsAny <string>(), It.IsAny <byte[]>()), Times.Exactly(4));
 }
Example #24
0
 public void UpdateZipFilesTestShouldCreateNewDirectories()
 {
     _zipFileService = new ZipFileService(_configuration, _packageBuilder.Object, _zipFileInfoService.Object, _fileSystem.Object);
     _zipFileService.UpdateZipFiles(DateTime.Now.AddDays(-1), DateTime.Now);
     _fileSystem.Verify(x => x.CreateDirectory(It.IsAny <string>()), Times.Exactly(3));
 }