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


C# CSharp.TypeContainer类代码示例

本文整理汇总了C#中Mono.CSharp.TypeContainer的典型用法代码示例。如果您正苦于以下问题:C# TypeContainer类的具体用法?C# TypeContainer怎么用?C# TypeContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TypeContainer类属于Mono.CSharp命名空间,在下文中一共展示了TypeContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HoistedStoreyClass

		public HoistedStoreyClass (TypeContainer parent, MemberName name, TypeParameter[] tparams, Modifiers mod)
			: base (parent, name, mod | Modifiers.PRIVATE)
		{
			if (tparams != null) {
				type_params = new TypeParameter[tparams.Length];
				var src = new TypeParameterSpec[tparams.Length];
				var dst = new TypeParameterSpec[tparams.Length];

				for (int i = 0; i < type_params.Length; ++i) {
					type_params[i] = tparams[i].CreateHoistedCopy (this, spec);

					src[i] = tparams[i].Type;
					dst[i] = type_params[i].Type;
				}

				// A copy is not enough, inflate any type parameter constraints
				// using a new type parameters
				var inflator = new TypeParameterInflator (this, null, src, dst);
				for (int i = 0; i < type_params.Length; ++i) {
					src[i].InflateConstraints (inflator, dst[i]);
				}

				mutator = new TypeParameterMutator (tparams, type_params);
			}
		}
开发者ID:nzaugg,项目名称:mono,代码行数:25,代码来源:anonymous.cs

示例2: PendingImplementation

        PendingImplementation(TypeContainer container, MissingInterfacesInfo[] missing_ifaces, IList<MethodSpec> abstract_methods, int total)
        {
            var type_builder = container.Definition;

            this.container = container;
            pending_implementations = new TypeAndMethods [total];

            int i = 0;
            if (abstract_methods != null) {
                int count = abstract_methods.Count;
                pending_implementations [i].methods = new MethodSpec [count];
                pending_implementations [i].need_proxy = new MethodSpec [count];

                pending_implementations [i].methods = abstract_methods;
                pending_implementations [i].found = new MethodData [count];
                pending_implementations [i].type = type_builder;
                ++i;
            }

            foreach (MissingInterfacesInfo missing in missing_ifaces) {
                var iface = missing.Type;
                var mi = MemberCache.GetInterfaceMembers (iface);

                int count = mi.Count;
                pending_implementations [i].type = iface;
                pending_implementations [i].optional = missing.Optional;
                pending_implementations [i].methods = mi;
                pending_implementations [i].found = new MethodData [count];
                pending_implementations [i].need_proxy = new MethodSpec [count];
                i++;
            }
        }
开发者ID:speier,项目名称:shake,代码行数:32,代码来源:pending.cs

示例3: Class

 public Class(TypeContainer parent, MemberName name, Modifiers mod, Attributes attrs)
     : base(parent, name, attrs, MemberKind.Class)
 {
     var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
     this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
     spec = new TypeSpec (Kind, null, this, null, ModFlags);
 }
开发者ID:JoeSGeorge,项目名称:NRefactory,代码行数:7,代码来源:class.cs

示例4: Enum

 public Enum(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)
     : base(parent, name, attrs, MemberKind.Enum)
 {
     underlying_type_expr = type;
     var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
     ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);
     spec = new EnumSpec (null, this, null, null, ModFlags);
 }
开发者ID:segaman,项目名称:NRefactory,代码行数:8,代码来源:enum.cs

示例5: CompilerGeneratedContainer

		protected CompilerGeneratedContainer (TypeContainer parent, MemberName name, Modifiers mod, MemberKind kind)
			: base (parent, name, null, kind)
		{
			Debug.Assert ((mod & Modifiers.AccessibilityMask) != 0);

			ModFlags = mod | Modifiers.COMPILER_GENERATED | Modifiers.SEALED;
			spec = new TypeSpec (Kind, null, this, null, ModFlags);
		}
开发者ID:rabink,项目名称:mono,代码行数:8,代码来源:anonymous.cs

示例6: Iterator

 //
 // Our constructor
 //
 public Iterator(ParametersBlock block, IMethodData method, TypeContainer host, TypeSpec iterator_type, bool is_enumerable)
     : base(block, TypeManager.bool_type, block.StartLocation)
 {
     this.OriginalMethod = method;
     this.OriginalIteratorType = iterator_type;
     this.IsEnumerable = is_enumerable;
     this.Host = host;
     this.type = method.ReturnType;
 }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:12,代码来源:iterators.cs

示例7: TypeContainer

		public TypeContainer (TypeContainer parent, MemberName name, Attributes attrs, MemberKind kind)
			: base (parent, name, attrs)
		{
			this.Kind = kind;
			if (name != null)
				this.Basename = name.Basename;

			defined_names = new Dictionary<string, MemberCore> ();
		}
开发者ID:fvalette,项目名称:mono,代码行数:9,代码来源:class.cs

