本文整理匯總了C#中Mono.CSharp.TypeContainer.AddProperty方法的典型用法代碼示例。如果您正苦於以下問題:C# TypeContainer.AddProperty方法的具體用法?C# TypeContainer.AddProperty怎麽用?C# TypeContainer.AddProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.CSharp.TypeContainer
的用法示例。
在下文中一共展示了TypeContainer.AddProperty方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: yyparse
//.........這裏部分代碼省略.........
lexer.PropertyParsing = false;
has_get = has_set = false;
}
break;
case 206:
#line 1707 "cs-parser.jay"
{
Property prop;
Accessors accessors = (Accessors) yyVals[-2+yyTop];
Accessor get_block = accessors != null ? accessors.get_or_add : null;
Accessor set_block = accessors != null ? accessors.set_or_remove : null;
bool order = accessors != null ? accessors.declared_in_reverse : false;
MemberName name = (MemberName) yyVals[-6+yyTop];
FullNamedExpression ptype = (FullNamedExpression) yyVals[-7+yyTop];
prop = new Property (current_class, ptype, (Modifiers) yyVals[-8+yyTop],
name, (Attributes) yyVals[-9+yyTop], get_block, set_block, order, current_block);
if (ptype == TypeManager.system_void_expr)
Report.Error (547, name.Location, "`{0}': property or indexer cannot have void type", prop.GetSignatureForError ());
if (accessors == null)
Report.Error (548, prop.Location, "`{0}': property or indexer must have at least one accessor", prop.GetSignatureForError ());
if (current_container.Kind == MemberKind.Interface) {
if (prop.Get.Block != null)
Report.Error (531, prop.Location, "`{0}.get': interface members cannot have a definition", prop.GetSignatureForError ());
if (prop.Set.Block != null)
Report.Error (531, prop.Location, "`{0}.set': interface members cannot have a definition", prop.GetSignatureForError ());
}
current_container.AddProperty (prop);
implicit_value_parameter_type = null;
if (RootContext.Documentation != null)
prop.DocComment = ConsumeStoredComment ();
}
break;
case 207:
#line 1745 "cs-parser.jay"
{
yyVal = new Accessors ((Accessor) yyVals[0+yyTop], null);
}
break;
case 208:
#line 1749 "cs-parser.jay"
{
Accessors accessors = (Accessors) yyVals[0+yyTop];
accessors.get_or_add = (Accessor) yyVals[-1+yyTop];
yyVal = accessors;
}
break;
case 209:
#line 1755 "cs-parser.jay"
{
yyVal = new Accessors (null, (Accessor) yyVals[0+yyTop]);
}
break;
case 210:
#line 1759 "cs-parser.jay"
{
Accessors accessors = (Accessors) yyVals[0+yyTop];
accessors.set_or_remove = (Accessor) yyVals[-1+yyTop];