Exemple #1
0
 internal ODataAtomWriter(ODataAtomOutputContext atomOutputContext, bool writingFeed) : base(atomOutputContext, writingFeed)
 {
     this.updatedTime = ODataAtomConvert.ToAtomString(DateTimeOffset.UtcNow);
     this.atomOutputContext = atomOutputContext;
     if (this.atomOutputContext.MessageWriterSettings.WriterBehavior.StartEntryXmlCustomizationCallback != null)
     {
         this.atomOutputContext.InitializeWriterCustomization();
     }
     this.atomEntryAndFeedSerializer = new ODataAtomEntryAndFeedSerializer(this.atomOutputContext);
 }
 internal ODataAtomWriter(ODataAtomOutputContext atomOutputContext, bool writingFeed) : base(atomOutputContext, writingFeed)
 {
     this.updatedTime       = ODataAtomConvert.ToAtomString(DateTimeOffset.UtcNow);
     this.atomOutputContext = atomOutputContext;
     if (this.atomOutputContext.MessageWriterSettings.WriterBehavior.StartEntryXmlCustomizationCallback != null)
     {
         this.atomOutputContext.InitializeWriterCustomization();
     }
     this.atomEntryAndFeedSerializer = new ODataAtomEntryAndFeedSerializer(this.atomOutputContext);
 }
Exemple #3
0
        /// <summary>
        /// Constructor creating an OData writer using the ATOM format.
        /// </summary>
        /// <param name="atomOutputContext">The output context to write to.</param>
        /// <param name="writingFeed">True if the writer is created for writing a feed; false when it is created for writing an entry.</param>
        internal ODataAtomWriter(ODataAtomOutputContext atomOutputContext, bool writingFeed)
            : base(atomOutputContext, writingFeed)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(atomOutputContext != null, "atomOutputContext != null");

            this.atomOutputContext = atomOutputContext;

            if (this.atomOutputContext.MessageWriterSettings.AtomStartEntryXmlCustomizationCallback != null)
            {
                Debug.Assert(
                    this.atomOutputContext.MessageWriterSettings.AtomEndEntryXmlCustomizationCallback != null,
                    "We should have verified that both start end end XML customization callbacks are specified.");
                this.atomOutputContext.InitializeWriterCustomization();
            }

            this.atomEntryAndFeedSerializer = new ODataAtomEntryAndFeedSerializer(this.atomOutputContext);
        }
        /// <summary>
        /// Constructor creating an OData writer using the ATOM format.
        /// </summary>
        /// <param name="atomOutputContext">The output context to write to.</param>
        /// <param name="writingFeed">True if the writer is created for writing a feed; false when it is created for writing an entry.</param>
        internal ODataAtomWriter(ODataAtomOutputContext atomOutputContext, bool writingFeed)
            : base(atomOutputContext, writingFeed)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(atomOutputContext != null, "atomOutputContext != null");

            this.atomOutputContext = atomOutputContext;

            if (this.atomOutputContext.MessageWriterSettings.AtomStartEntryXmlCustomizationCallback != null)
            {
                Debug.Assert(
                    this.atomOutputContext.MessageWriterSettings.AtomEndEntryXmlCustomizationCallback != null,
                    "We should have verified that both start end end XML customization callbacks are specified.");
                this.atomOutputContext.InitializeWriterCustomization();
            }

            this.atomEntryAndFeedSerializer = new ODataAtomEntryAndFeedSerializer(this.atomOutputContext);
        }