|
|
|
@ -721,8 +721,19 @@ namespace ICSharpCode.Decompiler.Ast
@@ -721,8 +721,19 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
return astProp; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CustomEventDeclaration CreateEvent(EventDefinition eventDef) |
|
|
|
|
AttributedNode CreateEvent(EventDefinition eventDef) |
|
|
|
|
{ |
|
|
|
|
if (eventDef.AddMethod != null && eventDef.AddMethod.IsAbstract) { |
|
|
|
|
// An abstract event cannot be custom
|
|
|
|
|
EventDeclaration astEvent = new EventDeclaration(); |
|
|
|
|
ConvertCustomAttributes(astEvent, eventDef); |
|
|
|
|
astEvent.AddAnnotation(eventDef); |
|
|
|
|
astEvent.Variables.Add(new VariableInitializer(CleanName(eventDef.Name))); |
|
|
|
|
astEvent.ReturnType = ConvertType(eventDef.EventType, eventDef); |
|
|
|
|
if (!eventDef.DeclaringType.IsInterface) |
|
|
|
|
astEvent.Modifiers = ConvertModifiers(eventDef.AddMethod); |
|
|
|
|
return astEvent; |
|
|
|
|
} else { |
|
|
|
|
CustomEventDeclaration astEvent = new CustomEventDeclaration(); |
|
|
|
|
ConvertCustomAttributes(astEvent, eventDef); |
|
|
|
|
astEvent.AddAnnotation(eventDef); |
|
|
|
@ -746,6 +757,7 @@ namespace ICSharpCode.Decompiler.Ast
@@ -746,6 +757,7 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
} |
|
|
|
|
return astEvent; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FieldDeclaration CreateField(FieldDefinition fieldDef) |
|
|
|
|
{ |
|
|
|
|