示例8: Delegate

        public Delegate(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, ParametersCompiled param_list,
				 Attributes attrs)
            : base(parent, name, attrs, MemberKind.Delegate)
        {
            this.ReturnType = type;
            ModFlags        = ModifiersExtensions.Check (AllowedModifiers, mod_flags,
                               IsTopLevel ? Modifiers.INTERNAL :
                               Modifiers.PRIVATE, name.Location, Report);
            parameters      = param_list;
            spec = new TypeSpec (Kind, null, this, null, ModFlags | Modifiers.SEALED);
        }
开发者ID:svermeulen,项目名称:NRefactory,代码行数:11,代码来源:delegate.cs

示例9: Iterator

        //
        // Our constructor
        //
        private Iterator(CompilerContext ctx, IMethodData method, TypeContainer host, TypeSpec iterator_type, bool is_enumerable)
            : base(new ToplevelBlock (ctx, method.Block, ParametersCompiled.EmptyReadOnlyParameters, method.Block.StartLocation),
				TypeManager.bool_type,
				method.Location)
        {
            this.OriginalMethod = method;
            this.OriginalIteratorType = iterator_type;
            this.IsEnumerable = is_enumerable;
            this.Host = host;
            this.type = method.ReturnType;

            IteratorHost = Block.ChangeToIterator (this, method.Block);
        }
开发者ID:speier,项目名称:shake,代码行数:16,代码来源:iterators.cs

示例10: GenerateTypeDocComment

		// TypeContainer

		//
		// Generates xml doc comments (if any), and if required,
		// handle warning report.
		//
		internal static void GenerateTypeDocComment (TypeContainer t,
			DeclSpace ds, Report Report)
		{
			GenerateDocComment (t, ds, Report);

			if (t.DefaultStaticConstructor != null)
				t.DefaultStaticConstructor.GenerateDocComment (t);

			if (t.InstanceConstructors != null)
				foreach (Constructor c in t.InstanceConstructors)
					c.GenerateDocComment (t);

			if (t.Types != null)
				foreach (TypeContainer tc in t.Types)
					tc.GenerateDocComment (t);

			if (t.Delegates != null)
				foreach (Delegate de in t.Delegates)
					de.GenerateDocComment (t);

			if (t.Constants != null)
				foreach (Const c in t.Constants)
					c.GenerateDocComment (t);

			if (t.Fields != null)
				foreach (FieldBase f in t.Fields)
					f.GenerateDocComment (t);

			if (t.Events != null)
				foreach (Event e in t.Events)
					e.GenerateDocComment (t);

			if (t.Indexers != null)
				foreach (Indexer ix in t.Indexers)
					ix.GenerateDocComment (t);

			if (t.Properties != null)
				foreach (Property p in t.Properties)
					p.GenerateDocComment (t);

			if (t.Methods != null)
				foreach (MethodOrOperator m in t.Methods)
					m.GenerateDocComment (t);

			if (t.Operators != null)
				foreach (Operator o in t.Operators)
					o.GenerateDocComment (t);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:54,代码来源:doc.cs

示例11: FindDynamicClasses

		public static void FindDynamicClasses(TypeContainer container, List<Class> classes) 
		{
			foreach (var cont in container.Containers) {
				if (cont is Class) {

					// Is class marked as dynamic?
					var cl = cont as Class;
					if (cl.IsAsDynamicClass && !(cl.BaseType != null && cl.BaseType.IsAsDynamicClass)) {
						classes.Add ((Class)cont);
					}
				}

				// Recursively find more classes
				if (cont.Containers != null)
					FindDynamicClasses(cont, classes);
			}
		}
开发者ID:rlfqudxo,项目名称:playscript-mono,代码行数:17,代码来源:ps-codegen.cs

示例12: RemoveContainer

		public virtual void RemoveContainer (TypeContainer cont)
		{
			if (containers != null)
				containers.Remove (cont);

			var tc = Parent == Module ? Module : this;
			tc.defined_names.Remove (cont.Basename);
		}
开发者ID:fvalette,项目名称:mono,代码行数:8,代码来源:class.cs

示例13: BaseContext

			public BaseContext (TypeContainer tc)
			{
				this.tc = tc;
			}
开发者ID:fvalette,项目名称:mono,代码行数:4,代码来源:class.cs

示例14: AddTypeContainer

		public virtual void AddTypeContainer (TypeContainer tc)
		{
			containers.Add (tc);

			var tparams = tc.MemberName.TypeParameters;
			if (tparams != null && tc.PartialContainer != null) {
				var td = (TypeDefinition) tc;
				for (int i = 0; i < tparams.Count; ++i) {
					var tp = tparams[i];
					if (tp.MemberName == null)
						continue;

					td.AddNameToContainer (tp, tp.Name);
				}
			}
		}
开发者ID:fvalette,项目名称:mono,代码行数:16,代码来源:class.cs

示例15: ClassOrStruct

		public ClassOrStruct (TypeContainer parent, MemberName name, Attributes attrs, MemberKind kind)
			: base (parent, name, attrs, kind)
		{
		}
开发者ID:fvalette,项目名称:mono,代码行数:4,代码来源:class.cs


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