public static D2pEntry CreateEntryDefinition(D2pFile container, IDataReader reader) { var entry = new D2pEntry(container); entry.ReadEntryDefinition(reader); return(entry); }
public D2pEntry(D2pFile container, string fileName, byte[] data) { Container = container; FullFileName = fileName; m_newData = data; State = D2pEntryState.Added; Size = data.Length; Index = -1; }
private void InternalAddLink(string linkFile) { string path = GetLinkFileAbsolutePath(linkFile); if (!File.Exists(path)) { throw new FileNotFoundException(linkFile); } var link = new D2pFile(path); foreach (D2pEntry entry in link.Entries) { InternalAddEntry(entry); } m_links.Add(link); OnPropertyChanged("Links"); }
public bool RemoveLink(D2pFile file) { D2pProperty property = m_properties.FirstOrDefault(entry => Path.GetFullPath(GetLinkFileAbsolutePath(entry.Value)) == Path.GetFullPath(file.FilePath)); if (property == null) { return(false); } bool result = InternalRemoveLink(file) && m_properties.Remove(property); if (result) { OnPropertyChanged("Properties"); } return(result); }
public bool RemoveProperty(D2pProperty property) { if (property.Key == "link") { D2pFile link = m_links.FirstOrDefault(entry => Path.GetFullPath(GetLinkFileAbsolutePath(property.Value)) == Path.GetFullPath(entry.FilePath)); if (link == null || !InternalRemoveLink(link)) { throw new Exception(string.Format("Cannot remove the associated link {0} to this property", property.Value)); } } if (m_properties.Remove(property)) { OnPropertyChanged("Properties"); IndexTable.PropertiesCount--; return(true); } return(false); }
private bool InternalRemoveLink(D2pFile link) { if (m_links.Remove(link)) { OnPropertyChanged("Links"); return true; } return false; }
public bool RemoveLink(D2pFile file) { D2pProperty property = m_properties.FirstOrDefault(entry => Path.GetFullPath(GetLinkFileAbsolutePath(entry.Value)) == Path.GetFullPath(file.FilePath)); if (property == null) return false; bool result = InternalRemoveLink(file) && m_properties.Remove(property); if (result) OnPropertyChanged("Properties"); return result; }
private D2pEntry(D2pFile container) { Container = container; Index = -1; }
public D2pEntry(D2pFile container, string fileName) { Container = container; FullFileName = fileName; Index = -1; }
public static D2pEntry CreateEntryDefinition(D2pFile container, IDataReader reader) { var entry = new D2pEntry(container); entry.ReadEntryDefinition(reader); return entry; }
public D2pIndexTable(D2pFile container) { Container = container; }