protected override void BuildConstantsInternal(WriterConstantsBuilderContext context) { context.SetFields(Type, new[] { new KeyValuePair <string, Type>("hashCodes_" + Type.Name + "_" + Guid.NewGuid(), typeof(ulong[])), new KeyValuePair <string, Type>("values_" + Type.Name + "_" + Guid.NewGuid(), typeof(int[])), }); }
protected override void BuildConstantsInternal(WriterConstantsBuilderContext context) { context.SetFields(Type, new[] { new KeyValuePair <string, Type>("writers_" + Type.Name + "_" + Guid.NewGuid(), typeof(IntPtr[])), new KeyValuePair <string, Type>("delegates_" + Type.Name + "_" + Guid.NewGuid(), typeof(Delegate[])), // This field is needed only to save references to the dynamic methods. Otherwise GC will destroy them }); Array.ForEach(GroBufHelpers.LeafTypes.Where(type => type != null).ToArray(), type => context.BuildConstants(type)); }
protected override void BuildConstantsInternal(WriterConstantsBuilderContext context) { context.SetFields(Type, new[] { new KeyValuePair <string, Type>("customSerializer_" + Type.Name + "_" + Guid.NewGuid(), typeof(IGroBufCustomSerializer)) }); }
public void BuildConstants(WriterConstantsBuilderContext context) { context.SetFields(Type, new KeyValuePair <string, Type> [0]); BuildConstantsInternal(context); }