Example #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();
            }
        }
Example #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</param>
        public async ValueTask Print(XmlWriter objWriter, CultureInfo objCulture)
        {
            if (objWriter == null)
            {
                return;
            }
            // <initiationgrade>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("initiationgrade");

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

                await objWriter.WriteElementStringAsync("grade", Grade.ToString(objCulture));

                await objWriter.WriteElementStringAsync("group", Group.ToString(GlobalSettings.InvariantCultureInfo));

                await objWriter.WriteElementStringAsync("ordeal", Ordeal.ToString(GlobalSettings.InvariantCultureInfo));

                await objWriter.WriteElementStringAsync("schooling", Schooling.ToString(GlobalSettings.InvariantCultureInfo));

                await objWriter.WriteElementStringAsync("technomancer", Technomancer.ToString(GlobalSettings.InvariantCultureInfo));

                if (GlobalSettings.PrintNotes)
                {
                    await objWriter.WriteElementStringAsync("notes", Notes);
                }
            }
            finally
            {
                // </initiationgrade>
                await objBaseElement.DisposeAsync();
            }
        }
Example #3
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</param>
        /// <param name="strLanguageToPrint">Language in which to print</param>
        public async ValueTask Print(XmlWriter objWriter, CultureInfo objCulture, string strLanguageToPrint)
        {
            if (objWriter == null)
            {
                return;
            }
            // <limitmodifier>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("limitmodifier");

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

                await objWriter.WriteElementStringAsync("name", await DisplayNameAsync(objCulture, strLanguageToPrint));

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

                await objWriter.WriteElementStringAsync("condition", await _objCharacter.TranslateExtraAsync(Condition, strLanguageToPrint));

                if (GlobalSettings.PrintNotes)
                {
                    await objWriter.WriteElementStringAsync("notes", Notes);
                }
            }
            finally
            {
                // </limitmodifier>
                await objBaseElement.DisposeAsync();
            }
        }
Example #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 async ValueTask Print(XmlWriter objWriter, string strLanguageToPrint)
        {
            if (objWriter == null)
            {
                return;
            }
            // <martialarttechnique>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("martialarttechnique");

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

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

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

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

                if (GlobalSettings.PrintNotes)
                {
                    await objWriter.WriteElementStringAsync("notes", Notes);
                }
                await objWriter.WriteElementStringAsync("source", Source);

                await objWriter.WriteElementStringAsync("page", await DisplayPageAsync(strLanguageToPrint));
            }
            finally
            {
                // </martialarttechnique>
                await objBaseElement.DisposeAsync();
            }
        }
Example #5
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="blnPrintNotes">Whether to print notes attached to the CalendarWeek.</param>
        public async ValueTask Print(XmlWriter objWriter, CultureInfo objCulture, bool blnPrintNotes = true)
        {
            if (objWriter == null)
            {
                return;
            }
            // <week>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("week");

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

                await objWriter.WriteElementStringAsync("year", Year.ToString(objCulture));

                await objWriter.WriteElementStringAsync("month", Month.ToString(objCulture));

                await objWriter.WriteElementStringAsync("week", MonthWeek.ToString(objCulture));

                if (blnPrintNotes)
                {
                    await objWriter.WriteElementStringAsync("notes", Notes);
                }
            }
            finally
            {
                // </week>
                await objBaseElement.DisposeAsync();
            }
        }
Example #6
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;
     // <complexform>
     XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("complexform");
     try
     {
         await objWriter.WriteElementStringAsync("guid", InternalId);
         await objWriter.WriteElementStringAsync("sourceid", SourceIDString);
         await objWriter.WriteElementStringAsync("name", await DisplayNameShortAsync(strLanguageToPrint));
         await objWriter.WriteElementStringAsync("fullname", await DisplayNameAsync(strLanguageToPrint));
         await objWriter.WriteElementStringAsync("name_english", Name);
         await objWriter.WriteElementStringAsync("duration", await DisplayDurationAsync(strLanguageToPrint));
         await objWriter.WriteElementStringAsync("fv", await DisplayFvAsync(strLanguageToPrint));
         await objWriter.WriteElementStringAsync("target", await DisplayTargetAsync(strLanguageToPrint));
         await objWriter.WriteElementStringAsync("source", await _objCharacter.LanguageBookShortAsync(Source, strLanguageToPrint));
         await objWriter.WriteElementStringAsync("page", await DisplayPageAsync(strLanguageToPrint));
         if (GlobalSettings.PrintNotes)
             await objWriter.WriteElementStringAsync("notes", Notes);
     }
     finally
     {
         // </complexform>
         await objBaseElement.DisposeAsync();
     }
 }
