Esempio n. 1
0
        private Relationship AddPart(OoxmlPart part, string contentType, string relationshipType, string locationHint, string parentLocation, ContentTypeAction ctypeAction)
        {
            XmlPart xmlPart = new XmlPart();

            xmlPart.ContentType  = contentType;
            xmlPart.HydratedPart = part;
            if (locationHint.Contains("{0}"))
            {
                xmlPart.Location = this.UniqueLocation(locationHint);
            }
            else
            {
                xmlPart.Location = locationHint;
            }
            this._parts.Add(xmlPart.Location, xmlPart);
            this._package.CreatePart(new Uri(WordOpenXmlUtils.CleanName(xmlPart.Location), UriKind.Relative), xmlPart.ContentType, CompressionOption.Normal);
            return(this.AddRelationship(xmlPart.Location, relationshipType, parentLocation));
        }
Esempio n. 2
0
 public Relationship AddExternalPartToTree(string relationshipType, string externalLocation, XmlPart parent, TargetMode targetMode)
 {
     return(this.AddRelationship(externalLocation, relationshipType, parent.Location, targetMode));
 }
Esempio n. 3
0
 public Relationship AddStreamingPartToTree(string contentType, string relationshipType, string locationHint, XmlPart parent, ContentTypeAction ctypeAction)
 {
     return(this.AddStreamingPartToTree(contentType, relationshipType, locationHint, parent.Location, ctypeAction));
 }
Esempio n. 4
0
 public Relationship AddPartToTree(OoxmlPart part, string contentType, string relationshipType, string locationHint, XmlPart parent)
 {
     return(this.AddPartToTree(part, contentType, relationshipType, locationHint, parent, ContentTypeAction.Override));
 }