本文整理汇总了C#中Mono.TextEditor.Highlighting.Span类的典型用法代码示例。如果您正苦于以下问题:C# Span类的具体用法?C# Span怎么用?C# Span使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Span类属于Mono.TextEditor.Highlighting命名空间,在下文中一共展示了Span类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DefaultFoundSpanEnd
void DefaultFoundSpanEnd (Span span, int offset, int length)
{
PopSpan ();
}
开发者ID:nieve,项目名称:monodevelop,代码行数:4,代码来源:SyntaxMode.cs
示例2: CreatePreprocessorSpan
public static Span CreatePreprocessorSpan ()
{
var result = new Span ();
result.TagColor = "text.preprocessor";
result.Color = "text.preprocessor";
result.Rule = "String";
result.StopAtEol = true;
return result;
}
开发者ID:Poiros,项目名称:monodevelop,代码行数:9,代码来源:CSharpSyntaxMode.cs
示例3: DefaultFoundSpanBegin
void DefaultFoundSpanBegin (Span span, int offset, int length)
{
PushSpan (span, GetRule (span));
}
开发者ID:nieve,项目名称:monodevelop,代码行数:4,代码来源:SyntaxMode.cs
示例4: FoundSpanEnd
public void FoundSpanEnd (Span span, int offset, int length)
{
curChunk.Length = offset - curChunk.Offset;
curChunk.Style = GetStyle (curChunk) ?? GetChunkStyle (span);
AddChunk (ref curChunk, 0, defaultStyle);
curChunk.Offset = offset;
curChunk.Length = length;
curChunk.Style = span.TagColor ?? GetChunkStyle (span);
AddChunk (ref curChunk, 0, defaultStyle);
spanParser.PopSpan ();
}
开发者ID:nieve,项目名称:monodevelop,代码行数:12,代码来源:SyntaxMode.cs
示例5: ScanSpanEnd
protected override bool ScanSpanEnd(Span cur, ref int i)
{
return base.ScanSpanEnd(cur, ref i);
}
开发者ID:foerdi,项目名称:Mono-D,代码行数:4,代码来源:DSyntaxMode.cs
示例6: ScanSpanEnd
protected virtual bool ScanSpanEnd (Span cur, ref int i)
{
int textOffset = i - StartOffset;
if (cur.End != null) {
RegexMatch match = cur.End.TryMatch (CurText, textOffset);
if (match.Success) {
FoundSpanEnd (cur, i, match.Length);
i += match.Length - 1;
return true;
}
}
if (cur.Exit != null) {
RegexMatch match = cur.Exit.TryMatch (CurText, textOffset);
if (match.Success) {
FoundSpanExit (cur, i, match.Length);
i += match.Length - 1;
return true;
}
}
return false;
}
开发者ID:nieve,项目名称:monodevelop,代码行数:23,代码来源:SyntaxMode.cs
示例7: FoundSpanBegin
public void FoundSpanBegin (Span span, int offset, int length)
{
curChunk.Length = offset - curChunk.Offset;
curChunk.Style = GetStyle (curChunk);
if (string.IsNullOrEmpty (curChunk.Style)) {
// Span tmpSpan = spanParser.SpanStack.Count > 0 ? spanParser.SpanStack.Pop () : null;
curChunk.Style = GetSpanStyle ();
// if (tmpSpan != null)
// spanParser.SpanStack.Push (tmpSpan);
}
AddChunk (ref curChunk, 0, curChunk.Style);
Rule spanRule = spanParser.GetRule (span);
if (spanRule == null)
throw new Exception ("Rule " + span.Rule + " not found in " + span);
spanParser.PushSpan (span, spanRule);
curChunk.Offset = offset;
curChunk.Length = length;
curChunk.Style = span.TagColor ?? GetChunkStyle (span);
curChunk.SpanStack.Push (span);
AddChunk (ref curChunk, 0, curChunk.Style);
foreach (SemanticRule semanticRule in spanRule.SemanticRules) {
semanticRule.Analyze (this.doc, line, curChunk, offset, line.EndOffset);
}
}
开发者ID:nieve,项目名称:monodevelop,代码行数:27,代码来源:SyntaxMode.cs
示例8: PushSpan
public void PushSpan (Span span, Rule rule)
{
spanStack.Push (span);
ruleStack.Push (rule);
CurRule = rule;
CurSpan = span;
if (rule.Name == "InterpolatedString" || rule.Name == "InterpolatedVerbatimString")
interpolatedBraces.Push(0);
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:9,代码来源:SyntaxMode.cs
示例9: ScanSpanEnd
protected virtual bool ScanSpanEnd (Span cur, ref int i)
{
int textOffset = i - StartOffset;
if (cur.End != null) {
if (interpolatedBraces.Count > 0) {
char ch = CurText [textOffset];
if (ch == '{')
interpolatedBraces.Push (interpolatedBraces.Pop () + 1);
else if (ch == '}')
interpolatedBraces.Push (interpolatedBraces.Pop () - 1);
if (interpolatedBraces.Peek () >= 1)
return false;
}
RegexMatch match = cur.End.TryMatch (CurText, textOffset);
if (match.Success) {
FoundSpanEnd (cur, i, match.Length);
i += System.Math.Max (0, match.Length - 1);
return true;
}
}
if (cur.Exit != null) {
RegexMatch match = cur.Exit.TryMatch (CurText, textOffset);
if (match.Success) {
FoundSpanExit (cur, i, match.Length);
i += System.Math.Max (0, match.Length - 1);
return true;
}
}
return false;
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:32,代码来源:SyntaxMode.cs
示例10: FoundSpanBegin
public void FoundSpanBegin (Span span, int offset, int length)
{
curChunk.Length = offset - curChunk.Offset;
curChunk.Style = GetStyle (curChunk) ?? GetSpanStyle ();
AddChunk (ref curChunk, 0, curChunk.Style);
curChunk.Offset = offset;
curChunk.Length = length;
curChunk.Style = GetChunkStyle (span);
AddChunk (ref curChunk, 0, curChunk.Style);
Rule spanRule = spanParser.GetRule (span);
if (spanRule == null)
throw new Exception ("Rule " + span.Rule + " not found in " + span);
foreach (SemanticRule semanticRule in spanRule.SemanticRules) {
semanticRule.Analyze (this.doc, line, curChunk, offset, line.EndOffset);
}
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:17,代码来源:SyntaxMode.cs
示例11: EndsWithContinuation
bool EndsWithContinuation (Span span, LineSegment line)
{
return !span.StopAtEol || span.StopAtEol && !string.IsNullOrEmpty (span.Continuation) &&
line != null && doc.GetTextAt (line).Trim ().EndsWith (span.Continuation);
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:5,代码来源:SyntaxModeService.cs
示例12: ScanSpanEnd
protected virtual bool ScanSpanEnd (Span cur, int i)
{
if (cur.End != null) {
RegexMatch match = cur.End.TryMatch (doc, i);
if (match.Success) {
OnFoundSpanEnd (cur, i, match.Length);
spanStack.Pop ();
if (ruleStack.Count > 1) // rulStack[1] is always syntax mode
ruleStack.Pop ();
return true;
}
}
if (cur.Exit != null) {
RegexMatch match = cur.Exit.TryMatch (doc, i);
if (match.Success) {
spanStack.Pop ();
if (ruleStack.Count > 1) // rulStack[1] is always syntax mode
ruleStack.Pop ();
OnFoundSpanExit (cur, i, match.Length);
return true;
}
}
return false;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:25,代码来源:SyntaxMode.cs
示例13: OnFoundSpanEnd
public virtual void OnFoundSpanEnd (Span span, int offset, int length)
{
if (FoundSpanEnd != null)
FoundSpanEnd (span, offset, length);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:SyntaxMode.cs
示例14: OnFoundSpanBegin
public virtual void OnFoundSpanBegin (Span span, int offset, int length)
{
if (FoundSpanBegin != null)
FoundSpanBegin (span, offset, length);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:SyntaxMode.cs
示例15: PushSpan
public void PushSpan (Span span, Rule rule)
{
spanStack.Push (span);
ruleStack.Push (rule);
this.CurRule = rule;
this.CurSpan = span;
}
开发者ID:nieve,项目名称:monodevelop,代码行数:7,代码来源:SyntaxMode.cs
示例16: ScanSpanEnd
protected override bool ScanSpanEnd(Span cur, ref int i)
{
int textOffset = i - StartOffset;
if (cur.End != null && (cur.Rule == "Table" || cur.Rule == "TableHeader")) {
if (cur.Rule == "Table") {
if (CurText [textOffset] != cur.End.Pattern [0] || CurText.Skip (textOffset + 1).Any (e => e == cur.End.Pattern [0])) {
return false;
}
}
if (cur.Rule == "TableHeader") {
if (textOffset != 0 || (!string.IsNullOrWhiteSpace(CurText) && CurText.First (ch => !char.IsWhiteSpace (ch)) == cur.End.Pattern [0])) {
return false;
}
}
FoundSpanEnd (cur, i, 1);
return true;
}
if (cur.End != null) {
RegexMatch match = cur.End.TryMatch (CurText, textOffset);
if (match.Success) {
FoundSpanEnd (cur, i, match.Length);
i += Math.Max (0, match.Length - 1);
return true;
}
}
if (cur.Exit != null) {
RegexMatch match = cur.Exit.TryMatch (CurText, textOffset);
if (match.Success) {
FoundSpanExit (cur, i, match.Length);
i += -1;
return true;
}
}
return false;
}
开发者ID:ItsVeryWindy,项目名称:Mono-Cucumber,代码行数:41,代码来源:GherkinSyntaxMode.cs
示例17: GetRule
public Rule GetRule (Span span)
{
if (string.IsNullOrEmpty (span.Rule))
return new Rule (mode);
return CurRule.GetRule (span.Rule);
}
开发者ID:nieve,项目名称:monodevelop,代码行数:6,代码来源:SyntaxMode.cs
示例18: Clone
public Span Clone ()
{
var newSpan = new Span ();
if (Begin != null)
newSpan.Begin = Begin.Clone ();
newSpan.BeginFlags = BeginFlags;
newSpan.Color = Color;
newSpan.Continuation = Continuation;
if (End != null)
newSpan.End = End.Clone ();
newSpan.EndFlags = EndFlags;
newSpan.Escape = Escape;
if (Exit != null)
newSpan.Exit = Exit.Clone ();
newSpan.ExitFlags = ExitFlags;
newSpan.NextColor = NextColor;
newSpan.Rule = Rule;
newSpan.StopAtEol = StopAtEol;
newSpan.TagColor = TagColor;
newSpan.BeginTagColor = beginTagColor;
newSpan.EndTagColor = endTagColor;
return newSpan;
}
开发者ID:harishamdani,项目名称:monodevelop,代码行数:23,代码来源:Span.cs
示例19: GetChunkStyle
string GetChunkStyle (Span span)
{
if (span == null)
return GetSpanStyle ();
return span.Color ?? GetSpanStyle ();
}
开发者ID:nieve,项目名称:monodevelop,代码行数:6,代码来源:SyntaxMode.cs
示例20: Read
public static Span Read (XmlReader reader)
{
Span result = new Span ();
result.Rule = reader.GetAttribute ("rule");
result.Color = reader.GetAttribute ("color");
result.TagColor = reader.GetAttribute ("tagColor");
result.NextColor = reader.GetAttribute ("nextColor");
result.Escape = reader.GetAttribute ("escape");
string stopateol = reader.GetAttribute ("stopateol");
if (!String.IsNullOrEmpty (stopateol)) {
result.StopAtEol = Boolean.Parse (stopateol);
}
if (reader.LocalName == AltNode) {
AddFlags (result.BeginFlags, reader.GetAttribute ("flags"));
result.Continuation = reader.GetAttribute ("continuation");
result.Begin = new Regex (reader.ReadElementString ());
result.StopAtEol = true;
} else {
XmlReadHelper.ReadList (reader, Node, delegate () {
switch (reader.LocalName) {
case "Begin":
AddFlags (result.BeginFlags, reader.GetAttribute ("flags"));
result.Begin = new Regex (reader.ReadElementString ());
return true;
case "End":
AddFlags (result.EndFlags, reader.GetAttribute ("flags"));
result.End = new Regex (reader.ReadElementString ());
return true;
case "Exit":
AddFlags (result.ExitFlags, reader.GetAttribute ("flags"));
result.Exit = new Regex (reader.ReadElementString ());
return true;
}
return false;
});
}
return result;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:42,代码来源:Span.cs
注:本文中的Mono.TextEditor.Highlighting.Span类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论