Esempio n. 1
0
        /// <summary>
        /// Writes the object to the outgoing data stream
        /// </summary>
        /// <param name="data"></param>
        /// <param name="buffer"></param>
        /// <param name="version"></param>
        /// <param name="fieldRestrictions"></param>
        protected virtual void WriteObject(SifDataObject data,
                                           Stream buffer,
                                           SifVersion version,
                                           IElementDef[] fieldRestrictions)
        {
            SifWriter writer = new SifWriter(buffer);

            writer.SuppressNamespace(true);
            if (fQuery != null)
            {
                fQuery.SetRenderingRestrictionsTo(data);
            }
            else if (fQueryRestrictions != null)
            {
                writer.Filter = fQueryRestrictions;
            }
            writer.Write(data, version);
            writer.Flush();
        }
Esempio n. 2
0
        /// <summary>  Called when the Publisher.OnQuery method has thrown a SifException,
        /// indicating an error should be returned in the SIF_Response body
        /// </summary>
        public override void SetError(SIF_Error error)
        {
            fError = error;

            //
            //  Write a SIF_Response packet that contains only this SIF_Error
            //
            try
            {
                NewPacket();
                SifWriter writer = new SifWriter(fCurrentOutputStream);
                writer.SuppressNamespace(true);
                writer.Write(error, fRenderAsVersion);
                writer.Close();
            }
            catch (IOException ioe)
            {
                throw new AdkException
                      (
                          "Failed to write Publisher SIF_Error data (packet " + fCurPacket + ") to " +
                          fFile.FullName + ": " +
                          ioe, fZone);
            }
        }
 /// <summary>
 /// Writes the object to the outgoing data stream
 /// </summary>
 /// <param name="data"></param>
 /// <param name="buffer"></param>
 /// <param name="version"></param>
 /// <param name="fieldRestrictions"></param>
 protected virtual void WriteObject( SifDataObject data,
                                     Stream buffer,
                                     SifVersion version,
                                     IElementDef[] fieldRestrictions )
 {
     SifWriter writer = new SifWriter( buffer );
     writer.SuppressNamespace( true );
     if ( fQuery != null )
     {
         fQuery.SetRenderingRestrictionsTo( data );
     }
     else if ( fQueryRestrictions != null )
     {
         writer.Filter = fQueryRestrictions;
     }
     writer.Write( data, version );
     writer.Flush();
 }
        /// <summary>  Called when the Publisher.OnQuery method has thrown a SifException,
        /// indicating an error should be returned in the SIF_Response body
        /// </summary>
        public override void SetError( SIF_Error error )
        {
            fError = error;

            //
            //  Write a SIF_Response packet that contains only this SIF_Error
            //
            try
            {
                NewPacket();
                SifWriter writer = new SifWriter( fCurrentOutputStream );
                writer.SuppressNamespace( true );
                writer.Write( error, fRenderAsVersion );
                writer.Close();
            }
            catch ( IOException ioe )
            {
                throw new AdkException
                    (
                    "Failed to write Publisher SIF_Error data (packet " + fCurPacket + ") to " +
                    fFile.FullName + ": " +
                    ioe, fZone );
            }
        }