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


C# IType.AcceptVisitor方法代码示例

本文整理汇总了C#中IType.AcceptVisitor方法的典型用法代码示例。如果您正苦于以下问题:C# IType.AcceptVisitor方法的具体用法?C# IType.AcceptVisitor怎么用?C# IType.AcceptVisitor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IType的用法示例。


在下文中一共展示了IType.AcceptVisitor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Compile

        public static MethodBuilder Compile(IType functorType, string variableName, 
            TypeBuilder utilityClass, string[] genericParameters, IRuntimeContainer runtimeContainer)
        {
            var genericParameterNames = new[]
            {
                Constants.FMapMethodInputParameterName,
                Constants.FMapMethodOutputParameterName
            }.Concat(genericParameters).ToArray();

            var fmap = utilityClass.DefineMethod(Constants.FMapMethodName, MethodAttributes.Public | MethodAttributes.Static);
            var fmapParameters = fmap.DefineGenericParameters(genericParameterNames);

            fmap.SetReturnType(typeof(IFunction<,>).MakeGenericType(fmapParameters.Take(2).Select(t => FunctorTypeMapper.Map(functorType, variableName, t, fmapParameters, runtimeContainer)).ToArray()));

            fmap.SetParameters(typeof(IFunction<,>).MakeGenericType(fmapParameters.Take(2).ToArray()));

            var fmapBody = fmap.GetILGenerator();

            functorType.AcceptVisitor(new FmapCompiler(fmapBody, variableName, fmapParameters, runtimeContainer));

            fmapBody.Emit(OpCodes.Ret);

            return fmap;
        }
开发者ID:paf31,项目名称:Purity,代码行数:24,代码来源:FunctorMethods.cs

示例2: GetTypeParameterOwner

 /// <summary>
 /// Gets the entity that owns the type parameters occurring in the specified type.
 /// If both class and method type parameters are present, the method is returned.
 /// Returns null if the specified type is closed.
 /// </summary>
 /// <seealso cref="IsOpen"/>
 static IEntity GetTypeParameterOwner(IType type)
 {
     if (type == null)
         throw new ArgumentNullException("type");
     TypeClassificationVisitor v = new TypeClassificationVisitor();
     type.AcceptVisitor(v);
     return v.typeParameterOwner;
 }
开发者ID:segaman,项目名称:NRefactory,代码行数:14,代码来源:TypeSystemExtensions.cs

示例3: AddRelationshipsForType

		void AddRelationshipsForType(NodeBase node, IType type)
		{
			type.AcceptVisitor(new AnalysisTypeVisitor(this, node));
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:4,代码来源:AssemblyAnalyzer.cs

示例4: SubstituteInType

		/// <summary>
		/// Substitutes the class type parameters in the <paramref name="type"/> with the
		/// type arguments of this parameterized type.
		/// </summary>
		public IType SubstituteInType(IType type)
		{
			return type.AcceptVisitor(new TypeParameterSubstitution(typeArguments, null));
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:8,代码来源:ParameterizedType.cs

示例5: Substitute

 internal static IType Substitute(IType type, TypeVisitor substitution)
 {
     if (substitution == null)
         return type;
     else
         return type.AcceptVisitor(substitution);
 }
开发者ID:tapenjoyGame,项目名称:ILSpy,代码行数:7,代码来源:SpecializedMember.cs

示例6: NormalizeMethodTypeParameters

		/// <summary>
		/// Replaces all occurrences of method type parameters in the given type
		/// by normalized type parameters. This allows comparing parameter types from different
		/// generic methods.
		/// </summary>
		public static IType NormalizeMethodTypeParameters(IType type)
		{
			return type.AcceptVisitor(normalizeMethodTypeParameters);
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:9,代码来源:DummyTypeParameter.cs

示例7: VisitOtherType

			public override IType VisitOtherType(IType type)
			{
				return NullableType.Create(compilation, type.AcceptVisitor(typeParameterSubstitution));
			}
开发者ID:erik-kallen,项目名称:NRefactory,代码行数:4,代码来源:CSharpResolver.cs

示例8: SubstituteInType

 /// <summary>
 /// Substitutes the class type parameters in the <paramref name="type"/> with the
 /// type arguments of this parameterized type.
 /// </summary>
 public IType SubstituteInType(IType type)
 {
     return type.AcceptVisitor(new Substitution(typeArguments));
 }
开发者ID:richardschneider,项目名称:ILSpy,代码行数:8,代码来源:ParameterizedType.cs

示例9: IdentityConversion

		/// <summary>
		/// Gets whether there is an identity conversion from <paramref name="fromType"/> to <paramref name="toType"/>
		/// </summary>
		public bool IdentityConversion(IType fromType, IType toType)
		{
			// C# 4.0 spec: §6.1.1
			return fromType.AcceptVisitor(dynamicErasure).Equals(toType.AcceptVisitor(dynamicErasure));
		}
开发者ID:constructor-igor,项目名称:cudafy,代码行数:8,代码来源:Conversions.cs


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