DeleteEntry

XarArchive.DeleteEntry method

Removes the first occurrence of a specific entry from the entries list.

public XarArchive DeleteEntry(XarEntry entry)
ParameterTypeDescription
entryXarEntryThe entry to remove from the entries list.

Return Value

Xar entry instance.

Exceptions

exceptioncondition
ArgumentNullExceptionentry is null.

Examples

Here is how you can remove all entries except the last one:

using (var archive = new XarArchive("archive.xar"))
{
    while (archive.Entries.Count > 1)
        archive.DeleteEntry(archive.Entries.FirstOrDefault());
    archive.Save(outputXarFile);
}

See Also