private IDataSource CreateDataSource(D2pEntry entry, Type type) { if (type == typeof(DlmMap)) { return(new DLMSource(new DlmReader(new MemoryStream(m_reader.ReadFile(entry))))); } throw new ArgumentException(string.Format("type {0} not handled", type)); }
public void AddFile(string filePath) { if (!System.IO.File.Exists(filePath)) { MessageService.ShowError(m_editor, string.Format("Cannot add file : File {0} not found", filePath)); return; } string packedFileName = CurrentFolder != null ? Path.Combine(CurrentFolder.FullName, Path.GetFileName(filePath)) : Path.GetFileName(filePath); D2pEntry entry = File.AddFile(packedFileName, System.IO.File.ReadAllBytes(filePath)); var row = new D2PFileRow(entry); m_rows.Add(row); m_editor.FilesGrid.ScrollIntoView(row); }
public D2PFileRow(D2pEntry entry) { m_entry = entry; }