コード例 #1
0
        private string GetLabel2Text(Model.ChapterHistoryEntry historyEntry)
        {
            string hero1 = Data.Database.Characters.GetByID(historyEntry.HeroCharacterID_1).DisplayName;
            string hero2 = Data.Database.Characters.GetByID(historyEntry.HeroCharacterID_2).DisplayName;

            return($"Turns: {historyEntry.TurnCount} / Heroes: {hero1}, {hero2}");
        }
コード例 #2
0
        public ChapterHistoryPanel(Model.ChapterHistoryEntry historyEntry)
        {
            _historyEntry = historyEntry;

            this.Width   = 500;
            this.Height  = 20;
            this.Padding = new Padding(0);
            this.Margin  = new Padding(0);
            //this.BorderStyle = BorderStyle.FixedSingle;

            var removeButton = new Button();

            removeButton.Top       = 0;
            removeButton.Left      = 0;
            removeButton.Width     = 40;
            removeButton.Height    = this.Height;
            removeButton.Text      = "X";
            removeButton.ForeColor = Color.Red;
            removeButton.Click    += RemoveEntry;
            this.Controls.Add(removeButton);

            var label = new Label();

            label.TextAlign = ContentAlignment.MiddleLeft;
            label.Top       = 0;
            label.Left      = 40;
            label.Width     = this.Width - 40;
            label.Height    = this.Height;
            label.Text      = _historyEntry.ToString();
            this.Controls.Add(label);
        }
コード例 #3
0
 private string GetLabel1Text(Model.ChapterHistoryEntry historyEntry)
 {
     return(Data.Database.Chapters.GetByID(historyEntry.ChapterID).DisplayName);
 }