本文整理汇总了C#中Boo.Lang.Compiler.Ast.Event类的典型用法代码示例。如果您正苦于以下问题:C# Event类的具体用法?C# Event怎么用?C# Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Event类属于Boo.Lang.Compiler.Ast命名空间,在下文中一共展示了Event类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LeaveEvent
public override void LeaveEvent(Event node)
{
if (IsInterfaceMember(node))
node.Modifiers = TypeMemberModifiers.Public | TypeMemberModifiers.Abstract;
else if (!node.IsVisibilitySet)
node.Modifiers |= Context.Parameters.DefaultEventVisibility;
LeaveMember(node);
}
示例2: LeaveEvent
public override void LeaveEvent(Event node)
{
if (!node.IsVisibilitySet)
{
node.Modifiers |= TypeMemberModifiers.Public;
}
if (IsInterface(node.DeclaringType))
{
node.Modifiers |= TypeMemberModifiers.Abstract;
}
LeaveMember(node);
}
示例3: BindEvent
void BindEvent(Event node)
{
EnsureEntityFor(node);
IType type = GetType(node.Type);
IType declaringType = GetType(node.DeclaringType);
bool typeIsCallable = type is ICallableType;
if (!typeIsCallable)
{
Errors.Add(
CompilerErrorFactory.EventTypeIsNotCallable(node.Type,
type.ToString()));
}
if (declaringType.IsInterface)
{
BindInterfaceEvent(node);
}
else
{
BindClassEvent(node, type, typeIsCallable);
}
}
示例4: LeaveEvent
public override void LeaveEvent(Event node)
{
CheckName(node,node.Name);
}
示例5: event_declaration
protected void event_declaration(
TypeMemberCollection container
) //throws RecognitionException, TokenStreamException
{
IToken t = null;
IToken id = null;
Event e = null;
TypeReference tr = null;
try { // for error handling
t = LT(1);
match(EVENT);
id = LT(1);
match(ID);
match(AS);
tr=type_reference();
eos();
if (0==inputState.guessing)
{
e = new Event(ToLexicalInfo(id), id.getText(), tr);
e.Modifiers = _modifiers;
AddAttributes(e.Attributes);
container.Add(e);
}
docstring(e);
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex, "event_declaration");
recover(ex,tokenSet_55_);
}
else
{
throw ex;
}
}
}
示例6: OnEvent
public override void OnEvent(Event node)
{
_emitter.EmitEventAttributes(node);
}
示例7: DefineEvent
void DefineEvent(TypeBuilder typeBuilder, Event node)
{
EventBuilder builder = typeBuilder.DefineEvent(node.Name,
EventAttributes.None,
GetSystemType(node.Type));
//MethodAttributes attribs = GetPropertyMethodAttributes(node);
MethodAttributes baseAttributes = MethodAttributes.SpecialName;
builder.SetAddOnMethod(DefineMethod(typeBuilder, node.Add, baseAttributes|GetMethodAttributes(node.Add)));
builder.SetRemoveOnMethod(DefineMethod(typeBuilder, node.Remove, baseAttributes|GetMethodAttributes(node.Remove)));
if (null != node.Raise)
{
builder.SetRaiseMethod(DefineMethod(typeBuilder, node.Raise, baseAttributes|GetMethodAttributes(node.Raise)));
}
SetBuilder(node, builder);
}
示例8: LeaveEvent
public override void LeaveEvent(Event node)
{
LeaveMember(node);
}
示例9: CreateInterfaceEventRemoveMethod
Method CreateInterfaceEventRemoveMethod(Event node)
{
return CreateInterfaceEventMethod(node, "remove_");
}
示例10: DefineEvent
void DefineEvent(TypeBuilder typeBuilder, Event node)
{
var builder = typeBuilder.DefineEvent(node.Name, EventAttributes.None, GetSystemType(node.Type));
builder.SetAddOnMethod(DefineEventMethod(typeBuilder, node.Add));
builder.SetRemoveOnMethod(DefineEventMethod(typeBuilder, node.Remove));
if (node.Raise != null)
builder.SetRaiseMethod(DefineEventMethod(typeBuilder, node.Raise));
SetBuilder(node, builder);
}
示例11: EmitEventAttributes
void EmitEventAttributes(Event node, TypeCreator knownTypes)
{
EventBuilder builder = (EventBuilder)GetBuilder(node);
EmitAttributes(node, builder.SetCustomAttribute, knownTypes);
}
示例12: OnEvent
public override void OnEvent(Event node)
{
_emitter.EmitEventAttributes(node, this._knownTypes);
}
示例13: InternalEvent
public InternalEvent(TypeSystemServices tagManager, Event event_)
{
_event = event_;
}
示例14: VisitEventDeclaration
public object VisitEventDeclaration(EventDeclaration eventDeclaration, object data)
{
B.Event m = new B.Event(GetLexicalInfo(eventDeclaration));
m.Name = eventDeclaration.Name;
m.Modifiers = ConvertModifier(eventDeclaration, B.TypeMemberModifiers.Private);
ConvertAttributes(eventDeclaration.Attributes, m.Attributes);
if (currentType != null) currentType.Members.Add(m);
m.EndSourceLocation = GetLocation(eventDeclaration.EndLocation);
m.Type = ConvertTypeReference(eventDeclaration.TypeReference);
if (eventDeclaration.InterfaceImplementations.Count > 0) {
AddError(eventDeclaration, "Explicit interface implementation is not supported for events.");
}
if (eventDeclaration.Parameters.Count > 0) {
AddError(eventDeclaration, "Events with parameters are not supported.");
}
if (eventDeclaration.HasAddRegion) {
m.Add = new B.Method(GetLexicalInfo(eventDeclaration.AddRegion));
ConvertAttributes(eventDeclaration.AddRegion.Attributes, m.Add.Attributes);
m.Modifiers = ConvertModifier(eventDeclaration.AddRegion, m.Visibility);
m.Add.Body = ConvertMethodBlock(eventDeclaration.AddRegion.Block);
}
if (eventDeclaration.HasRemoveRegion) {
m.Remove = new B.Method(GetLexicalInfo(eventDeclaration.RemoveRegion));
ConvertAttributes(eventDeclaration.RemoveRegion.Attributes, m.Remove.Attributes);
m.Modifiers = ConvertModifier(eventDeclaration.RemoveRegion, m.Visibility);
m.Remove.Body = ConvertMethodBlock(eventDeclaration.RemoveRegion.Block);
}
if (eventDeclaration.HasRaiseRegion) {
m.Raise = new B.Method(GetLexicalInfo(eventDeclaration.RaiseRegion));
ConvertAttributes(eventDeclaration.RaiseRegion.Attributes, m.Raise.Attributes);
m.Modifiers = ConvertModifier(eventDeclaration.RaiseRegion, m.Visibility);
m.Raise.Body = ConvertMethodBlock(eventDeclaration.RaiseRegion.Block);
}
return m;
}
示例15: BindInterfaceEvent
private void BindInterfaceEvent(Event node)
{
if (null == node.Add)
node.Add = CreateInterfaceEventAddMethod(node);
if (null == node.Remove)
node.Remove = CreateInterfaceEventRemoveMethod(node);
}