"景先生毕设|www.jxszl.com

C# ClassLayout类代码示例

2023-12-29 17:43编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中ClassLayout类的典型用法代码示例。如果您正苦于以下问题:C#ClassLayout类的具体用法?C#ClassLayout怎么用?C#ClassLayout使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:CreateCustomSizeFieldRva publicvoidCreateCustomSizeFieldRva() { constintdataSize=128; varassembly=Utilities.CreateTempNetAssembly(); vartableStream=assembly.NetDirectory.MetadataHeader.GetStream(); vartypeTable=tableStream.GetTable(); varclassLayoutTable=tableStream.GetTable(); varimporter=newReferenceImporter(tableStream); vartype=newTypeDefinition(string.Empty,"__StaticArrayInitTypeSize="+dataSize, importer.ImportType(typeof(ValueType))); type.MetadataRow.Column5=2;//FieldList type.MetadataRow.Column6=2;//MethodList typeTable.Add(type); varlayout=newClassLayout(type,128,1); type.ClassLayout=layout; classLayoutTable.Add(layout); TestFieldRva(assembly,newTypeDefOrRefSignature(type), Enumerable.Repeat((byte)1,dataSize).ToArray(),false); }
原文链接:http://www.jxszl.com/biancheng/C/556752.html