Пример #1
0
 private void ddlDisciplineLevel_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlDisciplineLevel.SelectedIndex != -1)
     {
         txtDisciplineDescription.Rtf = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Disciplines/Discipline[@Name = '" + lblActiveDiscipline.Text + "']/Sub[@LevelName = '" + ddlDisciplineLevel.SelectedItem + "']/Description").Value);
     }
 }
Пример #2
0
 private void SelectDevotion(string lvDevotion)
 {
     pnlDiscDesc.Visible          = true;
     ddlDisciplineLevel.Visible   = false;
     lblActiveDiscipline.Text     = lvDevotion;
     txtDisciplineDescription.Rtf = RtfHelper.PlainTextToRtf(devNav.SelectSingleNode(String.Format("Devotions/Devotion[@Name='{0}']/Description", lvDevotion)).Value);
     imgDiscipline.ImageLocation  = Properties.Settings.Default.DataLocation + "Discipline_Images/" + devNav.SelectSingleNode("Devotions/Devotion[@Name = '" + lvDevotion + "']/Image").Value;;
 }
Пример #3
0
 private void DescribeRote(string display, string image)
 {
     nav = cvArcanaXml.CreateNavigator().SelectSingleNode("Arcanum/Arcana/Rote[@Name='" + display + "']");
     lblActiveRote.Text     = display;
     imgRote.ImageLocation  = cvRoteImagesFolder + image;
     txtRoteDescription.Rtf = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Description").Value);
     pnlRoteDesc.Visible    = true;
 }
Пример #4
0
        private void lblAuspiceAbility_Click(object sender, EventArgs e)
        {
            XPathNavigator xAuspiceNav = xAuspiceDoc.CreateNavigator().SelectSingleNode(String.Format("Covenants/Template[@Name='Werewolf']/Covenant[@Name='{0}']/Ability", Player.Covenant));

            lblActiveGift.Text     = xAuspiceNav.SelectSingleNode("@Name").Value;
            txtGiftDescription.Rtf = RtfHelper.PlainTextToRtf(xAuspiceNav.SelectSingleNode("Description").Value);
            imgGift.Image          = Properties.Resources.WerewolfForsakenBox;
        }
 private void SaveDectionResult(TextRange range)
 {
     if (MainVM.Pages.Count > 0)
     {
         string RtfString = RtfHelper.GetRtfString(range);
         MainVM.DetectionContainerContent = RtfString;
         MainVM.Pages[MainVM.SelectedPageIndex].DetectionResult = RtfString;
         MainVM.Pages[MainVM.SelectedPageIndex].Version++;
         DatabaseHelper.Update(MainVM.Pages[MainVM.SelectedPageIndex]);
     }
 }
Пример #6
0
        public ItemDisplay()
        {
            InitializeComponent();

            lblActiveItem.Text = ItemName;
            lblCost.Text       = Cost.ToString();
            lblSize.Text       = ItemSize.ToString();

            gridDetails.Rows.Clear();

            if (Scope != null)
            {
                gridDetails.Rows.Add("Scope", Scope);
            }
            if (Damage_Prim != null)
            {
                gridDetails.Rows.Add("Primary", Damage_Prim);
            }
            if (Damage_Sec != null)
            {
                gridDetails.Rows.Add("Secondary", Damage_Sec);
            }
            if (Capacity != null)
            {
                gridDetails.Rows.Add("Capacity", Capacity);
            }
            if (Range != null)
            {
                gridDetails.Rows.Add("Range", Range);
            }
            if (Def_General > 0)
            {
                gridDetails.Rows.Add("General", Def_General.ToString());
            }
            if (Def_Ballistic > 0)
            {
                gridDetails.Rows.Add("Ballistic", Def_Ballistic.ToString());
            }
            if (Durability > 0)
            {
                gridDetails.Rows.Add("Durability", Durability.ToString());
            }
            if (Structure > 0)
            {
                gridDetails.Rows.Add("Structure", Structure.ToString());
            }

            gridDetails.ColumnHeadersVisible = false;

            txtDesc.Rtf           = RtfHelper.PlainTextToRtf(Description);
            imgItem.ImageLocation = Properties.Settings.Default.DataLocation + @"Item_Images\" + Image;
        }