Example #7
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.</param>
        /// <param name="strLanguageToPrint">Language in which to print</param>
        public async ValueTask Print(XmlWriter objWriter, CultureInfo objCulture, string strLanguageToPrint)
        {
            if (objWriter == null)
            {
                return;
            }
            // <martialart>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("martialart");

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

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

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

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

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

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

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

                await objWriter.WriteElementStringAsync("cost", Cost.ToString(objCulture));

                // <martialarttechniques>
                XmlElementWriteHelper objTechniquesElement = await objWriter.StartElementAsync("martialarttechniques");

                try
                {
                    foreach (MartialArtTechnique objTechnique in Techniques)
                    {
                        await objTechnique.Print(objWriter, strLanguageToPrint);
                    }
                }
                finally
                {
                    // </martialarttechniques>
                    await objTechniquesElement.DisposeAsync();
                }
                if (GlobalSettings.PrintNotes)
                {
                    await objWriter.WriteElementStringAsync("notes", Notes);
                }
            }
            finally
            {
                // </martialart>
                await objBaseElement.DisposeAsync();
            }
        }
Example #8
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;
            }
            // <critterpower>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("critterpower");

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

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

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

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

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

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

                await objWriter.WriteElementStringAsync("category", await DisplayCategoryAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("category_english", Category);

                await objWriter.WriteElementStringAsync("type", await DisplayTypeAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("action", await DisplayActionAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("range", await DisplayRangeAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("duration", await DisplayDurationAsync(strLanguageToPrint));

                await objWriter.WriteElementStringAsync("karma", Karma.ToString(GlobalSettings.InvariantCultureInfo));

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

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

                if (GlobalSettings.PrintNotes)
                {
                    await objWriter.WriteElementStringAsync("notes", Notes);
                }
            }
            finally
            {
                // </critterpower>
                await objBaseElement.DisposeAsync();
            }
        }
Example #9
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();
            }
        }
Example #10
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;
            }
            // <aiprogram>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("aiprogram");

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

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

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

                await objWriter.WriteElementStringAsync("fullname", CurrentDisplayNameShort);

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

                if (string.IsNullOrEmpty(_strRequiresProgram) || _strRequiresProgram == await LanguageManager.GetStringAsync("String_None", strLanguageToPrint))
                {
                    await objWriter.WriteElementStringAsync("requiresprogram", await LanguageManager.GetStringAsync("String_None", strLanguageToPrint));
                }
                else
                {
                    await objWriter.WriteElementStringAsync("requiresprogram", await DisplayRequiresProgramAsync(strLanguageToPrint));
                }
                await objWriter.WriteElementStringAsync("source", await _objCharacter.LanguageBookShortAsync(Source, strLanguageToPrint));

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

                if (GlobalSettings.PrintNotes)
                {
                    await objWriter.WriteElementStringAsync("notes", Notes);
                }
            }
            finally
            {
                // </aiprogram>
                await objBaseElement.DisposeAsync();
            }
        }
Example #11
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.</param>
        /// <param name="strLanguageToPrint">Language in which to print</param>
        public async ValueTask Print(XmlWriter objWriter, CultureInfo objCulture, string strLanguageToPrint)
        {
            if (objWriter == null)
            {
                return;
            }
            // <metamagic>
            XmlElementWriteHelper objBaseElement = await objWriter.StartElementAsync("metamagic");

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

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

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

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

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

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

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

                await objWriter.WriteElementStringAsync("grade", Grade.ToString(objCulture));

                await objWriter.WriteElementStringAsync("improvementsource", _eImprovementSource.ToString());

                if (GlobalSettings.PrintNotes)
                {
                    await objWriter.WriteElementStringAsync("notes", Notes);
                }
            }
            finally
            {
                // </metamagic>
                await objBaseElement.DisposeAsync();
            }
        }