Ejemplo n.º 1
0
        /// <summary>
        /// Returns the XML representation of this Query in the format required by SIF
        /// for the specified version
        /// </summary>
        /// <param name="version">The SIF Version to render the Query in. The ADK will attempt to render
        /// the query path using the proper element or attribute names for the version of SIF
        /// </param>
        /// <returns>a string containing the XML representation as a SIF_Query element. If an error
        /// occurs during the conversion, an empty string ("") is returned.
        /// </returns>
        public String ToXml(SifVersion version)
        {
            // Create a SIF_Query object
            SIF_Query sifQ = SIFPrimitives.CreateSIF_Query(this, version, true);

            try
            {
                using (StringWriter outStream = new StringWriter())
                {
                    SifWriter w = new SifWriter(outStream);
                    w.Write(sifQ);
                    w.Flush();
                    return(outStream.ToString());
                }
            }
            catch (Exception e)
            {
                Adk.Log.Warn("Error creating XML equivalent of Query: " + e, e);
                return("");
            }
        }
Ejemplo n.º 2
0
 /// <summary>the SIF_Query representation of this Query in the format required by SIF
 /// for the specified version
 /// </summary>
 /// <param name="version">The SIF Version to render the Query in. The ADK will attempt to render
 /// the query path using the proper element or attribute names for the version of SIF</param>
 /// <returns>A SIF_Query element</returns>
 public SIF_Query ToSIF_Query(SifVersion version)
 {
     return(SIFPrimitives.CreateSIF_Query(this, version, true));
 }