Пример #7
0
        private void riteOnClick(object sender, EventArgs e)
        {
            string lvName = ((Label)sender).Text;

            nav = cvRiteXml.CreateNavigator().SelectSingleNode("Rites/Rite[@Name='" + lvName + "']");

            lblActiveGift.Text     = lvName;
            txtGiftDescription.Rtf = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Description").Value);

            imgGift.ImageLocation = cvGiftImagesFolder + nav.SelectSingleNode("@Image").Value;

            pnlGiftDesc.Visible = true;
        }
Пример #8
0
 private void DescribeTrait(string pvLabel, string pvTraitType)
 {
     if (pvTraitType == "Merit")
     {
         XPathNavigator nav = lvMeritXml.CreateNavigator();
         lblMeritFlaw.Text     = pvLabel;
         txtMeritFlawDesc.Text = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Merits/Merit[@Name = '" + pvLabel + "']/Description").Value);
     }
     else if (pvTraitType == "Flaw")
     {
         XPathNavigator nav = lvFlawXml.CreateNavigator();
         lblMeritFlaw.Text     = pvLabel;
         txtMeritFlawDesc.Text = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Flaws/Flaw[@Name = '" + pvLabel + "']/Description").Value);
     }
 }
Пример #9
0
        public void cbxGift_CheckChanged(object sender, EventArgs e)
        {
            _formCreation.pnlGiftDesc.Visible = true;
            String         lvGift = ((CheckBox)sender).Text;
            XPathNavigator nav    = cvGiftsXml.CreateNavigator().SelectSingleNode($"Gifts/Gift/Sub[@Name=\"{lvGift}\"]");

            _formCreation.lblGiftName.Text        = lvGift;
            _formCreation.lblGiftAttribute.Text   = nav.SelectSingleNode("Attribute").Value;
            _formCreation.lblGiftSkill.Text       = nav.SelectSingleNode("Skill").Value;
            _formCreation.lblGiftTrait.Text       = nav.SelectSingleNode("Trait").Value;
            _formCreation.lblGiftEssenceCost.Text = nav.SelectSingleNode("Essence_Cost").Value;
            _formCreation.lblGiftWillCost.Text    = nav.SelectSingleNode("Willpower_Cost").Value;
            _formCreation.txtGiftDetail.Rtf       = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Description").Value);
            nav.MoveToParent();
            _formCreation.imgGift.ImageLocation = _Gift_Img_Folder + nav.SelectSingleNode("@Image");
        }
Пример #10
0
        public void lblGift_Clicked(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                return;
            }
            Label          lbl  = (Label)sender;
            XPathNavigator xNav = cvGiftsXml.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name=\"{lbl.Text}\"]");

            _formCreation.lblActiveItem.Text = lbl.Text;
            string rtf = RtfHelper.Begin();

            RtfHelper.ConvertText(ref rtf, xNav.SelectSingleNode("Description").Value);
            RtfHelper.End(ref rtf);
            _formCreation.txtDescription.Rtf = rtf;
        }
Пример #11
0
        public void CombatChatBox(string lvMessage, string lvPrefix, int titleColorRtf, int textColorRtf)
        {
            RichTextBox lvControl = (RichTextBox)cvCombatChat.Controls.Find("txtCombatChat", true)[0];

            string rfString = RtfHelper.RtfFont() + RtfHelper.RtfColorTable() + @"\fs20\cf" + titleColorRtf.ToString() + @" \par " + lvPrefix + @"{\cf" + textColorRtf.ToString() + " " + lvMessage + "}";

            using (FileStream stream = new FileStream(Properties.Settings.Default.DataLocation + @"Active\Chat\Combat.txt", FileMode.Append, FileAccess.Write, FileShare.Read))
            {
                StreamWriter writer = new StreamWriter(stream);
                writer.WriteLine(rfString);
                writer.Flush();
                writer.Close();
            }

            btnSend.Focus();
        }
