|
|
@ -55,9 +55,12 @@ namespace ICSharpCode.ILSpy |
|
|
|
|
|
|
|
|
|
|
|
HighlightingColor methodCallColor; |
|
|
|
HighlightingColor methodCallColor; |
|
|
|
HighlightingColor methodDeclarationColor; |
|
|
|
HighlightingColor methodDeclarationColor; |
|
|
|
|
|
|
|
|
|
|
|
HighlightingColor fieldDeclarationColor; |
|
|
|
HighlightingColor fieldDeclarationColor; |
|
|
|
HighlightingColor fieldAccessColor; |
|
|
|
HighlightingColor fieldAccessColor; |
|
|
|
|
|
|
|
HighlightingColor propertyDeclarationColor; |
|
|
|
|
|
|
|
HighlightingColor propertyAccessColor; |
|
|
|
|
|
|
|
HighlightingColor eventDeclarationColor; |
|
|
|
|
|
|
|
HighlightingColor eventAccessColor; |
|
|
|
|
|
|
|
|
|
|
|
HighlightingColor valueKeywordColor; |
|
|
|
HighlightingColor valueKeywordColor; |
|
|
|
HighlightingColor thisKeywordColor; |
|
|
|
HighlightingColor thisKeywordColor; |
|
|
@ -74,39 +77,49 @@ namespace ICSharpCode.ILSpy |
|
|
|
this.locatable = locatable; |
|
|
|
this.locatable = locatable; |
|
|
|
this.textOutput = textOutput; |
|
|
|
this.textOutput = textOutput; |
|
|
|
|
|
|
|
|
|
|
|
this.visibilityKeywordsColor = highlighting.GetNamedColor("Visibility"); |
|
|
|
this.visibilityKeywordsColor = GetColor("Visibility") ?? GetColor("Keywords"); |
|
|
|
this.namespaceKeywordsColor = highlighting.GetNamedColor("NamespaceKeywords"); |
|
|
|
this.namespaceKeywordsColor = GetColor("NamespaceKeywords") ?? GetColor("Keywords"); |
|
|
|
this.structureKeywordsColor = highlighting.GetNamedColor("Keywords"); |
|
|
|
this.structureKeywordsColor = GetColor("Keywords"); |
|
|
|
this.gotoKeywordsColor = highlighting.GetNamedColor("GotoKeywords"); |
|
|
|
this.gotoKeywordsColor = GetColor("GotoKeywords") ?? GetColor("Keywords"); |
|
|
|
this.queryKeywordsColor = highlighting.GetNamedColor("QueryKeywords"); |
|
|
|
this.queryKeywordsColor = GetColor("QueryKeywords") ?? GetColor("Keywords"); |
|
|
|
this.exceptionKeywordsColor = highlighting.GetNamedColor("ExceptionKeywords"); |
|
|
|
this.exceptionKeywordsColor = GetColor("ExceptionKeywords") ?? GetColor("Keywords"); |
|
|
|
this.checkedKeywordColor = highlighting.GetNamedColor("CheckedKeyword"); |
|
|
|
this.checkedKeywordColor = GetColor("CheckedKeyword") ?? GetColor("Keywords"); |
|
|
|
this.unsafeKeywordsColor = highlighting.GetNamedColor("UnsafeKeywords"); |
|
|
|
this.unsafeKeywordsColor = GetColor("UnsafeKeywords") ?? GetColor("Keywords"); |
|
|
|
this.valueTypeKeywordsColor = highlighting.GetNamedColor("ValueTypeKeywords"); |
|
|
|
this.valueTypeKeywordsColor = GetColor("ValueTypeKeywords") ?? GetColor("Keywords"); |
|
|
|
this.referenceTypeKeywordsColor = highlighting.GetNamedColor("ReferenceTypeKeywords"); |
|
|
|
this.referenceTypeKeywordsColor = GetColor("ReferenceTypeKeywords") ?? GetColor("Keywords"); |
|
|
|
this.operatorKeywordsColor = highlighting.GetNamedColor("OperatorKeywords"); |
|
|
|
this.operatorKeywordsColor = GetColor("OperatorKeywords") ?? GetColor("Keywords"); |
|
|
|
this.parameterModifierColor = highlighting.GetNamedColor("ParameterModifiers"); |
|
|
|
this.parameterModifierColor = GetColor("ParameterModifiers") ?? GetColor("Keywords"); |
|
|
|
this.modifiersColor = highlighting.GetNamedColor("Modifiers"); |
|
|
|
this.modifiersColor = GetColor("Modifiers") ?? GetColor("Keywords"); |
|
|
|
this.accessorKeywordsColor = highlighting.GetNamedColor("GetSetAddRemove"); |
|
|
|
this.accessorKeywordsColor = GetColor("GetSetAddRemove") ?? GetColor("Keywords"); |
|
|
|
|
|
|
|
|
|
|
|
this.referenceTypeColor = highlighting.GetNamedColor("ReferenceTypes"); |
|
|
|
this.referenceTypeColor = GetColor("ReferenceTypes") ?? GetColor("Types"); |
|
|
|
this.valueTypeColor = highlighting.GetNamedColor("ValueTypes"); |
|
|
|
this.valueTypeColor = GetColor("ValueTypes") ?? GetColor("Types"); |
|
|
|
this.interfaceTypeColor = highlighting.GetNamedColor("InterfaceTypes"); |
|
|
|
this.interfaceTypeColor = GetColor("InterfaceTypes") ?? GetColor("Types"); |
|
|
|
this.enumerationTypeColor = highlighting.GetNamedColor("EnumTypes"); |
|
|
|
this.enumerationTypeColor = GetColor("EnumTypes") ?? GetColor("Types"); |
|
|
|
this.typeParameterTypeColor = highlighting.GetNamedColor("TypeParameters"); |
|
|
|
this.typeParameterTypeColor = GetColor("TypeParameters") ?? GetColor("Types"); |
|
|
|
this.delegateTypeColor = highlighting.GetNamedColor("DelegateTypes"); |
|
|
|
this.delegateTypeColor = GetColor("DelegateTypes") ?? GetColor("Types"); |
|
|
|
this.methodDeclarationColor = this.methodCallColor = highlighting.GetNamedColor("MethodCall"); |
|
|
|
this.methodDeclarationColor = GetColor("MethodDeclaration") ?? GetColor("MethodCall"); |
|
|
|
//this.eventDeclarationColor = this.eventAccessColor = defaultTextColor;
|
|
|
|
this.methodCallColor = GetColor("MethodCall") ?? GetColor("MethodDeclaration"); |
|
|
|
//this.propertyDeclarationColor = this.propertyAccessColor = defaultTextColor;
|
|
|
|
this.fieldDeclarationColor = GetColor("FieldDeclaration") ?? GetColor("FieldAccess"); |
|
|
|
this.fieldDeclarationColor = this.fieldAccessColor = highlighting.GetNamedColor("FieldAccess"); |
|
|
|
this.fieldAccessColor = GetColor("FieldAccess") ?? GetColor("FieldDeclaration"); |
|
|
|
|
|
|
|
this.propertyDeclarationColor = GetColor("PropertyDeclaration") ?? GetColor("PropertyAccess"); |
|
|
|
|
|
|
|
this.propertyAccessColor = GetColor("PropertyAccess") ?? GetColor("PropertyDeclaration"); |
|
|
|
|
|
|
|
this.eventDeclarationColor = GetColor("EventDeclaration") ?? GetColor("EventAccess"); |
|
|
|
|
|
|
|
this.eventAccessColor = GetColor("EventAccess") ?? GetColor("EventDeclaration"); |
|
|
|
//this.variableDeclarationColor = this.variableAccessColor = defaultTextColor;
|
|
|
|
//this.variableDeclarationColor = this.variableAccessColor = defaultTextColor;
|
|
|
|
//this.parameterDeclarationColor = this.parameterAccessColor = defaultTextColor;
|
|
|
|
//this.parameterDeclarationColor = this.parameterAccessColor = defaultTextColor;
|
|
|
|
this.valueKeywordColor = highlighting.GetNamedColor("NullOrValueKeywords"); |
|
|
|
this.valueKeywordColor = GetColor("NullOrValueKeywords") ?? GetColor("Keywords"); |
|
|
|
this.thisKeywordColor = highlighting.GetNamedColor("ThisOrBaseReference"); |
|
|
|
this.thisKeywordColor = GetColor("ThisOrBaseReference") ?? GetColor("Keywords"); |
|
|
|
this.trueKeywordColor = highlighting.GetNamedColor("TrueFalse"); |
|
|
|
this.trueKeywordColor = GetColor("TrueFalse") ?? GetColor("Keywords"); |
|
|
|
this.typeKeywordsColor = highlighting.GetNamedColor("TypeKeywords"); |
|
|
|
this.typeKeywordsColor = GetColor("TypeKeywords") ?? GetColor("Keywords"); |
|
|
|
this.attributeKeywordsColor = highlighting.GetNamedColor("AttributeKeywords"); |
|
|
|
this.attributeKeywordsColor = GetColor("AttributeKeywords") ?? GetColor("Keywords"); |
|
|
|
//this.externAliasKeywordColor = ...;
|
|
|
|
//this.externAliasKeywordColor = ...;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HighlightingColor GetColor(string colorName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var color = highlighting.GetNamedColor(colorName); |
|
|
|
|
|
|
|
return color is not { Foreground: null, Background: null, FontFamily: null, FontWeight: null, FontSize: null, FontStyle: null, Strikethrough: null, Underline: null } ? color : null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override void WriteKeyword(Role role, string keyword) |
|
|
|
public override void WriteKeyword(Role role, string keyword) |
|
|
@ -380,12 +393,18 @@ namespace ICSharpCode.ILSpy |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case IMethod m: |
|
|
|
case IMethod: |
|
|
|
color = methodDeclarationColor; |
|
|
|
color = methodDeclarationColor; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case IField f: |
|
|
|
case IField: |
|
|
|
color = fieldDeclarationColor; |
|
|
|
color = fieldDeclarationColor; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case IProperty: |
|
|
|
|
|
|
|
color = propertyDeclarationColor; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case IEvent: |
|
|
|
|
|
|
|
color = eventDeclarationColor; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
switch (GetCurrentMemberReference()) |
|
|
|
switch (GetCurrentMemberReference()) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -409,12 +428,18 @@ namespace ICSharpCode.ILSpy |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case IMethod m: |
|
|
|
case IMethod: |
|
|
|
color = methodCallColor; |
|
|
|
color = methodCallColor; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case IField f: |
|
|
|
case IField: |
|
|
|
color = fieldAccessColor; |
|
|
|
color = fieldAccessColor; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case IProperty: |
|
|
|
|
|
|
|
color = propertyAccessColor; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case IEvent: |
|
|
|
|
|
|
|
color = eventAccessColor; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (color != null) |
|
|
|
if (color != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|