Ejemplo n.º 1
0
        internal MethodInfo this[TypeModel.CallbackType callbackType]
        {
            get
            {
                switch (callbackType)
                {
                case TypeModel.CallbackType.BeforeSerialize:
                    return(this.beforeSerialize);

                case TypeModel.CallbackType.AfterSerialize:
                    return(this.afterSerialize);

                case TypeModel.CallbackType.BeforeDeserialize:
                    return(this.beforeDeserialize);

                case TypeModel.CallbackType.AfterDeserialize:
                    return(this.afterDeserialize);
                }
                throw new ArgumentException("Callback type not supported: " + callbackType.ToString(), "callbackType");
            }
        }
Ejemplo n.º 2
0
 internal MethodInfo this[TypeModel.CallbackType callbackType]
 {
     get
     {
         return(callbackType switch
         {
             TypeModel.CallbackType.BeforeSerialize => beforeSerialize,
             TypeModel.CallbackType.AfterSerialize => afterSerialize,
             TypeModel.CallbackType.BeforeDeserialize => beforeDeserialize,
             TypeModel.CallbackType.AfterDeserialize => afterDeserialize,
             _ => throw new ArgumentException("Callback type not supported: " + callbackType.ToString(), nameof(callbackType)),
         });