private void HandleCopySaveGames(IGameFile gameFile, ISourcePortData sourcePort) { m_saveGames = DataSourceAdapter.GetFiles(gameFile, FileType.SaveGame).Where(x => x.SourcePortID == sourcePort.SourcePortID).ToArray(); SaveGameHandler saveGameHandler = new SaveGameHandler(DataSourceAdapter, AppConfiguration.SaveGameDirectory); saveGameHandler.CopySaveGamesToSourcePort(sourcePort, m_saveGames); }
private string GetLoadLatestSave(IGameFile gameFile, ISourcePortData sourcePortData) { var saveFile = DataSourceAdapter.GetFiles(gameFile, FileType.SaveGame).Where(x => x.SourcePortID == sourcePortData.SourcePortID) .OrderByDescending(x => x.DateCreated).FirstOrDefault(); if (saveFile != null) { return(Path.Combine(sourcePortData.GetSavePath().GetFullPath(), saveFile.OriginalFileName)); } return(string.Empty); }
protected void SetData(DataGridView dgvMain, IGameFile gameFile) { if (GameFile != null && GameFile.GameFileID.HasValue) { IEnumerable <IFileData> files = DataSourceAdapter.GetFiles(gameFile, FileType); List <ISourcePortData> sourcePorts = Util.GetSourcePortsData(DataSourceAdapter); var items = from file in files join sp in sourcePorts on file.SourcePortID equals sp.SourcePortID select new { Description = file.Description, DateCreated = file.DateCreated, SourcePortName = sp.Name, FileData = file }; dgvMain.DataSource = items.ToList(); dgvMain.ContextMenuStrip = m_menu; m_files = files.ToArray(); } else { dgvMain.DataSource = null; m_files = new IFileData[] { }; } }