当前位置: 首页>>代码示例>>C#>>正文


C# CustomAttributeBuilder.DecodeBlob方法代码示例

本文整理汇总了C#中CustomAttributeBuilder.DecodeBlob方法的典型用法代码示例。如果您正苦于以下问题:C# CustomAttributeBuilder.DecodeBlob方法的具体用法?C# CustomAttributeBuilder.DecodeBlob怎么用?C# CustomAttributeBuilder.DecodeBlob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CustomAttributeBuilder的用法示例。


在下文中一共展示了CustomAttributeBuilder.DecodeBlob方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetAttribute

		internal void SetAttribute(AssemblyBuilder asm, CustomAttributeBuilder cab)
		{
			Universe u = cab.Constructor.Module.universe;
			Type type = cab.Constructor.DeclaringType;
			if (copyright == null && type == u.System_Reflection_AssemblyCopyrightAttribute)
			{
				copyright = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
			}
			else if (trademark == null && type == u.System_Reflection_AssemblyTrademarkAttribute)
			{
				trademark = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
			}
			else if (product == null && type == u.System_Reflection_AssemblyProductAttribute)
			{
				product = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
			}
			else if (company == null && type == u.System_Reflection_AssemblyCompanyAttribute)
			{
				company = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
			}
			else if (description == null && type == u.System_Reflection_AssemblyDescriptionAttribute)
			{
				description = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
			}
			else if (title == null && type == u.System_Reflection_AssemblyTitleAttribute)
			{
				title = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
			}
			else if (informationalVersion == null && type == u.System_Reflection_AssemblyInformationalVersionAttribute)
			{
				informationalVersion = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
			}
			else if (fileVersion == null && type == u.System_Reflection_AssemblyFileVersionAttribute)
			{
				fileVersion = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
			}
		}
开发者ID:Semogj,项目名称:ikvm-fork,代码行数:37,代码来源:VersionInfo.cs

示例2: SetMarshalAsAttribute

		internal static void SetMarshalAsAttribute(ModuleBuilder module, int token, CustomAttributeBuilder attribute)
		{
			attribute = attribute.DecodeBlob(module.Assembly);
			FieldMarshalTable.Record rec = new FieldMarshalTable.Record();
			rec.Parent = token;
			rec.NativeType = WriteMarshallingDescriptor(module, attribute);
			module.FieldMarshal.AddRecord(rec);
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:8,代码来源:MarshalSpec.cs

示例3: SetCustomAttribute

		public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
		{
			Universe u = this.Module.universe;
			if (customBuilder.Constructor.DeclaringType == u.System_Runtime_InteropServices_FieldOffsetAttribute)
			{
				customBuilder = customBuilder.DecodeBlob(this.Module.Assembly);
				SetOffset((int)customBuilder.GetConstructorArgument(0));
			}
			else if (customBuilder.Constructor.DeclaringType == u.System_Runtime_InteropServices_MarshalAsAttribute)
			{
				MarshalSpec.SetMarshalAsAttribute(typeBuilder.ModuleBuilder, pseudoToken, customBuilder);
				attribs |= FieldAttributes.HasFieldMarshal;
			}
			else if (customBuilder.Constructor.DeclaringType == u.System_NonSerializedAttribute)
			{
				attribs |= FieldAttributes.NotSerialized;
			}
			else if (customBuilder.Constructor.DeclaringType == u.System_Runtime_CompilerServices_SpecialNameAttribute)
			{
				attribs |= FieldAttributes.SpecialName;
			}
			else
			{
				typeBuilder.ModuleBuilder.SetCustomAttribute(pseudoToken, customBuilder);
			}
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:26,代码来源:FieldBuilder.cs

示例4: SetCustomAttribute

		public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
		{
			switch (customBuilder.KnownCA)
			{
				case KnownCA.FieldOffsetAttribute:
					SetOffset((int)customBuilder.DecodeBlob(this.Module.Assembly).GetConstructorArgument(0));
					break;
				case KnownCA.MarshalAsAttribute:
					FieldMarshal.SetMarshalAsAttribute(typeBuilder.ModuleBuilder, pseudoToken, customBuilder);
					attribs |= FieldAttributes.HasFieldMarshal;
					break;
				case KnownCA.NonSerializedAttribute:
					attribs |= FieldAttributes.NotSerialized;
					break;
				case KnownCA.SpecialNameAttribute:
					attribs |= FieldAttributes.SpecialName;
					break;
				default:
					typeBuilder.ModuleBuilder.SetCustomAttribute(pseudoToken, customBuilder);
					break;
			}
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:22,代码来源:FieldBuilder.cs

示例5: SetCustomAttribute

		public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
		{
			switch (customBuilder.KnownCA)
			{
				case KnownCA.DllImportAttribute:
					SetDllImportPseudoCustomAttribute(customBuilder.DecodeBlob(this.Module.Assembly));
					attributes |= MethodAttributes.PinvokeImpl;
					break;
				case KnownCA.MethodImplAttribute:
					SetMethodImplAttribute(customBuilder.DecodeBlob(this.Module.Assembly));
					break;
				case KnownCA.PreserveSigAttribute:
					implFlags |= MethodImplAttributes.PreserveSig;
					break;
				case KnownCA.SpecialNameAttribute:
					attributes |= MethodAttributes.SpecialName;
					break;
				case KnownCA.SuppressUnmanagedCodeSecurityAttribute:
					attributes |= MethodAttributes.HasSecurity;
					goto default;
				default:
					this.ModuleBuilder.SetCustomAttribute(pseudoToken, customBuilder);
					break;
			}
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:25,代码来源:MethodBuilder.cs

示例6: SetCustomAttribute

		public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
		{
			switch (customBuilder.KnownCA)
			{
				case KnownCA.StructLayoutAttribute:
					SetStructLayoutPseudoCustomAttribute(customBuilder.DecodeBlob(this.Assembly));
					break;
				case KnownCA.SerializableAttribute:
					attribs |= TypeAttributes.Serializable;
					break;
				case KnownCA.ComImportAttribute:
					attribs |= TypeAttributes.Import;
					break;
				case KnownCA.SpecialNameAttribute:
					attribs |= TypeAttributes.SpecialName;
					break;
				case KnownCA.SuppressUnmanagedCodeSecurityAttribute:
					attribs |= TypeAttributes.HasSecurity;
					goto default;
				default:
					this.ModuleBuilder.SetCustomAttribute(token, customBuilder);
					break;
			}
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:24,代码来源:TypeBuilder.cs


注:本文中的CustomAttributeBuilder.DecodeBlob方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。