本文整理汇总了C#中System.Windows.Forms.RichTextBox.SetStyle方法的典型用法代码示例。如果您正苦于以下问题:C# RichTextBox.SetStyle方法的具体用法?C# RichTextBox.SetStyle怎么用?C# RichTextBox.SetStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.RichTextBox
的用法示例。
在下文中一共展示了RichTextBox.SetStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendSpellEffectInfo
private void AppendSpellEffectInfo(RichTextBox sb, SpellEntry spell)
{
sb.AppendLine("=================================================");
for (int i = 0; i < 3; i++)
{
sb.SetBold();
if ((SpellEffects)spell.Effect[i] == SpellEffects.NO_SPELL_EFFECT)
{
sb.AppendFormatLine("Effect {0}: NO EFFECT", i);
return;
}
sb.AppendFormatLine("Effect {0}: Id {1} ({2})", i, spell.Effect[i], (SpellEffects)spell.Effect[i]);
sb.SetDefaultStyle();
sb.AppendFormat("BasePoints = {0}", spell.EffectBasePoints[i] + 1);
if (spell.EffectRealPointsPerLevel[i] != 0)
sb.AppendFormat(" + Level * {0:F}", spell.EffectRealPointsPerLevel[i]);
// WTF ? 1 = spell.EffectBaseDice[i]
if (1 < spell.EffectDieSides[i])
{
if (spell.EffectRealPointsPerLevel[i] != 0)
sb.AppendFormat(" to {0} + lvl * {1:F}",
spell.EffectBasePoints[i] + 1 + spell.EffectDieSides[i], spell.EffectRealPointsPerLevel[i]);
else
sb.AppendFormat(" to {0}", spell.EffectBasePoints[i] + 1 + spell.EffectDieSides[i]);
}
sb.AppendFormatIfNotNull(" + combo * {0:F}", spell.EffectPointsPerComboPoint[i]);
if (spell.DmgMultiplier[i] != 1.0f)
sb.AppendFormat(" x {0:F}", spell.DmgMultiplier[i]);
sb.AppendFormatIfNotNull(" Multiple = {0:F}", spell.EffectMultipleValue[i]);
sb.AppendLine();
sb.AppendFormatLine("Targets ({0}, {1}) ({2}, {3})",
spell.EffectImplicitTargetA[i], spell.EffectImplicitTargetB[i],
(Targets)spell.EffectImplicitTargetA[i], (Targets)spell.EffectImplicitTargetB[i]);
sb.AppendText(AuraModTypeName(spell, i));
uint[] ClassMask = new uint[3];
switch (i)
{
case 0: ClassMask[0] = spell.EffectSpellClassMaskA[i]; break;
case 1: ClassMask[1] = spell.EffectSpellClassMaskB[i]; break;
case 2: ClassMask[2] = spell.EffectSpellClassMaskC[i]; break;
}
if (ClassMask[0] != 0 || ClassMask[1] != 0 || ClassMask[2] != 0)
{
sb.AppendFormatLine("SpellClassMask = {0:X8} {1:X8} {2:X8}", ClassMask[2], ClassMask[1], ClassMask[0]);
var query = from Spell in DBC.Spell.Values
where Spell.SpellFamilyName == spell.SpellFamilyName
&& ((Spell.SpellFamilyFlags1 & ClassMask[0]) != 0
|| (Spell.SpellFamilyFlags2 & ClassMask[1]) != 0
|| (Spell.SpellFamilyFlags3 & ClassMask[2]) != 0)
join sk in DBC.SkillLineAbility on Spell.ID equals sk.Value.SpellId into temp
from Skill in temp.DefaultIfEmpty()
select new
{
SpellID = Spell.ID,
SpellName = Spell.SpellNameRank,
SkillId = Skill.Value.SkillId
};
foreach (var row in query)
{
if (row.SkillId > 0)
{
sb.SelectionColor = Color.Blue;
sb.AppendFormatLine("\t+ {0} - {1}", row.SpellID, row.SpellName);
}
else
{
sb.SelectionColor = Color.Red;
sb.AppendFormatLine("\t- {0} - {1}", row.SpellID, row.SpellName);
}
sb.SelectionColor = Color.Black;
}
}
sb.AppendFormatLineIfNotNull("{0}", spell.GetRadius(i));
// append trigger spell
var tsId = spell.EffectTriggerSpell[i];
if (tsId != 0)
{
if (DBC.Spell.ContainsKey(tsId))
{
SpellEntry trigger = DBC.Spell[tsId];
sb.SetStyle(Color.Blue, FontStyle.Bold);
sb.AppendFormatLine(" Trigger spell ({0}) {1}. Chance = {2}", tsId, trigger.SpellNameRank, spell.ProcChance);
sb.SetStyle(FontStyle.Italic);
sb.AppendFormatLineIfNotNull(" Description: {0}", trigger.Description);
sb.SetStyle(FontStyle.Italic);
//.........这里部分代码省略.........