本文整理汇总了C#中System.Windows.Forms.RichTextBox.AppendLine方法的典型用法代码示例。如果您正苦于以下问题:C# RichTextBox.AppendLine方法的具体用法?C# RichTextBox.AppendLine怎么用?C# RichTextBox.AppendLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.RichTextBox
的用法示例。
在下文中一共展示了RichTextBox.AppendLine方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BookingLockoutsForDate
public void BookingLockoutsForDate(RichTextBox rtb, DateTime date)
{
rtb.Text = "";
var unitOfWork = new UnitOfWork();
var today = date.Date;
var notes = unitOfWork.LockedOutDateRepository.Get(x => today < x.EndDate && today > x.StartDate,includeProperties:"LockOutTimes");
notes = notes.OrderBy(x => x.DateCreated);
if (notes.Count() > 0)
{
rtb.AppendBoldColoredLine("Locked:", System.Drawing.Color.Red);
int i = 1;
foreach (var note in notes)
{
rtb.AppendBoldColoredLine(i + ". " + note.Name, System.Drawing.Color.Red);
string reason = note.Reason;
rtb.AppendLine(reason);
if (note.LockOutTimes.Count>0)
{
foreach(var v in note.LockOutTimes)
{
rtb.AppendText(v.StartTime.ToShortTimeString() + " - "+ v.EndTime.ToShortTimeString()+", " );
}
}
}
}
}
示例2: DateNotesForDate
public void DateNotesForDate(RichTextBox rtb, DateTime date, bool includeRoster, bool includeBookingNotes)
{
rtb.Text = "";
rtb.AppendBoldLine("Todays Notes:");
var unitOfWork = new UnitOfWork();
var today = date;
var notes = unitOfWork.DateNoteRepository.Get(x => x.InactiveDate == null && today < x.EndDate && today > x.StartDate);
if (!(includeRoster && includeBookingNotes))
{
if (includeBookingNotes)
notes = notes.Where(x => x.AppearOnAddingBooking);
if (includeRoster)
notes = notes.Where(x => x.AppearOnRoster);
}
notes = notes.OrderBy(x => x.DateCreated);
int i = 1;
foreach (var note in notes)
{
rtb.AppendLine(i + ". " + note.Note);
}
}
示例3: 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);
//.........这里部分代码省略.........
示例4: SpellInfo
public SpellInfo(RichTextBox sb, SpellEntry spell)
{
sb.Clear();
sb.SetBold();
sb.AppendFormatLine("ID - {0} {1}", spell.ID, spell.SpellNameRank);
sb.SetDefaultStyle();
sb.AppendFormatLine("=================================================");
sb.AppendFormatLineIfNotNull("Description: {0}", spell.Description);
sb.AppendFormatLineIfNotNull("ToolTip: {0}", spell.ToolTip);
sb.AppendFormatLineIfNotNull("Modal Next Spell: {0}", spell.ModalNextSpell);
if (spell.Description != string.Empty && spell.ToolTip != string.Empty && spell.ModalNextSpell != 0)
sb.AppendFormatLine("=================================================");
sb.AppendFormatLine("Category = {0}, SpellIconID = {1}, activeIconID = {2}, SpellVisual = ({3},{4})",
spell.Category, spell.SpellIconID, spell.ActiveIconID, spell.SpellVisual[0], spell.SpellVisual[1]);
sb.AppendFormatLine("Family {0}, flag 0x{1:X8} {2:X8} {3:X8}",
(SpellFamilyNames)spell.SpellFamilyName, spell.SpellFamilyFlags3, spell.SpellFamilyFlags2, spell.SpellFamilyFlags1);
sb.AppendLine();
sb.AppendFormatLine("SpellSchoolMask = {0} ({1})", spell.SchoolMask, spell.School);
sb.AppendFormatLine("DamageClass = {0} ({1})", spell.DmgClass, (SpellDmgClass)spell.DmgClass);
sb.AppendFormatLine("PreventionType = {0} ({1})", spell.PreventionType, (SpellPreventionType)spell.PreventionType);
if (spell.Attributes != 0 || spell.AttributesEx != 0 || spell.AttributesEx2 != 0 || spell.AttributesEx3 != 0
|| spell.AttributesEx4 != 0 || spell.AttributesEx5 != 0 || spell.AttributesEx6 != 0 || spell.AttributesExG != 0)
sb.AppendLine("=================================================");
if (spell.Attributes != 0)
sb.AppendFormatLine("Attributes: 0x{0:X8} ({1})", spell.Attributes, (SpellAtribute)spell.Attributes);
if (spell.AttributesEx != 0)
sb.AppendFormatLine("AttributesEx1: 0x{0:X8} ({1})", spell.AttributesEx, (SpellAtributeEx)spell.AttributesEx);
if (spell.AttributesEx2 != 0)
sb.AppendFormatLine("AttributesEx2: 0x{0:X8} ({1})", spell.AttributesEx2, (SpellAtributeEx2)spell.AttributesEx2);
if (spell.AttributesEx3 != 0)
sb.AppendFormatLine("AttributesEx3: 0x{0:X8} ({1})", spell.AttributesEx3, (SpellAtributeEx3)spell.AttributesEx3);
if (spell.AttributesEx4 != 0)
sb.AppendFormatLine("AttributesEx4: 0x{0:X8} ({1})", spell.AttributesEx4, (SpellAtributeEx4)spell.AttributesEx4);
if (spell.AttributesEx5 != 0)
sb.AppendFormatLine("AttributesEx5: 0x{0:X8} ({1})", spell.AttributesEx5, (SpellAtributeEx5)spell.AttributesEx5);
if (spell.AttributesEx6 != 0)
sb.AppendFormatLine("AttributesEx6: 0x{0:X8} ({1})", spell.AttributesEx6, (SpellAtributeEx6)spell.AttributesEx6);
if (spell.AttributesExG != 0)
sb.AppendFormatLine("AttributesExG: 0x{0:X8} ({1})", spell.AttributesExG, (SpellAtributeExG)spell.AttributesExG);
sb.AppendLine("=================================================");
if (spell.Targets != 0)
sb.AppendFormatLine("Targets Mask = 0x{0:X8} ({1})", spell.Targets, (SpellCastTargetFlags)spell.Targets);
if (spell.TargetCreatureType != 0)
sb.AppendFormatLine("Creature Type Mask = 0x{0:X8} ({1})",
spell.TargetCreatureType, (CreatureTypeMask)spell.TargetCreatureType);
if (spell.Stances != 0)
sb.AppendFormatLine("Stances: {0}", (ShapeshiftFormMask)spell.Stances);
if (spell.StancesNot != 0)
sb.AppendFormatLine("Stances Not: {0}", (ShapeshiftFormMask)spell.StancesNot);
AppendSkillLine(sb, spell.ID);
sb.AppendFormatLine("Spell Level = {0}, base {1}, max {2}, maxTarget {3}",
spell.SpellLevel, spell.BaseLevel, spell.MaxLevel, spell.MaxTargetLevel);
if (spell.EquippedItemClass != -1)
{
sb.AppendFormatLine("EquippedItemClass = {0} ({1})", spell.EquippedItemClass, (ItemClass)spell.EquippedItemClass);
if (spell.EquippedItemSubClassMask != 0)
{
switch ((ItemClass)spell.EquippedItemClass)
{
case ItemClass.WEAPON:
sb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})",
spell.EquippedItemSubClassMask, (ItemSubClassWeaponMask)spell.EquippedItemSubClassMask);
break;
case ItemClass.ARMOR:
sb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})",
spell.EquippedItemSubClassMask, (ItemSubClassArmorMask)spell.EquippedItemSubClassMask);
break;
case ItemClass.MISC:
sb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})",
spell.EquippedItemSubClassMask, (ItemSubClassMiscMask)spell.EquippedItemSubClassMask);
break;
}
}
if (spell.EquippedItemInventoryTypeMask != 0)
sb.AppendFormatLine(" InventoryType mask = 0x{0:X8} ({1})",
spell.EquippedItemInventoryTypeMask, (InventoryTypeMask)spell.EquippedItemInventoryTypeMask);
}
sb.AppendLine();
sb.AppendFormatLine("Category = {0}", spell.Category);
sb.AppendFormatLine("DispelType = {0} ({1})", spell.Dispel, (DispelType)spell.Dispel);
sb.AppendFormatLine("Mechanic = {0} ({1})", spell.Mechanic, (Mechanics)spell.Mechanic);
//.........这里部分代码省略.........