本文整理汇总了C#中BetterList.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# BetterList.RemoveAt方法的具体用法?C# BetterList.RemoveAt怎么用?C# BetterList.RemoveAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BetterList
的用法示例。
在下文中一共展示了BetterList.RemoveAt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseSymbol
/// <summary>
/// Parse an embedded symbol, such as [FFAA00] (set color) or [-] (undo color change). Returns whether the index was adjusted.
/// </summary>
static public bool ParseSymbol (string text, ref int index, BetterList<Color> colors, bool premultiply)
{
if (colors == null) return ParseSymbol(text, ref index);
int length = text.Length;
if (index + 2 < length && text[index] == '[')
{
if (text[index + 1] == '-')
{
if (text[index + 2] == ']')
{
if (colors != null && colors.size > 1)
colors.RemoveAt(colors.size - 1);
index += 3;
return true;
}
}
else if (index + 7 < length)
{
if (text[index + 7] == ']')
{
if (colors != null)
{
Color c = ParseColor(text, index + 1);
if (EncodeColor(c) != text.Substring(index + 1, 6).ToUpper())
return false;
c.a = colors[colors.size - 1].a;
if (premultiply && c.a != 1f)
c = Color.Lerp(mInvisible, c, c.a);
colors.Add(c);
}
index += 8;
return true;
}
}
}
return false;
}
示例2: ParseSymbol
/// <summary>
/// Parse the symbol, if possible. Returns 'true' if the 'index' was adjusted. Advanced symbol support contributed by Rudy Pangestu.
/// </summary>
static public bool ParseSymbol (string text, ref int index, BetterList<Color> colors, bool premultiply,
ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike)
{
int length = text.Length;
if (index + 3 > length || text[index] != '[') return false;
if (text[index + 2] == ']')
{
if (text[index + 1] == '-')
{
if (colors != null && colors.size > 1)
colors.RemoveAt(colors.size - 1);
index += 3;
return true;
}
string sub3 = text.Substring(index, 3);
switch (sub3)
{
case "[b]":
bold = true;
index += 3;
return true;
case "[i]":
italic = true;
index += 3;
return true;
case "[u]":
underline = true;
index += 3;
return true;
case "[s]":
strike = true;
index += 3;
return true;
}
}
if (index + 4 > length) return false;
if (text[index + 3] == ']')
{
string sub4 = text.Substring(index, 4);
switch (sub4)
{
case "[/b]":
bold = false;
index += 4;
return true;
case "[/i]":
italic = false;
index += 4;
return true;
case "[/u]":
underline = false;
index += 4;
return true;
case "[/s]":
strike = false;
index += 4;
return true;
default:
int a = (NGUIMath.HexToDecimal(text[index + 1]) << 4) | NGUIMath.HexToDecimal(text[index + 2]);
mAlpha = a / 255f;
index += 4;
return true;
}
}
if (index + 5 > length) return false;
if (text[index + 4] == ']')
{
string sub5 = text.Substring(index, 5);
switch (sub5)
{
case "[sub]":
sub = 1;
index += 5;
return true;
case "[sup]":
sub = 2;
index += 5;
return true;
//.........这里部分代码省略.........
示例3: ParseSymbol
/// <summary>
/// Parse the symbol, if possible. Returns 'true' if the 'index' was adjusted. Advanced symbol support contributed by Rudy Pangestu.
/// </summary>
static public bool ParseSymbol (string text, ref int index, BetterList<Color> colors, bool premultiply,
ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike)
{
int length = text.Length;
if (index + 3 > length || text[index] != '[') return false;
if (text[index + 2] == ']')
{
if (text[index + 1] == '-')
{
if (colors != null && colors.size > 1)
colors.RemoveAt(colors.size - 1);
index += 3;
return true;
}
string sub3 = text.Substring(index, 3);
switch (sub3)
{
case "[b]":
bold = true;
index += 3;
return true;
case "[i]":
italic = true;
index += 3;
return true;
case "[u]":
underline = true;
index += 3;
return true;
case "[s]":
strike = true;
index += 3;
return true;
}
}
if (index + 4 > length) return false;
if (text[index + 3] == ']')
{
string sub4 = text.Substring(index, 4);
switch (sub4)
{
case "[/b]":
bold = false;
index += 4;
return true;
case "[/i]":
italic = false;
index += 4;
return true;
case "[/u]":
underline = false;
index += 4;
return true;
case "[/s]":
strike = false;
index += 4;
return true;
}
}
if (index + 5 > length) return false;
if (text[index + 4] == ']')
{
string sub5 = text.Substring(index, 5);
switch (sub5)
{
case "[sub]":
sub = 1;
index += 5;
return true;
case "[sup]":
sub = 2;
index += 5;
return true;
}
}
if (index + 6 > length) return false;
if (text[index + 5] == ']')
//.........这里部分代码省略.........
示例4: ParseSymbol
public static bool ParseSymbol(string text, ref int index, BetterList<Color> colors, bool premultiply, ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike, ref bool ignoreColor)
{
int length = text.Length;
if (index + 3 > length || text[index] != '[')
{
return false;
}
if (text[index + 2] == ']')
{
if (text[index + 1] == '-')
{
if (colors != null && colors.size > 1)
{
colors.RemoveAt(colors.size - 1);
}
index += 3;
return true;
}
string text2 = text.Substring(index, 3);
string text3 = text2;
switch (text3)
{
case "[b]":
bold = true;
index += 3;
return true;
case "[i]":
italic = true;
index += 3;
return true;
case "[u]":
underline = true;
index += 3;
return true;
case "[s]":
strike = true;
index += 3;
return true;
case "[c]":
ignoreColor = true;
index += 3;
return true;
}
}
if (index + 4 > length)
{
return false;
}
if (text[index + 3] == ']')
{
string text4 = text.Substring(index, 4);
string text3 = text4;
switch (text3)
{
case "[/b]":
bold = false;
index += 4;
return true;
case "[/i]":
italic = false;
index += 4;
return true;
case "[/u]":
underline = false;
index += 4;
return true;
case "[/s]":
strike = false;
index += 4;
return true;
case "[/c]":
ignoreColor = false;
index += 4;
return true;
}
char ch = text[index + 1];
char ch2 = text[index + 2];
if (NGUIText.IsHex(ch) && NGUIText.IsHex(ch2))
{
int num2 = NGUIMath.HexToDecimal(ch) << 4 | NGUIMath.HexToDecimal(ch2);
NGUIText.mAlpha = (float)num2 / 255f;
index += 4;
return true;
}
}
if (index + 5 > length)
{
return false;
}
if (text[index + 4] == ']')
{
string text5 = text.Substring(index, 5);
string text3 = text5;
if (text3 != null)
{
if (NGUIText.<>f__switch$mapE == null)
{
NGUIText.<>f__switch$mapE = new Dictionary<string, int>(2)
{
{
//.........这里部分代码省略.........