Пример #12
0
        private void updatePostBody()
        {
            var    rftBodyHelper = new RtfHelper();
            string header        = null;

            if (m_Post != null)
            {
                var postType = m_Post.Type.HasValue ? m_Post.Type.Value : FacebookWrapper.ObjectModel.Post.eType.status;
                switch (postType)
                {
                case Post.eType.checkin:
                    header = "has checked in:";
                    break;

                case Post.eType.link:
                    header = "has posted a link:";
                    break;

                case Post.eType.photo:
                    header = "has posted a photo:";
                    break;

                case Post.eType.status:
                    break;

                case Post.eType.swf:
                    header = "has posted a clip:";
                    break;

                case Post.eType.video:
                    header = "has posted a video:";
                    break;

                default:
                    break;
                }

                rftBodyHelper.AppendLine(header);
                rftBodyHelper.AppendLine(m_Post.Message);
                rftBodyHelper.AppendBoldText(m_Post.Name);
                rftBodyHelper.AppendNewLine();
                rftBodyHelper.AppendLine(m_Post.Link);
            }

            Utils.UpdateRtfText(m_PostBody, rftBodyHelper.RtfText);
        }
Пример #13
0
        private void cbxRite_CheckChanged(object sender, EventArgs e)
        {
            _formCreation.pnlRiteDesc.Visible = true;
            String         lvRite = ((CheckBox)sender).Text;
            XPathNavigator nav    = cvRitesXml.CreateNavigator().SelectSingleNode($"Rites/Rite[@Name='{lvRite}']");

            _formCreation.lblRiteName.Text      = lvRite;
            _formCreation.lblRiteAttribute.Text = nav.SelectSingleNode("Attribute").Value;
            _formCreation.lblRiteSkill.Text     = nav.SelectSingleNode("Skill") != null?nav.SelectSingleNode("Skill").Value : "";

            _formCreation.lblRiteDivider.Text = nav.SelectSingleNode("Divider") != null?nav.SelectSingleNode("Divider").Value : "";

            _formCreation.lblRiteEssenceCost.Text = nav.SelectSingleNode("Essence_Cost").Value;
            _formCreation.txtRitePerform.Rtf      = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Perform").Value);
            _formCreation.txtRiteDesc.Rtf         = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Description").Value);
            _formCreation.imgGift.ImageLocation   = _Gift_Img_Folder + nav.SelectSingleNode("@Image");
        }
        /// <summary>
        /// Method that is called when the DocumentRtf property is changed
        /// </summary>
        /// <param name="d">RichTextBox being acted upon</param>
        /// <param name="e">Data concerning the change of the property</param>
        private static void RtfMetadataBinding(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (m_RecursProtectDocRtf.Contains(Thread.CurrentThread))
            {
                return;
            }

            var trueBox = (RichTextBox)d;

            trueBox.TextChanged -= trueBox_TextChanged;

            var textRange = new TextRange(trueBox.Document.ContentStart, trueBox.Document.ContentEnd);
            var rtfStream = new MemoryStream(Encoding.UTF8.GetBytes(RtfHelper.FormatPlainToRtf((string)e.NewValue)));

            textRange.Load(rtfStream, DataFormats.Rtf);

            trueBox.TextChanged += trueBox_TextChanged;
        }
Пример #15
0
        public VehicleDisplay()
        {
            InitializeComponent();

            lblActiveVehicle.Text    = _Name;
            lblCost.Text             = _Cost.ToString();
            lblSize.Text             = _Size.ToString();
            lblDurability.Text       = _Durability.ToString();
            lblStucture.Text         = _Structure.ToString();
            lblAcceleration.Text     = _Acceleration.ToString();
            lblMaxSpeed.Text         = _Speed.ToString();
            lblSafeSpeed.Text        = _Safe_Speed.ToString();
            lblHandling.Text         = _Handling.ToString();
            lblOccupancy.Text        = _Occupancy.ToString();
            lblCapacity.Text         = _Capacity.ToString();
            txtDesc.Rtf              = RtfHelper.PlainTextToRtf(_Description);
            imgVehicle.ImageLocation = Properties.Settings.Default.DataLocation + @"Vehicle_Images\" + _Image;
        }
