本文整理汇总了C#中System.Reflection.Emit.CustomAttributeBuilder.CreateCustomAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# CustomAttributeBuilder.CreateCustomAttribute方法的具体用法?C# CustomAttributeBuilder.CreateCustomAttribute怎么用?C# CustomAttributeBuilder.CreateCustomAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.CustomAttributeBuilder
的用法示例。
在下文中一共展示了CustomAttributeBuilder.CreateCustomAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetCustomAttribute
// Use this function if client wishes to build CustomAttribute using CustomAttributeBuilder
/// <include file='doc\ParameterBuilder.uex' path='docs/doc[@for="ParameterBuilder.SetCustomAttribute1"]/*' />
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
customBuilder.CreateCustomAttribute((ModuleBuilder) (m_methodBuilder .GetModule()), m_pdToken.Token);
}
示例2: SetCustomAttribute
[System.Security.SecuritySafeCritical] // auto-generated
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException(nameof(customBuilder));
}
Contract.EndContractBlock();
customBuilder.CreateCustomAttribute((ModuleBuilder) (m_methodBuilder .GetModule()), m_pdToken.Token);
}
示例3: SetCustomAttribute
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
this.m_type.ThrowIfCreated();
customBuilder.CreateCustomAttribute(this.m_module, this.m_evToken.Token);
}
示例4: SetCustomAttribute
[System.Security.SecuritySafeCritical] // auto-generated
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
throw new ArgumentNullException("customBuilder");
Contract.EndContractBlock();
customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, m_tdType.Token);
}
示例5: SetCustomAttribute
[System.Security.SecuritySafeCritical] // auto-generated
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException(nameof(customBuilder));
}
Contract.EndContractBlock();
m_type.ThrowIfCreated();
customBuilder.CreateCustomAttribute(m_module, m_evToken.Token);
}
示例6: SetCustomAttribute
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
ThrowIfGeneric ();
if (customBuilder == null)
throw new ArgumentNullException("customBuilder");
customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, MetadataTokenInternal);
if (IsKnownCA(customBuilder.m_con))
ParseCA(customBuilder.m_con, customBuilder.m_blob);
}
示例7: SetCustomAttributeNoLock
[System.Security.SecurityCritical] // auto-generated
private void SetCustomAttributeNoLock(CustomAttributeBuilder customBuilder)
{
customBuilder.CreateCustomAttribute(
m_manifestModuleBuilder,
AssemblyBuilderData.m_tkAssembly); // This is the AssemblyDef token
// Track the CA for persistence
if (m_assemblyData.m_access != AssemblyBuilderAccess.Run)
{
m_assemblyData.AddCustomAttribute(customBuilder);
}
}
示例8: SetCustomAttribute
// Use this function if client wishes to build CustomAttribute using CustomAttributeBuilder
/// <include file='doc\ModuleBuilder.uex' path='docs/doc[@for="ModuleBuilder.SetCustomAttribute1"]/*' />
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
CodeAccessPermission.DemandInternal(PermissionType.ReflectionEmit);
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
customBuilder.CreateCustomAttribute(this, 1); // This is hard coding the module token to 1
}
示例9: SetCustomAttribute
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
this.ThrowIfGeneric();
customBuilder.CreateCustomAttribute(this.m_module, this.MetadataTokenInternal);
if (this.IsKnownCA(customBuilder.m_con))
{
this.ParseCA(customBuilder.m_con, customBuilder.m_blob);
}
}
示例10: SetCustomAttributeNoLock
private void SetCustomAttributeNoLock(CustomAttributeBuilder customBuilder)
{
customBuilder.CreateCustomAttribute(this.m_manifestModuleBuilder, 0x20000001);
if (this.m_assemblyData.m_access != AssemblyBuilderAccess.Run)
{
this.m_assemblyData.AddCustomAttribute(customBuilder);
}
}
示例11: SetCustomAttribute
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
this.m_typeBuilder.ThrowIfCreated();
ModuleBuilder module = this.m_typeBuilder.Module as ModuleBuilder;
customBuilder.CreateCustomAttribute(module, this.m_tkField.Token);
}
示例12: SetCustomAttribute
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
customBuilder.CreateCustomAttribute(this, 1);
}
示例13: SetCustomAttribute
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
ThrowIfGeneric();
if (customBuilder == null)
throw new ArgumentNullException("customBuilder");
customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, m_tdType.Token);
}
示例14: SetCustomAttribute
[System.Security.SecuritySafeCritical] // auto-generated
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
m_containingType.ThrowIfCreated();
customBuilder.CreateCustomAttribute(m_moduleBuilder, m_prToken.Token);
}
示例15: SetCustomAttribute
[System.Security.SecuritySafeCritical] // auto-generated
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
throw new ArgumentNullException("customBuilder");
Contract.EndContractBlock();
m_typeBuilder.ThrowIfCreated();
ModuleBuilder module = m_typeBuilder.Module as ModuleBuilder;
customBuilder.CreateCustomAttribute(module, m_tkField.Token);
}