CustomAttributeWriter(ICustomAttributeWriterHelper helper) { this.helper = helper; this.recursionCounter = new RecursionCounter(); this.outStream = new MemoryStream(); this.writer = new BinaryWriter(outStream); this.genericArguments = null; }
internal static byte[] Write(ICustomAttributeWriterHelper helper, CustomAttribute ca, DataWriterContext context) { using (var writer = new CustomAttributeWriter(helper, context)) { writer.Write(ca); return(writer.GetResult()); } }
internal static byte[] Write(ICustomAttributeWriterHelper helper, IList <CANamedArgument> namedArgs, DataWriterContext context) { using (var writer = new CustomAttributeWriter(helper, context)) { writer.Write(namedArgs); return(writer.GetResult()); } }
/// <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()); } }
/// <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(); } }
/// <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; recursionCounter = new RecursionCounter(); outStream = new MemoryStream(); writer = new DataWriter(outStream); genericArguments = null; disposeStream = true; }
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; }
/// <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()); }