public void AddAdditionalMembers(TypeDefinition host)
 {
     // Make sure the type implements IActivatorHost
     var interfaceWeaver = new ImplementActivatorHostWeaver();
     host.Accept(interfaceWeaver);
 }
        /// <summary>
        /// Write a type signature to the text buffer
        /// </summary>
        /// <param name="tdef">Type definition</param>
        protected override void WriteTypeSignature(TypeDefinition tdef)
        {
            tdef.Accept(this);

            if (tdef.GenericParameters.Count > 0)
            {
                foreach (GenericParameter genparam in tdef.GenericParameters)
                {
                    if (genparam.Constraints.Count > 0)
                    {
                        Write(ECSharpKeyword.@where, ESpaceSurrounder.Both);
                        genparam.Accept(this);
                        VisitVisitableCollection(GENERIC_CONSTRAINT_LIST_START, String.Empty, BASIC_SEPARATOR, false, genparam.Constraints);
                    }
                }
                Replace(GENERIC_TYPE_TAG + tdef.GenericParameters.Count, String.Empty);
            }
        }
        /// <summary>
        /// Write a type signature to the text buffer
        /// </summary>
        /// <param name="tdef">Type definition</param>
        protected override void WriteTypeSignature(TypeDefinition tdef)
        {
            tdef.Accept(this);

	        if (tdef.GenericParameters.Count <= 0) 
				return;
	        
			foreach (var genparam in tdef.GenericParameters.Where(genparam => genparam.Constraints.Count > 0))
			{
				Write(ECSharpKeyword.@where, ESpaceSurrounder.Both);
				genparam.Accept(this);
				VisitVisitableCollection(GenericConstraintListStart, String.Empty, BasicSeparator, false, genparam.Constraints);
			}

	        Replace(GenericTypeTag + tdef.GenericParameters.Count, String.Empty);
        }
        /// <summary>
        /// Write a type signature to the text buffer
        /// </summary>
        /// <param name="tdef">Type definition</param>
        protected override void WriteTypeSignature(TypeDefinition tdef)
        {
            tdef.Accept(this);


            if (tdef.GenericParameters.Count > 0)
            {
                Replace(GenericTypeTag + tdef.GenericParameters.Count, String.Empty);
            }
        }