本文整理汇总了C#中Mono.CSharp.TypeContainer.AddTypeContainer方法的典型用法代码示例。如果您正苦于以下问题:C# TypeContainer.AddTypeContainer方法的具体用法?C# TypeContainer.AddTypeContainer怎么用?C# TypeContainer.AddTypeContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.TypeContainer
的用法示例。
在下文中一共展示了TypeContainer.AddTypeContainer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTypeContainer
public void AddTypeContainer (TypeContainer current_container, TypeContainer tc)
{
if (current_container == tc){
Console.Error.WriteLine ("Internal error: inserting container into itself");
return;
}
if (undo_actions == null)
undo_actions = new List<Action> ();
var existing = current_container.Types.FirstOrDefault (l => l.MemberName.Basename == tc.MemberName.Basename);
if (existing != null) {
current_container.RemoveTypeContainer (existing);
existing.NamespaceEntry.SlaveDeclSpace.RemoveTypeContainer (existing);
undo_actions.Add (() => current_container.AddTypeContainer (existing));
}
undo_actions.Add (() => current_container.RemoveTypeContainer (tc));
}
示例2: AddTypeContainer
public void AddTypeContainer (TypeContainer current_container, TypeDefinition tc)
{
if (current_container == tc){
Console.Error.WriteLine ("Internal error: inserting container into itself");
return;
}
if (undo_actions == null)
undo_actions = new List<Action> ();
var existing = current_container.Containers.FirstOrDefault (l => l.Basename == tc.Basename);
if (existing != null) {
current_container.RemoveContainer (existing);
undo_actions.Add (() => current_container.AddTypeContainer (existing));
}
undo_actions.Add (() => current_container.RemoveContainer (tc));
}
示例3: yyparse
//.........这里部分代码省略.........
{
if (RootContext.Documentation != null)
enumTypeComment = Lexer.consume_doc_comment ();
}
break;
case 315:
#line 2475 "cs-parser.jay"
{
MemberName name = (MemberName) yyVals[-4+yyTop];
if (name.IsGeneric) {
Report.Error (1675, name.Location, "Enums cannot have type parameters");
}
name = MakeName (name);
Enum e = new Enum (current_namespace, current_class, (TypeExpr) yyVals[-3+yyTop], (Modifiers) yyVals[-6+yyTop],
name, (Attributes) yyVals[-7+yyTop]);
if (RootContext.Documentation != null)
e.DocComment = enumTypeComment;
EnumMember em = null;
foreach (VariableDeclaration ev in (IList<VariableDeclaration>) yyVals[-1+yyTop]) {
em = new EnumMember (
e, em, ev.identifier, ev.GetInitializer ((FullNamedExpression) yyVals[-3+yyTop]),
ev.OptAttributes, ev.Location);
/* if (RootContext.Documentation != null)*/
em.DocComment = ev.DocComment;
e.AddEnumMember (em);
}
if (RootContext.EvalMode)
undo.AddTypeContainer (current_container, e);
current_container.AddTypeContainer (e);
yyVal = e;
}
break;
case 316:
#line 2512 "cs-parser.jay"
{
yyVal = TypeManager.system_int32_expr;
}
break;
case 317:
#line 2516 "cs-parser.jay"
{
if (yyVals[0+yyTop] != TypeManager.system_int32_expr && yyVals[0+yyTop] != TypeManager.system_uint32_expr &&
yyVals[0+yyTop] != TypeManager.system_int64_expr && yyVals[0+yyTop] != TypeManager.system_uint64_expr &&
yyVals[0+yyTop] != TypeManager.system_int16_expr && yyVals[0+yyTop] != TypeManager.system_uint16_expr &&
yyVals[0+yyTop] != TypeManager.system_byte_expr && yyVals[0+yyTop] != TypeManager.system_sbyte_expr) {
Enum.Error_1008 (GetLocation (yyVals[0+yyTop]), Report);
yyVals[0+yyTop] = TypeManager.system_int32_expr;
}
yyVal = yyVals[0+yyTop];
}
break;
case 318:
#line 2528 "cs-parser.jay"
{
Error_TypeExpected (GetLocation (yyVals[-1+yyTop]));
yyVal = TypeManager.system_int32_expr;