Exemple #1
0
        internal Type GetOrCreateProxyType(ProxyTypeDefinition typeDefinition)
        {
            if (typeDefinition is null)
            {
                throw new ArgumentNullException(nameof(typeDefinition));
            }

            string name = typeDefinition.Name;
            Type   type = proxyTypes.FirstOrDefault(p => p.Name == name);

            if (type == null)
            {
                TypeBuilder typeBuilder = Module.DefineType(typeDefinition.FullName, typeDefinition.TypeAttributes);
                ProxyScope  proxyScope  = new ProxyScope(this, typeBuilder, typeDefinition);
                proxyScope.DefineTypeAndMembers();
                type = typeBuilder.BuildType();
                proxyTypes.Add(type);
            }
            return(type);
        }
Exemple #2
0
 public virtual void AfterInvoke(ProxyScope proxyScope, ILGenerator il, CallbackMethodDefinition callbackMethodDefinition)
 {
 }
Exemple #3
0
 public virtual void BeforeDefine(ProxyScope proxyScope)
 {
 }
Exemple #4
0
 public virtual void AfterDefine(ProxyScope proxyScope)
 {
 }