CustomAttributeWriter(ICustomAttributeWriterHelper helper) {
			this.helper = helper;
			this.recursionCounter = new RecursionCounter();
			this.outStream = new MemoryStream();
			this.writer = new BinaryWriter(outStream);
			this.genericArguments = null;
		}
示例#2
0
 internal static byte[] Write(ICustomAttributeWriterHelper helper, CustomAttribute ca, DataWriterContext context)
 {
     using (var writer = new CustomAttributeWriter(helper, context)) {
         writer.Write(ca);
         return(writer.GetResult());
     }
 }
示例#3
0
 internal static byte[] Write(ICustomAttributeWriterHelper helper, IList <CANamedArgument> namedArgs, DataWriterContext context)
 {
     using (var writer = new CustomAttributeWriter(helper, context)) {
         writer.Write(namedArgs);
         return(writer.GetResult());
     }
 }
示例#4
0
 /// <summary>
 /// Writes a custom attribute
 /// </summary>
 /// <param name="helper">Helper class</param>
 /// <param name="ca">The custom attribute</param>
 /// <returns>Custom attribute blob</returns>
 public static byte[] Write(ICustomAttributeWriterHelper helper, CustomAttribute ca)
 {
     using (var writer = new CustomAttributeWriter(helper)) {
         writer.Write(ca);
         return(writer.GetResult());
     }
 }
示例#5
0
 /// <summary>
 /// Writes a custom attribute
 /// </summary>
 /// <param name="helper">Helper class</param>
 /// <param name="ca">The custom attribute</param>
 /// <returns>Custom attribute blob</returns>
 public static byte[] Write(ICustomAttributeWriterHelper helper, CustomAttribute ca)
 {
     using (var writer = new CustomAttributeWriter(helper)) {
         writer.Write(ca);
         return writer.GetResult();
     }
 }
示例#6
0
 /// <summary>
 /// Writes custom attribute named arguments
 /// </summary>
 /// <param name="helper">Helper class</param>
 /// <param name="namedArgs">Named arguments</param>
 /// <returns>The named args blob</returns>
 internal static byte[] Write(ICustomAttributeWriterHelper helper, IList<CANamedArgument> namedArgs)
 {
     using (var writer = new CustomAttributeWriter(helper)) {
         writer.Write(namedArgs);
         return writer.GetResult();
     }
 }
 CustomAttributeWriter(ICustomAttributeWriterHelper helper)
 {
     this.helper           = helper;
     this.recursionCounter = new RecursionCounter();
     this.outStream        = new MemoryStream();
     this.writer           = new BinaryWriter(outStream);
     this.genericArguments = null;
 }
示例#8
0
 CustomAttributeWriter(ICustomAttributeWriterHelper helper)
 {
     this.helper      = helper;
     recursionCounter = new RecursionCounter();
     outStream        = new MemoryStream();
     writer           = new DataWriter(outStream);
     genericArguments = null;
     disposeStream    = true;
 }
示例#9
0
 CustomAttributeWriter(ICustomAttributeWriterHelper helper, DataWriterContext context)
 {
     this.helper      = helper;
     recursionCounter = new RecursionCounter();
     outStream        = context.OutStream;
     writer           = context.Writer;
     genericArguments = null;
     disposeStream    = false;
     outStream.SetLength(0);
     outStream.Position = 0;
 }
示例#10
0
 /// <summary>
 /// Writes custom attribute named arguments
 /// </summary>
 /// <param name="helper">Helper class</param>
 /// <param name="namedArgs">Named arguments</param>
 /// <returns>The named args blob</returns>
 internal static byte[] Write(ICustomAttributeWriterHelper helper, IList <CANamedArgument> namedArgs)
 {
     using var writer = new CustomAttributeWriter(helper);
     writer.Write(namedArgs);
     return(writer.GetResult());
 }