Esempio n. 1
0
 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[])),
     });
 }
Esempio n. 2
0
 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)) });
 }
Esempio n. 4
0
 public void BuildConstants(WriterConstantsBuilderContext context)
 {
     context.SetFields(Type, new KeyValuePair <string, Type> [0]);
     BuildConstantsInternal(context);
 }