本文整理匯總了C#中Mono.CSharp.TypeContainer.AddEvent方法的典型用法代碼示例。如果您正苦於以下問題:C# TypeContainer.AddEvent方法的具體用法?C# TypeContainer.AddEvent怎麽用?C# TypeContainer.AddEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.CSharp.TypeContainer
的用法示例。
在下文中一共展示了TypeContainer.AddEvent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: yyparse
//.........這裏部分代碼省略.........
Report.Error (575, lt.Location, "Only class types can contain destructor");
} else {
Destructor d = new Destructor (current_class, (Modifiers) yyVals[-6+yyTop],
ParametersCompiled.EmptyReadOnlyParameters, (Attributes) yyVals[-7+yyTop], lt.Location);
if (RootContext.Documentation != null)
d.DocComment = ConsumeStoredComment ();
d.Block = (ToplevelBlock) yyVals[0+yyTop];
current_container.AddMethod (d);
}
current_local_parameters = null;
}
break;
case 291:
#line 2248 "cs-parser.jay"
{
foreach (VariableMemberDeclaration var in (List<object>) yyVals[-1+yyTop]) {
EventField e = new EventField (
current_class, (FullNamedExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-4+yyTop], var.MemberName, (Attributes) yyVals[-5+yyTop]);
e.Initializer = var.GetInitializer ((FullNamedExpression) yyVals[-2+yyTop]);
if (current_container.Kind == MemberKind.Interface && e.Initializer != null) {
Report.Error (68, e.Location, "`{0}': event in interface cannot have initializer", e.GetSignatureForError ());
}
if (var.MemberName.Left != null) {
Report.Error (71, e.Location,
"`{0}': An explicit interface implementation of an event must use property syntax",
e.GetSignatureForError ());
}
current_container.AddEvent (e);
if (RootContext.Documentation != null) {
e.DocComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
}
}
break;
case 292:
#line 2277 "cs-parser.jay"
{
implicit_value_parameter_type = (FullNamedExpression) yyVals[-2+yyTop];
current_local_parameters = new ParametersCompiled (compiler,
new Parameter (implicit_value_parameter_type, "value",
Parameter.Modifier.NONE, null, GetLocation (yyVals[-3+yyTop])));
lexer.EventParsing = true;
}
break;
case 293:
#line 2286 "cs-parser.jay"
{
lexer.EventParsing = false;
}
break;
case 294:
#line 2290 "cs-parser.jay"
{
MemberName name = (MemberName) yyVals[-5+yyTop];
if (current_container.Kind == MemberKind.Interface) {
Report.Error (69, GetLocation (yyVals[-7+yyTop]), "Event in interface cannot have add or remove accessors");