//
        // Creates a nested container in this context for all dynamic compiler generated stuff
        //
        public DynamicSiteClass CreateDynamicSite()
        {
            if (dynamic_site_container == null)
            {
                var mc = MemberContext.CurrentMemberDefinition as MemberBase;
                dynamic_site_container = new DynamicSiteClass(CurrentTypeDefinition.Parent.PartialContainer, mc, CurrentTypeParameters);

                CurrentTypeDefinition.Module.AddCompilerGeneratedClass(dynamic_site_container);
                dynamic_site_container.CreateType();
                dynamic_site_container.DefineType();
                dynamic_site_container.ResolveTypeParameters();
                dynamic_site_container.Define();
            }

            return(dynamic_site_container);
        }
Пример #2
0
        //
        // Creates a nested container in this context for all dynamic compiler generated stuff
        //
        internal DynamicSiteClass CreateDynamicSite()
        {
            if (dynamic_site_container == null)
            {
                var mc = member_context.CurrentMemberDefinition as MemberBase;
                dynamic_site_container = new DynamicSiteClass(CurrentTypeDefinition.Parent.PartialContainer, mc, CurrentTypeParameters);

                CurrentTypeDefinition.Module.AddCompilerGeneratedClass(dynamic_site_container);
                dynamic_site_container.CreateType();
                dynamic_site_container.DefineType();
                dynamic_site_container.ResolveTypeParameters();
                dynamic_site_container.Define();

                var inflator = new TypeParameterInflator(Module, CurrentType, TypeParameterSpec.EmptyTypes, TypeSpec.EmptyTypes);
                var inflated = dynamic_site_container.CurrentType.InflateMember(inflator);
                CurrentType.MemberCache.AddMember(inflated);
            }

            return(dynamic_site_container);
        }
Пример #3
0
		//
		// Creates a nested container in this context for all dynamic compiler generated stuff
		//
		public DynamicSiteClass CreateDynamicSite ()
		{
			if (dynamic_site_container == null) {
				var mc = MemberContext.CurrentMemberDefinition as MemberBase;
				dynamic_site_container = new DynamicSiteClass (CurrentTypeDefinition.Parent.PartialContainer, mc, CurrentTypeParameters);

				CurrentTypeDefinition.Module.AddCompilerGeneratedClass (dynamic_site_container);
				dynamic_site_container.CreateType ();
				dynamic_site_container.DefineType ();
				dynamic_site_container.ResolveTypeParameters ();
				dynamic_site_container.Define ();
			}

			return dynamic_site_container;
		}
Пример #4
0
		//
		// Creates a nested container in this context for all dynamic compiler generated stuff
		//
		internal DynamicSiteClass CreateDynamicSite ()
		{
			if (dynamic_site_container == null) {
				var mc = member_context.CurrentMemberDefinition as MemberBase;
				dynamic_site_container = new DynamicSiteClass (CurrentTypeDefinition.Parent.PartialContainer, mc, CurrentTypeParameters);

				CurrentTypeDefinition.Module.AddCompilerGeneratedClass (dynamic_site_container);
				dynamic_site_container.CreateType ();
				dynamic_site_container.DefineType ();
				dynamic_site_container.ResolveTypeParameters ();
				dynamic_site_container.Define ();

				var inflator = new TypeParameterInflator (Module, CurrentType, TypeParameterSpec.EmptyTypes, TypeSpec.EmptyTypes);
				var inflated = dynamic_site_container.CurrentType.InflateMember (inflator);
				CurrentType.MemberCache.AddMember (inflated);
			}

			return dynamic_site_container;
		}