Пример #16
0
        private void LoadDevotionDetail(XPathNavigator nav)
        {
            _formCreation.lblDevotionName.Text       = nav.SelectSingleNode("@Name").Value;
            _formCreation.lblDevotionAttr.Text       = nav.SelectSingleNode("Attribute").Value;
            _formCreation.lblDevotionSkill.Text      = nav.SelectSingleNode("Skill").Value;
            _formCreation.lblDevotionVitae.Text      = nav.SelectSingleNode("Vitae_Cost").Value;
            _formCreation.lblDevotionWill.Text       = nav.SelectSingleNode("Willpower_Cost").Value;
            _formCreation.lblDevotionDiscipline.Text = nav.SelectSingleNode("Discipline").Value;
            _formCreation.imgDevotion.ImageLocation  = _Disc_Img_Folder + nav.SelectSingleNode("Image").Value;
            _formCreation.pnlDevotionDetail.Visible  = true;

            if (Player.Name != null)
            {
                XPathNodeIterator prereqIter = nav.Select("Prerequisite/Discipline");
                string            rtf        = RtfHelper.Begin();

                while (prereqIter.MoveNext())
                {
                    int discIndex = 99;
                    if (Player.Discipline.TryGetValue(prereqIter.Current.Value, out discIndex) && discIndex != 99)
                    {
                        RtfHelper.ConvertText(ref rtf, prereqIter.Current.Value + ":" + prereqIter.Current.SelectSingleNode("@Level"));
                        RtfHelper.EndLine(ref rtf);
                    }
                    else
                    {
                        RtfHelper.Bold(ref rtf, prereqIter.Current.Value + ":" + prereqIter.Current.SelectSingleNode("@Level"));
                        RtfHelper.EndLine(ref rtf);
                    }
                }
                RtfHelper.EndLine(ref rtf);

                RtfHelper.ConvertText(ref rtf, nav.SelectSingleNode("Description").Value);
                RtfHelper.End(ref rtf);

                _formCreation.txtDevotionDescription.Rtf = rtf;
            }
            else
            {
                _formCreation.txtDevotionDescription.Rtf = RtfHelper.PlainTextToRtf(nav.SelectSingleNode("Description").Value);
            }
        }
Пример #17
0
        private void rote_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox       cbx  = (CheckBox)sender;
            XPathNavigator xNav = cvArcanaXml.CreateNavigator().SelectSingleNode($"Arcanum/Arcana/Rote[@Name=\"{cbx.Text}\"]");

            _formCreation.lblArcanaName.Text = cbx.Text;
            string rtf = RtfHelper.Begin();

            RtfHelper.ConvertText(ref rtf, xNav.SelectSingleNode("Description").Value);
            RtfHelper.End(ref rtf);
            _formCreation.txtArcanaDesc.Rtf       = rtf;
            _formCreation.lblArcanaAttribute.Text = xNav.SelectSingleNode("Attribute").Value;
            _formCreation.lblArcanaSkill.Text     = xNav.SelectSingleNode("Skill").Value;
            _formCreation.lblArcanaAspect.Text    = xNav.SelectSingleNode("Aspect").Value;
            _formCreation.lblArcanaManaCost.Text  = xNav.SelectSingleNode("Cost").Value;

            xNav.MoveToParent();
            _formCreation.imgArcana.ImageLocation = _Arcane_Img_Folder + xNav.SelectSingleNode("@Image").Value;

            _formCreation.pnlArcanaDetails.Visible = true;
        }
Пример #18
0
        private void SetInfo(XPathNavigator xNav)
        {
            CharacterUpdate.RemoveBoosts(Global.CharacterFolder + Player.Name + ".xml", _boostSource);

            txtTraits.Clear();
            XPathNodeIterator xNodeIter = xNav.SelectSingleNode("Traits").SelectChildren(XPathNodeType.All);

            while (xNodeIter.MoveNext())
            {
                txtTraits.Text += xNodeIter.Current.Name + " - " + xNodeIter.Current.Value + " : " + xNodeIter.Current.SelectSingleNode("@Value").Value;
                txtTraits.Text += Environment.NewLine;

                CharacterUpdate.AddBoost(Global.CharacterFolder + Player.Name + ".xml", _boostSource, xNodeIter.Current.Name, xNodeIter.Current.Value, xNodeIter.Current.SelectSingleNode("@Value").Value);
            }

            txtDescription.Clear();
            txtDescription.Rtf = RtfHelper.PlainTextToRtf(xNav.SelectSingleNode("Description").Value);

            imgForm.ImageLocation = Properties.Settings.Default.DataLocation + @"Form_Images\" + xNav.SelectSingleNode("Image").Value;

            txtDescription.Refresh();
            txtTraits.Refresh();
            imgForm.Refresh();
        }
