Exemple #1
0
 /// <summary>
 /// Print the object's XML to the XmlWriter.
 /// </summary>
 /// <param name="objWriter">XmlTextWriter to write with.</param>
 /// <param name="strLanguageToPrint">Language in which to print</param>
 public void Print(XmlTextWriter objWriter, string strLanguageToPrint)
 {
     if (objWriter == null)
     {
         return;
     }
     objWriter.WriteStartElement("mentorspirit");
     objWriter.WriteElementString("guid", InternalId);
     objWriter.WriteElementString("sourceid", SourceIDString);
     objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint));
     objWriter.WriteElementString("mentortype", _eMentorType.ToString());
     objWriter.WriteElementString("name_english", Name);
     objWriter.WriteElementString("advantage", DisplayAdvantage(strLanguageToPrint));
     objWriter.WriteElementString("disadvantage", DisplayDisadvantage(strLanguageToPrint));
     objWriter.WriteElementString("advantage_english", Advantage);
     objWriter.WriteElementString("disadvantage_english", Disadvantage);
     objWriter.WriteElementString("extra", _objCharacter.TranslateExtra(Extra, strLanguageToPrint));
     objWriter.WriteElementString("source", _objCharacter.LanguageBookShort(Source, strLanguageToPrint));
     objWriter.WriteElementString("page", DisplayPage(strLanguageToPrint));
     objWriter.WriteElementString("mentormask", MentorMask.ToString(GlobalSettings.InvariantCultureInfo));
     if (GlobalSettings.PrintNotes)
     {
         objWriter.WriteElementString("notes", System.Text.RegularExpressions.Regex.Replace(_strNotes, @"[\u0000-\u0008\u000B\u000C\u000E-\u001F]", ""));
     }
     objWriter.WriteEndElement();
 }
Exemple #2
0
        /// <summary>
        /// Print the object's XML to the XmlWriter.
        /// </summary>
        /// <param name="objWriter">XmlTextWriter to write with.</param>
        /// <param name="strLanguageToPrint">Language in which to print</param>
        public async ValueTask Print(XmlWriter objWriter, string strLanguageToPrint)
        {
            if (objWriter == null)
            {
                return;
            }
            // <mentorspirit>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("mentorspirit");

            try
            {
                await objWriter.WriteElementStringAsync("guid", InternalId);

                await objWriter.WriteElementStringAsync("sourceid", SourceIDString);

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

                await objWriter.WriteElementStringAsync("mentortype", _eMentorType.ToString());

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

                await objWriter.WriteElementStringAsync("advantage", await DisplayAdvantageAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("disadvantage", await DisplayDisadvantageAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("advantage_english", Advantage);

                await objWriter.WriteElementStringAsync("disadvantage_english", Disadvantage);

                await objWriter.WriteElementStringAsync("extra", await _objCharacter.TranslateExtraAsync(Extra, strLanguageToPrint));

                await objWriter.WriteElementStringAsync("source", await _objCharacter.LanguageBookShortAsync(Source, strLanguageToPrint));

                await objWriter.WriteElementStringAsync("page", await DisplayPageAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("mentormask", MentorMask.ToString(GlobalSettings.InvariantCultureInfo));

                if (GlobalSettings.PrintNotes)
                {
                    await objWriter.WriteElementStringAsync(
                        "notes",
                        System.Text.RegularExpressions.Regex.Replace(
                            _strNotes, @"[\u0000-\u0008\u000B\u000C\u000E-\u001F]", string.Empty));
                }
            }
            finally
            {
                // </mentorspirit>
                await objBaseElement.DisposeAsync();
            }
        }
 /// <summary>
 /// Print the object's XML to the XmlWriter.
 /// </summary>
 /// <param name="objWriter">XmlTextWriter to write with.</param>
 /// <param name="strLanguageToPrint">Language in which to print</param>
 public void Print(XmlTextWriter objWriter, string strLanguageToPrint)
 {
     objWriter.WriteStartElement("mentorspirit");
     objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint));
     objWriter.WriteElementString("mentortype", _eMentorType.ToString());
     objWriter.WriteElementString("name_english", Name);
     objWriter.WriteElementString("advantage", Advantage);
     objWriter.WriteElementString("disadvantage", Disadvantage);
     objWriter.WriteElementString("extra", LanguageManager.TranslateExtra(_strExtra, strLanguageToPrint));
     objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint));
     objWriter.WriteElementString("page", Page(strLanguageToPrint));
     objWriter.WriteElementString("mentormask", MentorMask.ToString());
     if (_objCharacter.Options.PrintNotes)
     {
         objWriter.WriteElementString("notes", _strNotes);
     }
     objWriter.WriteEndElement();
 }
Exemple #4
0
 /// <summary>
 /// Print the object's XML to the XmlWriter.
 /// </summary>
 /// <param name="objWriter">XmlTextWriter to write with.</param>
 /// <param name="strLanguageToPrint">Language in which to print</param>
 public void Print(XmlTextWriter objWriter, string strLanguageToPrint)
 {
     if (objWriter == null)
     {
         return;
     }
     objWriter.WriteStartElement("mentorspirit");
     objWriter.WriteElementString("guid", InternalId);
     objWriter.WriteElementString("sourceid", SourceIDString);
     objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint));
     objWriter.WriteElementString("mentortype", _eMentorType.ToString());
     objWriter.WriteElementString("name_english", Name);
     objWriter.WriteElementString("advantage", Advantage);
     objWriter.WriteElementString("disadvantage", Disadvantage);
     objWriter.WriteElementString("extra", LanguageManager.TranslateExtra(Extra, strLanguageToPrint));
     objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint));
     objWriter.WriteElementString("page", DisplayPage(strLanguageToPrint));
     objWriter.WriteElementString("mentormask", MentorMask.ToString(GlobalOptions.InvariantCultureInfo));
     if (_objCharacter.Options.PrintNotes)
     {
         objWriter.WriteElementString("notes", _strNotes);
     }
     objWriter.WriteEndElement();
 }