本文整理汇总了C#中Mono.TextEditor.Highlighting.ColorScheme类的典型用法代码示例。如果您正苦于以下问题:C# ColorScheme类的具体用法?C# ColorScheme怎么用?C# ColorScheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColorScheme类属于Mono.TextEditor.Highlighting命名空间,在下文中一共展示了ColorScheme类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetIsValid
public virtual bool GetIsValid (ColorScheme style)
{
foreach (Keywords keyword in keywords) {
if (!keyword.GetIsValid (style)) {
System.Console.WriteLine (keyword + " failed.");
return false;
}
}
foreach (Span span in spans) {
if (!span.GetIsValid (style)) {
System.Console.WriteLine (span + " failed.");
return false;
}
}
foreach (Match match in matches) {
if (!match.GetIsValid (style)) {
System.Console.WriteLine (match + " failed.");
return false;
}
}
foreach (Marker marker in prevMarker) {
if (!marker.GetIsValid (style)) {
System.Console.WriteLine (marker + " failed.");
return false;
}
}
return true;
}
示例2: GetFileNameForStyle
public static string GetFileNameForStyle (ColorScheme style)
{
string result;
if (!isLoadedFromFile.TryGetValue (style.Name, out result))
return null;
return result;
}
示例3: InvalidMimeTypeInScriptTypeAttribute
public void InvalidMimeTypeInScriptTypeAttribute ()
{
var doc = new TextDocument ();
var syntaxMode = new WebFormsSyntaxMode ();
syntaxMode.Document = doc;
doc.Text =
@"<%@ Page Language=""C#"" Inherits=""AspnetTest.Default"" %>
<!DOCTYPE html>
<html>
<head runat=""server"">
<title>Default</title>
</head>
<body>
<form id=""form1"" runat=""server"">
<asp:Button id=""button1"" runat=""server"" Text=""Click me!"" OnClick=""button1Clicked"" />
</form>
<script type=""></script>
</body>
</html>
";
var style = new ColorScheme ();
foreach (DocumentLine line in doc.Lines) {
Assert.DoesNotThrow (() => syntaxMode.GetChunks (style, line, line.Offset, line.Length).ToList ());
}
}
示例4: GetIsValid
public virtual bool GetIsValid (ColorScheme style)
{
if (style.GetChunkStyle (Color) == null) {
System.Console.WriteLine("color:" + Color + " not found.");
return false;
}
return true;
}
示例5: SignatureMarkupCreator
public SignatureMarkupCreator (CSharpResolver resolver, CSharpFormattingOptions formattingOptions)
{
this.colorStyle = SyntaxModeService.GetColorStyle (MonoDevelop.Ide.IdeApp.Preferences.ColorScheme);
this.resolver = resolver;
this.astBuilder = new TypeSystemAstBuilder (resolver) {
ConvertUnboundTypeArguments = true,
UseAliases = false
};
this.formattingOptions = formattingOptions;
}
示例6: Create
public static TooltipInformation Create(DNode dn, ColorScheme st, bool templateParamCompletion = false, int currentMethodParam = -1)
{
var markupGen = new TooltipMarkupGen (st);
var tti = new TooltipInformation {
SignatureMarkup = markupGen.GenTooltipSignature(dn, templateParamCompletion, currentMethodParam)
};
CreateTooltipBody (markupGen, dn, tti);
return tti;
}
示例7: ApplyStyle
void ApplyStyle (ColorScheme sheme)
{
sheme.Name = entryName.Text;
sheme.Description = entryDescription.Text;
Gtk.TreeIter iter;
if (colorStore.GetIterFirst (out iter)) {
do {
var data = (ColorScheme.PropertyDecsription)colorStore.GetValue (iter, 1);
var style = colorStore.GetValue (iter, 2);
data.Info.SetValue (sheme, style, null);
} while (colorStore.IterNext (ref iter));
}
}
示例8: GetChunks
public override IEnumerable<Chunk> GetChunks (ColorScheme style, DocumentLine line, int offset, int length)
{
// Multiline comment
if (line.StartSpan.Count != 0 && line.StartSpan.Peek ().Begin.Pattern == "@*")
return base.GetChunks (style, line, offset, length);
var tokenizer = new CSharpTokenizer (new SeekableTextReader (doc.GetTextAt (offset, length)));
chunks = new List<Chunk> ();
CSharpSymbol symbol;
CSharpSymbol prevSymbol = null;
int off = line.Offset;
currentState = State.None;
while ((symbol = tokenizer.NextSymbol ()) != null) {
// Apostrophes in text
bool inApostrophes = false;
if (symbol.Type == CSharpSymbolType.CharacterLiteral && prevSymbol != null && Char.IsLetterOrDigit (prevSymbol.Content.Last ())) {
if (symbol.Content.Last () == '\'')
inApostrophes = true;
else {
chunks.Add (new Chunk (off, 1, "Plain Text"));
off++;
tokenizer = new CSharpTokenizer (new SeekableTextReader (symbol.Content.Substring (1)));
symbol = tokenizer.NextSymbol ();
prevSymbol = null;
}
}
string chunkStyle = inApostrophes ? "Plain Text" : GetStyleForChunk (symbol, prevSymbol, off);
chunks.Add (new Chunk (off, symbol.Content.Length, chunkStyle));
prevSymbol = symbol;
off += symbol.Content.Length;
}
return chunks;
}
示例9: GetProvider
public static IStreamProvider GetProvider (ColorScheme style)
{
if (styleLookup.ContainsKey (style.Name))
return styleLookup[style.Name];
return null;
}
示例10: AddStyle
public static void AddStyle (ColorScheme style)
{
styles [style.Name] = style;
}
示例11: Remove
public static void Remove (ColorScheme style)
{
if (styleLookup.ContainsKey (style.Name))
styleLookup.Remove (style.Name);
foreach (var kv in styles) {
if (kv.Value == style) {
styles.Remove (kv.Key);
return;
}
}
}
示例12: ChunkParser
public ChunkParser (SyntaxMode mode, SpanParser spanParser, ColorScheme style, DocumentLine line)
{
this.mode = mode;
this.doc = mode.Document;
this.line = line;
this.lineOffset = line.Offset;
this.spanParser = spanParser;
spanParser.FoundSpanBegin = FoundSpanBegin;
spanParser.FoundSpanEnd = FoundSpanEnd;
spanParser.FoundSpanExit = FoundSpanExit;
spanParser.ParseChar += ParseChar;
spanParser.IsAtWordStart = () => wordbuilder.Length == 0;
if (line == null)
throw new ArgumentNullException ("line");
}
示例13: CreateChunkParser
public virtual ChunkParser CreateChunkParser (SpanParser spanParser, ColorScheme style, DocumentLine line)
{
return new ChunkParser (this, spanParser, style, line);
}
示例14: AddStyle
public static void AddStyle (string fileName, ColorScheme style)
{
isLoadedFromFile [style.Name] = fileName;
styles [style.Name] = style;
}
示例15: Clone
public ColorScheme Clone ()
{
var result = new ColorScheme () {
Name = this.Name,
BaseScheme = this.BaseScheme,
Originator = this.Originator,
Description = this.Description
};
result.CopyValues (this);
return result;
}