CustomAttributeWriter(ICustomAttributeWriterHelper helper) {
			this.helper = helper;
			this.recursionCounter = new RecursionCounter();
			this.outStream = new MemoryStream();
			this.writer = new BinaryWriter(outStream);
			this.genericArguments = null;
		}
Example #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());
     }
 }
Example #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());
     }
 }
Example #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());
     }
 }
Example #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();
     }
 }
Example #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;
 }
Example #8
0
 CustomAttributeWriter(ICustomAttributeWriterHelper helper)
 {
     this.helper      = helper;
     recursionCounter = new RecursionCounter();
     outStream        = new MemoryStream();
     writer           = new DataWriter(outStream);
     genericArguments = null;
     disposeStream    = true;
 }
Example #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;
 }
Example #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());
 }