public XmlElement ToXml(XmlDocument doc) { XmlElement xb = doc.CreateElement("BuildItem"); XmlAttribute xa = doc.CreateAttribute("item"); xa.InnerText = Item.Name; xb.Attributes.Append(xa); xa = doc.CreateAttribute("slot"); xa.InnerText = Slot.ToString(); xb.Attributes.Append(xa); foreach (var o in OptionProperties) { XmlElement xp = doc.CreateElement("OptionProperty"); xb.AppendChild(xp); xa = doc.CreateAttribute("type"); xa.InnerText = string.IsNullOrWhiteSpace(o.Type) ? null : o.Type; xp.Attributes.Append(xa); xp.InnerText = o.Property; } return(xb); }
protected InventoryCell BuildBodyslot(EquipmentSlotType inventorySlot, int x, int y, int size = 32) { var bodyCell = new InventoryCell( _playerEntityManager.PlayerCharacter.Equipment, _iconFactory, new Vector2I(0, (int)inventorySlot), _inputManager ); bodyCell.DrawGroupId = DrawGroupId; bodyCell.Name = inventorySlot.ToString(); bodyCell.Bounds = new UniRectangle(x, y, size, size); bodyCell.MouseDown += ControlMouseDown; bodyCell.MouseEnter += ControlMouseEnter; bodyCell.MouseLeave += ControlMouseLeave; bodyCell.MouseUp += ControlMouseUp; Children.Add(bodyCell); return(bodyCell); }