コード例 #1
0
        /// <summary>
        /// Edits the card style.
        /// </summary>
        /// <remarks>Documented by Dev05, 2007-10-31</remarks>
        protected override void EditCardStyle()
        {
            if (Multiselect)
            {
                ICard card = Dictionary.Cards.GetCardByID(cards[0]).BaseCard;
                if (card.Settings.Style == null)
                {
                    card.Settings.Style = card.CreateCardStyle();
                }
                CardStyleEditor editor = new CardStyleEditor();
                editor.HelpNamespace = this.HelpNamespace;
                editor.LoadStyle(card, card.Settings.Style, Dictionary, card);
                switch (editor.ShowDialog())
                {
                case DialogResult.Abort:
                    foreach (int id in cards)
                    {
                        Dictionary.Cards.GetCardByID(id).BaseCard.Settings.Style = null;
                    }
                    break;

                case DialogResult.OK:
                default:
                    foreach (int id in cards)
                    {
                        Dictionary.Cards.GetCardByID(id).BaseCard.Settings.Style = card.Settings.Style;
                    }
                    break;
                }
            }
            else
            {
                base.EditCardStyle();
            }
        }
コード例 #2
0
ファイル: CardEdit.cs プロジェクト: Stoner19/Memory-Lifter
        /// <summary>
        /// Edits the card style.
        /// </summary>
        /// <remarks>Documented by Dev05, 2007-10-31</remarks>
        protected virtual void EditCardStyle()
        {
            Card styleCard = Dictionary.Cards.GetCardByID(CardID);

            if (newCard || (styleCard == null))
                return;

            ICard card = styleCard.BaseCard;
            if (card.Settings == null) card.Settings = Dictionary.CreateSettings();
            if (card.Settings.Style == null)
                card.Settings.Style = card.CreateCardStyle();
            CardStyleEditor editor = new CardStyleEditor();
            editor.HelpNamespace = this.HelpNamespace;
            editor.LoadStyle(card, card.Settings.Style, Dictionary, card);
            switch (editor.ShowDialog())
            {
                case DialogResult.Abort:
                    card.Settings.Style = null;
                    break;
                case DialogResult.Cancel:
                    break;
                default:
                    AddStyle(this, EventArgs.Empty);
                    break;
            }
        }
コード例 #3
0
 /// <summary>
 /// Edits the card style.
 /// </summary>
 /// <remarks>Documented by Dev05, 2007-10-31</remarks>
 protected override void EditCardStyle()
 {
     if (Multiselect)
     {
         ICard card = Dictionary.Cards.GetCardByID(cards[0]).BaseCard;
         if (card.Settings.Style == null)
             card.Settings.Style = card.CreateCardStyle();
         CardStyleEditor editor = new CardStyleEditor();
         editor.HelpNamespace = this.HelpNamespace;
         editor.LoadStyle(card, card.Settings.Style, Dictionary, card);
         switch (editor.ShowDialog())
         {
             case DialogResult.Abort:
                 foreach (int id in cards)
                     Dictionary.Cards.GetCardByID(id).BaseCard.Settings.Style = null;
                 break;
             case DialogResult.OK:
             default:
                 foreach (int id in cards)
                     Dictionary.Cards.GetCardByID(id).BaseCard.Settings.Style = card.Settings.Style;
                 break;
         }
     }
     else
         base.EditCardStyle();
 }