Exemplo 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(Utils.CleanName(xmlPart.Location), UriKind.Relative), xmlPart.ContentType, CompressionOption.Normal);
            return(this.AddRelationship(xmlPart.Location, relationshipType, parentLocation));
        }
Exemplo n.º 2
0
 public Relationship AddExternalPartToTree(string relationshipType, string externalLocation, XmlPart parent, TargetMode targetMode)
 {
     return(this.AddRelationship(externalLocation, relationshipType, parent.Location, targetMode));
 }
Exemplo n.º 3
0
        public Relationship AddStreamingPartToTree(string contentType, string relationshipType, string locationHint, XmlPart parent, ContentTypeAction ctypeAction)
        {
            string      location    = this.UniqueLocation(locationHint);
            PhantomPart phantomPart = new PhantomPart();

            phantomPart.ContentType = contentType;
            phantomPart.Location    = location;
            this._parts.Add(phantomPart.Location, phantomPart);
            this._package.CreatePart(new Uri(Utils.CleanName(phantomPart.Location), UriKind.Relative), phantomPart.ContentType, CompressionOption.Normal);
            return(this.AddRelationship(location, relationshipType, parent.Location));
        }
Exemplo n.º 4
0
 public Relationship AddStreamingPartToTree(string contentType, string relationshipType, string locationHint, XmlPart parent)
 {
     return(this.AddStreamingPartToTree(contentType, relationshipType, locationHint, parent, ContentTypeAction.Override));
 }
Exemplo n.º 5
0
 public Relationship AddPartToTree(OoxmlPart part, string contentType, string relationshipType, string locationHint, XmlPart parent, ContentTypeAction ctypeAction)
 {
     return(this.AddPart(part, contentType, relationshipType, locationHint, parent.Location, ctypeAction));
 }