internal EpmCustomContentWriterNodeData(EpmCustomContentWriterNodeData parentData, EpmTargetPathSegment segment, object element)
        {
            this.XmlContentStream = parentData.XmlContentStream;
            this.XmlContentWriter = parentData.XmlContentWriter;
            this.PopulateData(segment, element);

        }
Exemplo n.º 2
0
        /// <summary>
        /// Given a segment, writes the element to xml writer corresponding to it, works recursively to write child elements/attributes
        /// </summary>
        /// <param name="targetSegment">Segment being written</param>
        /// <param name="provider">Data Service provider used for rights verification.</param>
        private void WriteElement(EpmTargetPathSegment targetSegment, DataServiceProviderWrapper provider)
#endif
        {
            // Content to be written in an element
            EpmCustomContentWriterNodeData currentContent = this.visitorContent[targetSegment];

            currentContent.XmlContentWriter.WriteStartElement(
                targetSegment.SegmentNamespacePrefix,
                targetSegment.SegmentName,
                targetSegment.SegmentNamespaceUri);

#if ASTORIA_CLIENT
            // Serialize the attributes and children before serializing the data itself
            base.Serialize(targetSegment, EpmSerializationKind.Attributes);
#else
            // Serialize the attributes and children before serializing the data itself
            base.Serialize(targetSegment, EpmSerializationKind.Attributes, provider);
#endif

            if (targetSegment.HasContent)
            {
                Debug.Assert(currentContent.Data != null, "Must always have non-null data content value");
                currentContent.XmlContentWriter.WriteString(currentContent.Data);
            }

#if ASTORIA_CLIENT
            // Serialize the attributes and children before serializing the data itself
            base.Serialize(targetSegment, EpmSerializationKind.Elements);
#else
            // Serialize the attributes and children before serializing the data itself
            base.Serialize(targetSegment, EpmSerializationKind.Elements, provider);
#endif

            currentContent.XmlContentWriter.WriteEndElement();
        }
        internal EpmCustomContentWriterNodeData(EpmCustomContentWriterNodeData parentData, EpmTargetPathSegment segment, object element, EpmContentSerializer.EpmNullValuedPropertyTree nullValuedProperties, DataServiceProviderWrapper provider)
#endif
        {
            this.XmlContentStream = parentData.XmlContentStream;
            this.XmlContentWriter = parentData.XmlContentWriter;
#if ASTORIA_CLIENT
            this.PopulateData(segment, element);
#else
            this.PopulateData(segment, element, nullValuedProperties, provider);
#endif
        }
        internal EpmCustomContentWriterNodeData(EpmCustomContentWriterNodeData parentData, EpmTargetPathSegment segment, object element, EpmContentSerializer.EpmNullValuedPropertyTree nullValuedProperties, DataServiceProviderWrapper provider)
#endif
        {
            this.XmlContentStream = parentData.XmlContentStream;
            this.XmlContentWriter = parentData.XmlContentWriter;
#if ASTORIA_CLIENT
            this.PopulateData(segment, element);
#else
            this.PopulateData(segment, element, nullValuedProperties, provider);
#endif
        }
        private void WriteAttribute(EpmTargetPathSegment targetSegment)
        {
            Debug.Assert(targetSegment.HasContent, "Must have content for attributes");

            EpmCustomContentWriterNodeData currentContent = this.visitorContent[targetSegment];

            currentContent.XmlContentWriter.WriteAttributeString(
                targetSegment.SegmentNamespacePrefix,
                targetSegment.SegmentName.Substring(1),
                targetSegment.SegmentNamespaceUri,
                currentContent.Data);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Closes all the XmlWriter and MemoryStream objects in the tree and adds them to the SyndicationItem
        /// as ElementExtensions. Invokes the NodeDataCleaner to dispose off any existing memory stream and
        /// XmlWriter objects
        /// </summary>
        public void Dispose()
        {
            if (!this.disposed)
            {
                foreach (EpmTargetPathSegment subSegmentOfRoot in this.Root.SubSegments)
                {
                    EpmCustomContentWriterNodeData c = this.visitorContent[subSegmentOfRoot];
                    Debug.Assert(c != null, "Must have custom data for all the children of root");
                    if (this.Success)
                    {
                        c.AddContentToTarget(this.Target);
                    }

                    c.Dispose();
                }

                this.disposed = true;
            }
        }
Exemplo n.º 7
0
        private void WriteElement(EpmTargetPathSegment targetSegment)
        {
            EpmCustomContentWriterNodeData currentContent = this.visitorContent[targetSegment];

            currentContent.XmlContentWriter.WriteStartElement(
                targetSegment.SegmentNamespacePrefix,
                targetSegment.SegmentName,
                targetSegment.SegmentNamespaceUri);

            base.Serialize(targetSegment, EpmSerializationKind.Attributes);

            if (targetSegment.HasContent)
            {
                Debug.Assert(currentContent.Data != null, "Must always have non-null data content value");
                currentContent.XmlContentWriter.WriteString(currentContent.Data);
            }

            base.Serialize(targetSegment, EpmSerializationKind.Elements);

            currentContent.XmlContentWriter.WriteEndElement();
        }
 internal EpmCustomContentWriterNodeData(EpmCustomContentWriterNodeData parentData, EpmTargetPathSegment segment, object element)
 internal EpmCustomContentWriterNodeData(EpmCustomContentWriterNodeData parentData, EpmTargetPathSegment segment, object element)
 {
     this.XmlContentStream = parentData.XmlContentStream;
     this.XmlContentWriter = parentData.XmlContentWriter;
     this.PopulateData(segment, element);
 }
 internal EpmCustomContentWriterNodeData(EpmCustomContentWriterNodeData parentData, EpmTargetPathSegment segment, object element)