CheckIsReadOnly() private method

private CheckIsReadOnly ( ) : void
return void
コード例 #1
0
 public void DeleteRelationship(string id)
 {
     Package.CheckIsReadOnly();
     CheckIsRelationship();
     Relationships.Remove(id);
     WriteRelationships();
 }
コード例 #2
0
        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);
        }