System.Reflection.Emit.AssemblyBuilder.SetCustomAttribute C# (CSharp) Method

SetCustomAttribute() public method

public SetCustomAttribute ( System customBuilder ) : void
customBuilder System
return void
        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder) { }
    }

Same methods

AssemblyBuilder::SetCustomAttribute ( System con, byte binaryAttribute ) : void

Usage Example

Esempio n. 1
0
        /**
         *
         */
        public void EmitDecls()
        {
            Manager.Solver.Enqueue(() =>
            {
                compile_all_tyinfos(false);
                foreach (var (attr, shouldEmit) in Manager.AttributeCompiler.GetCompiledAssemblyAttributes(
                    assembly_attributes))
                {
                    if (shouldEmit)
                    {
                        _assembly_builder.SetCustomAttribute(attr);
                    }
                }

                // emit debug attributes
                if (Manager.Options.EmitDebug)
                {
                    var attr = Manager.AttributeCompiler.MakeEmittedAttribute(SystemTypeCache.DebuggableAttribute,
                        new[] {SystemTypeCache.DebuggableAttribute_DebuggingModes},
                        DebuggableAttribute.DebuggingModes.DisableOptimizations |
                        DebuggableAttribute.DebuggingModes.Default);
                    _assembly_builder.SetCustomAttribute(attr);
                }

                // do not require string literals interning
                var attr2 = Manager.AttributeCompiler.MakeEmittedAttribute(
                    SystemTypeCache.CompilationRelaxationsAttribute, 8);
                _assembly_builder.SetCustomAttribute(attr2);

                // wrap non exception throws
                /* uncomment it after we get dependency upon mono 1.1.10, since mono 1.1.9.x do not support this attribute
                */
            });
        }
All Usage Examples Of System.Reflection.Emit.AssemblyBuilder::SetCustomAttribute