当前位置: 首页>>代码示例>>C#>>正文


C# TypeContainer.AddTypeContainer方法代码示例

本文整理汇总了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));
		}
开发者ID:runefs,项目名称:Marvin,代码行数:19,代码来源:eval.cs

示例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));
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:18,代码来源:eval.cs

示例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;
开发者ID:speier,项目名称:shake,代码行数:67,代码来源:cs-parser.cs


注:本文中的Mono.CSharp.TypeContainer.AddTypeContainer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。