Пример #19
0
        private void updatePostBody()
        {
            var rftBodyHelper = new RtfHelper();
            string header = null;

            if (m_Post != null)
            {
                var postType = m_Post.Type.HasValue ? m_Post.Type.Value : FacebookWrapper.ObjectModel.Post.eType.status;
                switch (postType)
                {
                    case Post.eType.checkin:
                        header = "has checked in:";
                        break;
                    case Post.eType.link:
                        header = "has posted a link:";
                        break;
                    case Post.eType.photo:
                        header = "has posted a photo:";
                        break;
                    case Post.eType.status:
                        break;
                    case Post.eType.swf:
                        header = "has posted a clip:";
                        break;
                    case Post.eType.video:
                        header = "has posted a video:";
                        break;
                    default:
                        break;
                }

                rftBodyHelper.AppendLine(header);
                rftBodyHelper.AppendLine(m_Post.Message);
                rftBodyHelper.AppendBoldText(m_Post.Name);
                rftBodyHelper.AppendNewLine();
                rftBodyHelper.AppendLine(m_Post.Link);
            }

            Utils.UpdateRtfText(m_PostBody, rftBodyHelper.RtfText);
        }
Пример #20
0
        //For GET Edit Action
        private AdminRecipeViewModel ParseRecipeModelToRecipeVM(Recipe recipeForEdit)
        {
            AdminRecipeViewModel editRecipeVM = new AdminRecipeViewModel();

            RTFToHTMLConverter converter = new RTFToHTMLConverter();

            editRecipeVM.RecipeID                 = recipeForEdit.RecipeID;
            editRecipeVM.Title                    = recipeForEdit.Title;
            editRecipeVM.ImageURL                 = recipeForEdit.ImageURL;
            editRecipeVM.ParentCategories         = db.Categories.AllParentCategories();
            editRecipeVM.SelectedParentCategory   = recipeForEdit.Categories.Where(cat => cat.ParentCategoryID == null).Select(cat => cat.CategoryID).FirstOrDefault();
            editRecipeVM.ChildrenCategories       = db.Categories.AllChildrenCategories();
            editRecipeVM.SelectedChildrenCategory = recipeForEdit.Categories.Where(cat => cat.ParentCategoryID != null).Select(cat => cat.CategoryID).FirstOrDefault();
            editRecipeVM.PrepTimeHours            = this.hours.ToList();
            editRecipeVM.SelectedPrepTimeHours    = (int)recipeForEdit.PreparationTime / 60;
            editRecipeVM.PrepTimeMinutes          = this.minutes;
            editRecipeVM.SelectedPrepTimeMinutes  = (int)recipeForEdit.PreparationTime % 60;
            editRecipeVM.CookTimeHours            = this.hours;
            editRecipeVM.SelectedCookTimeHours    = (int)recipeForEdit.CookingTime / 60;
            editRecipeVM.CookTimeMinutes          = this.minutes;
            editRecipeVM.SelectedCookTimeMinutes  = (int)recipeForEdit.CookingTime % 60;
            editRecipeVM.Serves                   = this.servesArray;
            editRecipeVM.SelectedServes           = (int)recipeForEdit.Serves;
            editRecipeVM.Rating                   = this.rating;
            editRecipeVM.SelectedRating           = (int)recipeForEdit.Rating;
            editRecipeVM.Sources                  = this.db.Sources.All();
            editRecipeVM.SelectedSource           = recipeForEdit.Source.SourceID;
            editRecipeVM.Recommendation           = this.recommendationArray;
            //editRecipeVM.SelectedRecommendation = recipeForEdit.Recommended;
            if (recipeForEdit.Recommended == true)
            {
                editRecipeVM.SelectedRecommendation = "Да";
            }
            else
            {
                editRecipeVM.SelectedRecommendation = "Не";
            }
            editRecipeVM.PublishedDate = (DateTime)recipeForEdit.Date;
            editRecipeVM.Description   = RtfHelper.PlainText(recipeForEdit.Description);
            //editRecipeVM.RecipeItems = recipeForEdit.RecipeItems.ToList();

            foreach (var recipeItem in recipeForEdit.RecipeItems)
            {
                RecipeItem newRecipeItem = new RecipeItem();
                newRecipeItem.RecipeItemName = recipeItem.RecipeItemName;
                foreach (var recipeItem_ingredient in recipeItem.RecipeItems_Ingredients)
                {
                    RecipeItems_Ingredients newRecipeItem_ingredient = new RecipeItems_Ingredients();
                    Unit       newUnit       = this.db.Units.GetById(recipeItem_ingredient.Unit.UnitID);
                    Ingredient newIngredient = this.db.Ingredients.GetById(recipeItem_ingredient.Ingredient.IngredientID);
                    newRecipeItem_ingredient.Quantity   = recipeItem_ingredient.Quantity;
                    newRecipeItem_ingredient.Unit       = newUnit;
                    newRecipeItem_ingredient.Ingredient = newIngredient;
                    newRecipeItem.RecipeItems_Ingredients.Add(newRecipeItem_ingredient);
                }
                foreach (var step in recipeItem.Steps)
                {
                    newRecipeItem.Steps.Add(step);
                }

                editRecipeVM.RecipeItems.Add(newRecipeItem);
            }

            return(editRecipeVM);
        }
