Ejemplo n.º 1
0
        /// <summary>
        /// Print the object's XML to the XmlWriter.
        /// </summary>
        /// <param name="objWriter">XmlTextWriter to write with.</param>
        /// <param name="objCulture">Culture in which to print numbers.</param>
        /// <param name="strLanguageToPrint">Language in which to print.</param>
        public async ValueTask Print(XmlWriter objWriter, CultureInfo objCulture, string strLanguageToPrint)
        {
            if (objWriter == null)
            {
                return;
            }
            // <sustainedobject>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("sustainedobject");

            try
            {
                await objWriter.WriteElementStringAsync("name", await DisplayNameShortAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("fullname", await DisplayNameAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("name_english", Name);

                await objWriter.WriteElementStringAsync("force", Force.ToString(objCulture));

                await objWriter.WriteElementStringAsync("nethits", NetHits.ToString(objCulture));

                await objWriter.WriteElementStringAsync("self", SelfSustained.ToString(objCulture));
            }
            finally
            {
                // </sustainedobject>
                await objBaseElement.DisposeAsync();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Print the object's XML to the XmlWriter.
 /// </summary>
 /// <param name="objWriter">XmlTextWriter to write with.</param>
 /// <param name="objCulture">Culture in which to print numbers.</param>
 /// <param name="strLanguageToPrint">Language in which to print.</param>
 public void Print(XmlTextWriter objWriter, CultureInfo objCulture, string strLanguageToPrint)
 {
     if (objWriter == null)
     {
         return;
     }
     objWriter.WriteStartElement("sustainedobject");
     objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint));
     objWriter.WriteElementString("fullname", DisplayName(strLanguageToPrint));
     objWriter.WriteElementString("name_english", Name);
     objWriter.WriteElementString("force", Force.ToString(objCulture));
     objWriter.WriteElementString("nethits", NetHits.ToString(objCulture));
     objWriter.WriteElementString("self", SelfSustained.ToString(objCulture));
     objWriter.WriteEndElement();
 }