public void DeleteRelationship(string id) { Package.CheckIsReadOnly(); CheckIsRelationship(); Relationships.Remove(id); WriteRelationships(); }
private PackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType, string id, bool loading) { if (!loading) { Package.CheckIsReadOnly(); } Check.TargetUri(targetUri); Check.RelationshipTypeIsValid(relationshipType); Check.IdIsValid(id); if (id == null) { id = NextId(); } if (Relationships.ContainsKey(id)) { throw new XmlException("A relationship with this ID already exists"); } PackageRelationship r = new PackageRelationship(id, Package, relationshipType, Uri, targetMode, targetUri); Relationships.Add(r.Id, r); if (!loading) { WriteRelationships(); } return(r); }