Пример #21
0
        private void treeReference_AfterSelect(object sender, TreeViewEventArgs e)
        {
            XPathDocument  xDoc;
            XPathNavigator xNav            = null;
            bool           descriptionOnly = false;

            if (e.Node.Parent != null)
            {
                switch (e.Node.Parent.Name)
                {
                case "nodeStatuses":
                    xDoc = new XPathDocument(Global.StatusXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Statuses/Status[@Text=\"{e.Node.Text}\"]");
                    break;

                case "nodeActions":
                    xDoc = new XPathDocument(Global.ActionsXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Actions/Action[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDamageTypes":
                    xDoc = new XPathDocument(Global.DamageXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Damages/Damage[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeFormWerewolf":
                    xDoc = new XPathDocument(Global.FormXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Forms/Werewolf/Form[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDerangements":
                    xDoc = new XPathDocument(Global.DerangementXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Derangements/Derangement[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeFlaws":
                    xDoc = new XPathDocument(Global.FlawXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Flaws/Flaw[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeMerits":
                    xDoc = new XPathDocument(Global.MeritXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Merits/Merit[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVices":
                    xDoc = new XPathDocument(Global.ViceXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Vices/Vice[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVirtues":
                    xDoc = new XPathDocument(Global.VirtueXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Virtues/Virtue[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeRules":
                    xDoc = new XPathDocument(Global.RuleXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Rules/Rule[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcana":
                    xDoc            = new XPathDocument(Arcana.ArcanaXml);
                    xNav            = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name=\"{e.Node.Text}\"]");
                    descriptionOnly = true;
                    break;

                case "nodeArcanaGeneral":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='General']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaDeath":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Death']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaFate":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Fate']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaForces":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Forces']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaLife":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Life']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaMatter":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Matter']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaMind":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Mind']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaPrime":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Prime']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaSpace":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Space']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaSpirit":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Spirit']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeArcanaTime":
                    xDoc = new XPathDocument(Arcana.ArcanaXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Arcanum/Arcana[@Name='Time']/Rote[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplines":
                    xDoc            = new XPathDocument(Discipline.DisciplineXml);
                    xNav            = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name=\"{e.Node.Text}\"]");
                    descriptionOnly = true;
                    break;

                case "nodeDisciplineAnimalism":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Animalism']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineAuspex":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Auspex']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineCelerity":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Celerity']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineDominate":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Dominate']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineMajesty":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Majesty']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineNightmare":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Nightmare']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineObfuscate":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Obfuscate']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineProtean":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Protean']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineResilience":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Resilience']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineVigor":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Vigor']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineCrúac":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Crúac']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDisciplineThebanSorcery":
                    xDoc = new XPathDocument(Discipline.DisciplineXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Disciplines/Discipline[@Name='Theban Sorcery']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeDevotions":
                    xDoc = new XPathDocument(Devotion.DevotionXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Devotions/Devotion[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGifts":
                    xDoc            = new XPathDocument(Gift.GiftXml);
                    xNav            = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name=\"{e.Node.Text}\"]");
                    descriptionOnly = true;
                    break;

                case "nodeGiftCrescentMoon":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Crescent Moon']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftDeath":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Death']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftDominance":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Dominance']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftElemental":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Elemental']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftEvasion":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Evasion']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftFatherWolf":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Father Wolf']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftFullMoon":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Full Moon']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftGibbousMoon":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Gibbouls Moon']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftHalfMoon":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Half Moon']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftInsight":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Insight']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftInspiration":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Inspiration']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftKnowledge":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Knowledge']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftMotherLuna":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Mother Luna']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftNature":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Nature']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftNewMoon":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='New Moon']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftRage":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Rage']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftShaping":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Shaping']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftStealth":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Stealth']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftStrength":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Strength']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftTechnology":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Technology']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftWarding":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Warding']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeGiftWeather":
                    xDoc = new XPathDocument(Gift.GiftXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Gifts/Gift[@Name='Weather']/Sub[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeProfessions":
                    xDoc = new XPathDocument(Profession.ProfessionXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Professions/Profession[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeRites":
                    xDoc = new XPathDocument(Rite.RiteXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Rites/Rite[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVestments":
                    xDoc            = new XPathDocument(Vestment.VestmentXml);
                    xNav            = xDoc.CreateNavigator().SelectSingleNode($"Vesments/Vice[@Name=\"{e.Node.Text}\"]");
                    descriptionOnly = true;
                    break;

                case "nodeVestmentEnvy":
                    xDoc = new XPathDocument(Vestment.VestmentXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Vestments/Vice[@Name='Envy']//Vestment[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVestmentGluttony":
                    xDoc = new XPathDocument(Vestment.VestmentXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Vestments/Vice[@Name='Gluttony']//Vestment[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVestmentGreed":
                    xDoc = new XPathDocument(Vestment.VestmentXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Vestments/Vice[@Name='Greed']//Vestment[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVestmentLust":
                    xDoc = new XPathDocument(Vestment.VestmentXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Vestments/Vice[@Name='Lust']//Vestment[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVestmentPride":
                    xDoc = new XPathDocument(Vestment.VestmentXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Vestments/Vice[@Name='Pride']//Vestment[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVestmentSloth":
                    xDoc = new XPathDocument(Vestment.VestmentXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Vestments/Vice[@Name='Sloth']//Vestment[@Name=\"{e.Node.Text}\"]");
                    break;

                case "nodeVestmentWrath":
                    xDoc = new XPathDocument(Vestment.VestmentXml);
                    xNav = xDoc.CreateNavigator().SelectSingleNode($"Vestments/Vice[@Name='Wrath']//Vestment[@Name=\"{e.Node.Text}\"]");
                    break;

                default:
                    return;
                }
            }
            else
            {
                return;
            }

            string rtf = RtfHelper.Begin();

            RtfHelper.Bold(ref rtf, xNav.SelectSingleNode("@Name").Value);
            RtfHelper.EndLine(ref rtf);

            XPathNodeIterator nodeIter = xNav.SelectChildren(XPathNodeType.All);

            while (nodeIter.MoveNext())
            {
                if (nodeIter.Current.Name == "Image")
                {
                    continue;
                }

                RtfHelper.EndLine(ref rtf);
                RtfHelper.Bold(ref rtf, nodeIter.Current.Name + ": ");

                XPathNodeIterator xChildIter = nodeIter.Current.SelectChildren(XPathNodeType.Element);

                if (xChildIter.Count > 0)
                {
                    while (xChildIter.MoveNext())
                    {
                        RtfHelper.EndLine(ref rtf);
                        RtfHelper.ConvertText(ref rtf, xChildIter.Current.Name + " | ");
                        RtfHelper.ConvertText(ref rtf, xChildIter.Current.Value);
                        if (xChildIter.Current.SelectSingleNode("@Value") != null)
                        {
                            RtfHelper.ConvertText(ref rtf, $" [{xChildIter.Current.SelectSingleNode("@Value").Value}]");
                        }
                    }
                }
                else if (descriptionOnly)
                {
                    if (nodeIter.Current.SelectSingleNode("Description") != null)
                    {
                        RtfHelper.EndLine(ref rtf);
                        RtfHelper.Bold(ref rtf, "Description: ");
                        RtfHelper.ConvertText(ref rtf, nodeIter.Current.SelectSingleNode("Description").Value);
                    }
                }
                else
                {
                    RtfHelper.ConvertText(ref rtf, nodeIter.Current.Value);
                }
                RtfHelper.EndLine(ref rtf);
            }

            RtfHelper.End(ref rtf);
            RtfDisplay.Description = rtf;


            RtfDisplay iDisplay = new RtfDisplay();

            GMForm.setPanelSelectedItem(iDisplay);
        }