Esempio n. 1
0
        static MultipleFormatterResolver()
        {
            _resolvers = new List <IFormatterResolver> {
                UnixTimestampFormetterResolver.Instance, PayloadFormtterResolver.Instance
            };

            Instance = new MultipleFormatterResolver();
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new <see cref="MessagePackSerializer"/> instance.
        /// </summary>
        /// <param name="resolver">The storage of typed serializers.</param>
        public MessagePackSerializer(IFormatterResolver resolver)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException(nameof(resolver));
            }

            MultipleFormatterResolver.AddFormatterResolver(resolver);
        }