本文整理汇总了C#中System.Char.IsUppercaseAscii方法的典型用法代码示例。如果您正苦于以下问题:C# Char.IsUppercaseAscii方法的具体用法?C# Char.IsUppercaseAscii怎么用?C# Char.IsUppercaseAscii使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Char
的用法示例。
在下文中一共展示了Char.IsUppercaseAscii方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoctypeNameBefore
/// <summary>
/// See 8.2.4.53 Before DOCTYPE name state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken DoctypeNameBefore(Char c)
{
while (c.IsSpaceCharacter())
c = Next;
if (c.IsUppercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(Char.ToLower(c));
return DoctypeName(Next, HtmlToken.Doctype(false));
}
else if (c == Specification.Null)
{
RaiseErrorOccurred(ErrorCode.Null);
_stringBuffer.Clear();
_stringBuffer.Append(Specification.Replacement);
return DoctypeName(Next, HtmlToken.Doctype(false));
}
else if (c == Specification.GreaterThan)
{
_state = HtmlParseMode.PCData;
RaiseErrorOccurred(ErrorCode.TagClosedWrong);
return HtmlToken.Doctype(true);
}
else if (c == Specification.EndOfFile)
{
RaiseErrorOccurred(ErrorCode.EOF);
Back();
return HtmlToken.Doctype(true);
}
_stringBuffer.Clear();
_stringBuffer.Append(c);
return DoctypeName(Next, HtmlToken.Doctype(false));
}
示例2: RCDataLt
/// <summary>
/// See 8.2.4.11 RCDATA less-than sign state
/// </summary>
/// <param name="c">The next input character.</param>
private HtmlToken RCDataLt(Char c)
{
if (c == Symbols.Solidus)
{
// See 8.2.4.12 RCDATA end tag open state
c = GetNext();
if (c.IsUppercaseAscii())
{
StringBuffer.Append(Char.ToLowerInvariant(c));
return RCDataNameEndTag(GetNext());
}
else if (c.IsLowercaseAscii())
{
StringBuffer.Append(c);
return RCDataNameEndTag(GetNext());
}
else
{
StringBuffer.Append(Symbols.LessThan).Append(Symbols.Solidus);
return RCDataText(c);
}
}
else
{
StringBuffer.Append(Symbols.LessThan);
return RCDataText(c);
}
}
示例3: RawtextLT
/// <summary>
/// See 8.2.4.14 RAWTEXT less-than sign state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken RawtextLT(Char c)
{
if (c == Symbols.Solidus)
{
// See 8.2.4.15 RAWTEXT end tag open state
c = GetNext();
if (c.IsUppercaseAscii())
{
_stringBuffer.Append(Char.ToLower(c));
return RawtextNameEndTag(GetNext());
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Append(c);
return RawtextNameEndTag(GetNext());
}
else
{
_stringBuffer.Append(Symbols.LessThan).Append(Symbols.Solidus);
return RawtextText(c);
}
}
else
{
_stringBuffer.Append(Symbols.LessThan);
return RawtextText(c);
}
}
示例4: TagOpen
/// <summary>
/// See 8.2.4.8 Tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken TagOpen(Char c)
{
if (c == Symbols.Solidus)
{
return TagEnd(GetNext());
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Append(c);
return TagName(NewTagOpen());
}
else if (c.IsUppercaseAscii())
{
_stringBuffer.Append(Char.ToLower(c));
return TagName(NewTagOpen());
}
else if (c == Symbols.ExclamationMark)
{
return MarkupDeclaration(GetNext());
}
else if (c != Symbols.QuestionMark)
{
_state = HtmlParseMode.PCData;
RaiseErrorOccurred(HtmlParseError.AmbiguousOpenTag);
_stringBuffer.Append(Symbols.LessThan);
return DataText(c);
}
else
{
RaiseErrorOccurred(HtmlParseError.BogusComment);
return BogusComment(c);
}
}
示例5: TagOpen
/// <summary>
/// See 8.2.4.8 Tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken TagOpen(Char c)
{
if (c == Specification.EM)
{
return MarkupDeclaration(_src.Next);
}
else if (c == Specification.SOLIDUS)
{
return TagEnd(_src.Next);
}
else if (c.IsUppercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(Char.ToLower(c));
return TagName(_src.Next, HtmlToken.OpenTag());
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return TagName(_src.Next, HtmlToken.OpenTag());
}
else if (c == Specification.QM)
{
RaiseErrorOccurred(ErrorCode.BogusComment);
return BogusComment(c);
}
_model = HtmlParseMode.PCData;
RaiseErrorOccurred(ErrorCode.AmbiguousOpenTag);
_buffer.Append(Specification.LT);
return Data(c);
}
示例6: DoctypeName
/// <summary>
/// See 8.2.4.54 DOCTYPE name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="doctype">The current doctype token.</param>
/// <returns>The emitted token.</returns>
HtmlToken DoctypeName(Char c, HtmlDoctypeToken doctype)
{
while (true)
{
if (c.IsSpaceCharacter())
{
doctype.Name = _stringBuffer.ToString();
_stringBuffer.Clear();
return DoctypeNameAfter(_src.Next, doctype);
}
else if (c == Specification.GT)
{
_model = HtmlParseMode.PCData;
doctype.Name = _stringBuffer.ToString();
return doctype;
}
else if (c.IsUppercaseAscii())
_stringBuffer.Append(Char.ToLower(c));
else if (c == Specification.NULL)
{
RaiseErrorOccurred(ErrorCode.NULL);
_stringBuffer.Append(Specification.REPLACEMENT);
}
else if (c == Specification.EOF)
{
RaiseErrorOccurred(ErrorCode.EOF);
_src.Back();
doctype.IsQuirksForced = true;
doctype.Name = _stringBuffer.ToString();
return doctype;
}
else
_stringBuffer.Append(c);
c = _src.Next;
}
}
示例7: AttributeName
/// <summary>
/// See 8.2.4.35 Attribute name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="tag">The current tag token.</param>
/// <returns>The emitted token.</returns>
HtmlToken AttributeName(Char c, HtmlTagToken tag)
{
while (true)
{
if (c.IsSpaceCharacter())
{
tag.AddAttribute(_stringBuffer.ToString());
return AttributeAfterName(Next, tag);
}
else if (c == Specification.Solidus)
{
tag.AddAttribute(_stringBuffer.ToString());
return TagSelfClosing(Next, tag);
}
else if (c == Specification.Equality)
{
tag.AddAttribute(_stringBuffer.ToString());
return AttributeBeforeValue(Next, tag);
}
else if (c == Specification.GreaterThan)
{
tag.AddAttribute(_stringBuffer.ToString());
return EmitTag(tag);
}
else if (c == Specification.EndOfFile)
return HtmlToken.EOF;
else if (c == Specification.Null)
{
RaiseErrorOccurred(ErrorCode.Null);
_stringBuffer.Append(Specification.Replacement);
}
else if (c.IsUppercaseAscii())
_stringBuffer.Append(Char.ToLower(c));
else if (c == Specification.DoubleQuote || c == Specification.SingleQuote || c == Specification.LessThan)
{
RaiseErrorOccurred(ErrorCode.AttributeNameInvalid);
_stringBuffer.Append(c);
}
else
_stringBuffer.Append(c);
c = Next;
}
}
示例8: RCDataNameEndTag
/// <summary>
/// See 8.2.4.13 RCDATA end tag name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="tag">The current tag token.</param>
/// <returns>The emitted token.</returns>
HtmlToken RCDataNameEndTag(Char c, HtmlTagToken tag)
{
var name = _stringBuffer.ToString();
var appropriateTag = name == _lastStartTag;
if (appropriateTag && c.IsSpaceCharacter())
{
tag.Name = name;
return AttributeBeforeName(_src.Next, tag);
}
else if (appropriateTag && c == Specification.SOLIDUS)
{
tag.Name = name;
return TagSelfClosing(_src.Next, tag);
}
else if (appropriateTag && c == Specification.GT)
{
tag.Name = name;
return EmitTag(tag);
}
else if (c.IsUppercaseAscii())
{
_stringBuffer.Append(Char.ToLower(c));
return RCDataNameEndTag(_src.Next, tag);
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Append(c);
return RCDataNameEndTag(_src.Next, tag);
}
_buffer.Append(Specification.LT).Append(Specification.SOLIDUS);
_buffer.Append(_stringBuffer.ToString());
return RCData(c);
}
示例9: TagName
/// <summary>
/// See 8.2.4.10 Tag name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="tag">The current tag token.</param>
/// <returns>The emitted token.</returns>
HtmlToken TagName(Char c, HtmlTagToken tag)
{
while (true)
{
if (c.IsSpaceCharacter())
{
tag.Name = _stringBuffer.ToString();
return AttributeBeforeName(Next, tag);
}
else if (c == Specification.Solidus)
{
tag.Name = _stringBuffer.ToString();
return TagSelfClosing(Next, tag);
}
else if (c == Specification.GreaterThan)
{
tag.Name = _stringBuffer.ToString();
return EmitTag(tag);
}
else if (c == Specification.Null)
{
RaiseErrorOccurred(ErrorCode.Null);
_stringBuffer.Append(Specification.Replacement);
}
else if (c == Specification.EndOfFile)
{
RaiseErrorOccurred(ErrorCode.EOF);
return HtmlToken.EOF;
}
else if (c.IsUppercaseAscii())
_stringBuffer.Append(Char.ToLower(c));
else
_stringBuffer.Append(c);
c = Next;
}
}
示例10: TagOpen
/// <summary>
/// See 8.2.4.8 Tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken TagOpen(Char c)
{
if (c == Specification.ExclamationMark)
{
return MarkupDeclaration(Next);
}
else if (c == Specification.Solidus)
{
return TagEnd(Next);
}
else if (c.IsUppercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(Char.ToLower(c));
return TagName(Next, HtmlToken.OpenTag());
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return TagName(Next, HtmlToken.OpenTag());
}
else if (c == Specification.QuestionMark)
{
RaiseErrorOccurred(ErrorCode.BogusComment);
return BogusComment(c);
}
_state = HtmlParseMode.PCData;
RaiseErrorOccurred(ErrorCode.AmbiguousOpenTag);
_buffer.Append(Specification.LessThan);
return Data(c);
}
示例11: TagEnd
/// <summary>
/// See 8.2.4.9 End tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken TagEnd(Char c)
{
if (c.IsUppercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(Char.ToLower(c));
return TagName(Next, HtmlToken.CloseTag());
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return TagName(Next, HtmlToken.CloseTag());
}
else if (c == Specification.GreaterThan)
{
_state = HtmlParseMode.PCData;
RaiseErrorOccurred(ErrorCode.TagClosedWrong);
return Data(Next);
}
else if (c == Specification.EndOfFile)
{
Back();
RaiseErrorOccurred(ErrorCode.EOF);
_buffer.Append(Specification.LessThan).Append(Specification.Solidus);
return HtmlToken.EOF;
}
else
{
RaiseErrorOccurred(ErrorCode.BogusComment);
return BogusComment(c);
}
}
示例12: RawtextNameEndTag
/// <summary>
/// See 8.2.4.16 RAWTEXT end tag name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="tag">The current tag token.</param>
/// <returns>The emitted token.</returns>
HtmlToken RawtextNameEndTag(Char c, HtmlTagToken tag)
{
var name = _stringBuffer.ToString();
var appropriateTag = name == _lastStartTag;
if (appropriateTag && c.IsSpaceCharacter())
{
tag.Name = name;
return AttributeBeforeName(Next, tag);
}
else if (appropriateTag && c == Specification.Solidus)
{
tag.Name = name;
return TagSelfClosing(Next, tag);
}
else if (appropriateTag && c == Specification.GreaterThan)
{
tag.Name = name;
return EmitTag(tag);
}
else if (c.IsUppercaseAscii())
{
_stringBuffer.Append(Char.ToLower(c));
return RawtextNameEndTag(Next, tag);
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Append(c);
return RawtextNameEndTag(Next, tag);
}
_buffer.Append(Specification.LessThan).Append(Specification.Solidus);
_buffer.Append(_stringBuffer.ToString());
return Rawtext(c);
}
示例13: RawtextEndTag
/// <summary>
/// See 8.2.4.15 RAWTEXT end tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken RawtextEndTag(Char c)
{
if (c.IsUppercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(Char.ToLower(c));
return RawtextNameEndTag(Next, HtmlToken.CloseTag());
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return RawtextNameEndTag(Next, HtmlToken.CloseTag());
}
_buffer.Append(Specification.LessThan).Append(Specification.Solidus);
return Rawtext(c);
}
示例14: DoctypeNameBefore
/// <summary>
/// See 8.2.4.53 Before DOCTYPE name state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken DoctypeNameBefore(Char c)
{
while (c.IsSpaceCharacter())
c = _src.Next;
if (c.IsUppercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(Char.ToLower(c));
return DoctypeName(_src.Next, HtmlToken.Doctype(false));
}
else if (c == Specification.NULL)
{
RaiseErrorOccurred(ErrorCode.NULL);
_stringBuffer.Clear();
_stringBuffer.Append(Specification.REPLACEMENT);
return DoctypeName(_src.Next, HtmlToken.Doctype(false));
}
else if (c == Specification.GT)
{
_model = HtmlParseMode.PCData;
RaiseErrorOccurred(ErrorCode.TagClosedWrong);
return HtmlToken.Doctype(true);
}
else if (c == Specification.EOF)
{
RaiseErrorOccurred(ErrorCode.EOF);
_src.Back();
return HtmlToken.Doctype(true);
}
_stringBuffer.Clear();
_stringBuffer.Append(c);
return DoctypeName(_src.Next, HtmlToken.Doctype(false));
}
示例15: DoctypeName
/// <summary>
/// See 8.2.4.54 DOCTYPE name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="doctype">The current doctype token.</param>
/// <returns>The emitted token.</returns>
HtmlToken DoctypeName(Char c, HtmlDoctypeToken doctype)
{
while (true)
{
if (c.IsSpaceCharacter())
{
doctype.Name = _stringBuffer.ToString();
_stringBuffer.Clear();
return DoctypeNameAfter(Next, doctype);
}
else if (c == Specification.GreaterThan)
{
_state = HtmlParseMode.PCData;
doctype.Name = _stringBuffer.ToString();
return doctype;
}
else if (c.IsUppercaseAscii())
_stringBuffer.Append(Char.ToLower(c));
else if (c == Specification.Null)
{
RaiseErrorOccurred(ErrorCode.Null);
_stringBuffer.Append(Specification.Replacement);
}
else if (c == Specification.EndOfFile)
{
RaiseErrorOccurred(ErrorCode.EOF);
Back();
doctype.IsQuirksForced = true;
doctype.Name = _stringBuffer.ToString();
return doctype;
}
else
_stringBuffer.Append(c);
c = Next;
}
}