本文整理汇总了C#中ParseItem.InsertAfter方法的典型用法代码示例。如果您正苦于以下问题:C# ParseItem.InsertAfter方法的具体用法?C# ParseItem.InsertAfter怎么用?C# ParseItem.InsertAfter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParseItem
的用法示例。
在下文中一共展示了ParseItem.InsertAfter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddItem
/// <summary>
/// Add a command, keyword, operator, etc to the tag list
/// </summary>
private void AddItem(ref string s_SQL, ref int s32_Start, int s32_End, ref ParseItem i_LastItem)
{
int s32_Last = Math.Min (s32_End, s_SQL.Length);
string s_Text = s_SQL.Substring(s32_Start, s32_Last -s32_Start);
ParseItem i_Item = new ParseItem(this, s_Text);
if (i_Item.Type != eType.Invalid)
{
if (mi_FirstItem == null)
mi_FirstItem = i_Item;
else
i_LastItem.InsertAfter(i_Item);
i_LastItem = i_Item;
if (!mb_CursorStored && ms32_CursorPos <= s32_End)
{
mb_CursorStored = true;
i_Item.CursorPos = Math.Max(0, ms32_CursorPos - s32_Start);
Functions.PrintDebug("AddItem() set CursorPos={0} in Item {1} <{2}> ...", i_Item.CursorPos, getDebug(i_Item.Prev), getDebug(i_Item), typeof(Parser));
}
}
s32_Start = -1;
}
示例2: SetLinebreakAfter
/// <summary>
/// Controls the count of linebreaks after an item
/// These linebreaks are permananet and cannot be deleted by clean-up operations
/// It is allowed that i_Item may be null !
/// </summary>
public static void SetLinebreakAfter(ParseItem i_Item, int s32_Count)
{
if (i_Item == null || i_Item.Next == null) // Don't insert linebreaks after the last item
return;
if (!i_Item.mi_Parser.mb_ModifyLineBR)
return;
// Assure at least s32_Count Linebreaks which are permanent
for (int i=0; i<s32_Count; i++)
{
if (getType(i_Item.Next) != eType.LineBreak)
i_Item.InsertAfter(new ParseItem(i_Item.mi_Parser, "\n"));
i_Item = i_Item.Next;
i_Item.Permanent = true;
}
}