Beispiel #1
0
        private void lstOptions_SelectedIndexChanged(object sender, EventArgs e)
        {
            string  strSelectedId = lstOptions.SelectedValue?.ToString();
            XmlNode xmlOption     = null;

            if (!string.IsNullOrEmpty(strSelectedId))
            {
                xmlOption = _objXmlDocument.SelectSingleNode("/chummer/options/option[name = " + strSelectedId.CleanXPath() + "]");
            }

            if (xmlOption != null)
            {
                string strSource = xmlOption["source"].InnerText;
                string strPage   = xmlOption["altpage"]?.InnerText ?? xmlOption["page"].InnerText;
                string strSpace  = LanguageManager.GetString("String_Space");
                lblSource.Text = CommonFunctions.LanguageBookShort(strSource) + strSpace + strPage;
                ToolTipFactory.SetToolTip(lblSource, CommonFunctions.LanguageBookLong(strSource) + strSpace + LanguageManager.GetString("String_Page") + strSpace + strPage);
            }
            else
            {
                lblSource.Text = string.Empty;

                ToolTipFactory.SetToolTip(lblSource, string.Empty);
            }
        }
Beispiel #2
0
        private void lstMartialArts_SelectedIndexChanged(object sender, EventArgs e)
        {
            string  strSelectedId = lstManeuvers.SelectedValue?.ToString();
            XmlNode xmlManeuver   = null;

            if (!string.IsNullOrEmpty(strSelectedId))
            {
                xmlManeuver = _objXmlDocument.SelectSingleNode("/chummer/maneuvers/maneuver[name = \"" + strSelectedId + "\"]");
            }

            if (xmlManeuver != null)
            {
                string strSource         = xmlManeuver["source"].InnerText;
                string strPage           = xmlManeuver["altpage"]?.InnerText ?? xmlManeuver["page"].InnerText;
                string strSpaceCharacter = LanguageManager.GetString("String_Space", GlobalOptions.Language);
                lblSource.Text = CommonFunctions.LanguageBookShort(strSource, GlobalOptions.Language) + strSpaceCharacter + strPage;
                ToolTipFactory.SetToolTip(lblSource, CommonFunctions.LanguageBookLong(strSource, GlobalOptions.Language) + strSpaceCharacter + LanguageManager.GetString("String_Page", GlobalOptions.Language) + strSpaceCharacter + strPage);
            }
            else
            {
                lblSource.Text = string.Empty;

                ToolTipFactory.SetToolTip(lblSource, string.Empty);
            }
        }