Example #1
0
 protected override void BuildConstantsInternal(SizeCounterConstantsBuilderContext 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(SizeCounterConstantsBuilderContext context)
 {
     context.SetFields(Type, new[]
     {
         new KeyValuePair <string, Type>("counters_" + 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));
 }
Example #3
0
 public void BuildConstants(SizeCounterConstantsBuilderContext context)
 {
     context.SetFields(Type, new KeyValuePair <string, Type> [0]);
     BuildConstantsInternal(context);
 }
Example #4
0
 protected override void BuildConstantsInternal(SizeCounterConstantsBuilderContext context)
 {
     context.SetFields(Type, new[] { new KeyValuePair <string, Type>("customSerializer_" + Type.Name + "_" + Guid.NewGuid(), typeof(IGroBufCustomSerializer)) });
 }