/// <summary> /// 使用与Converter关联的IJsonFormatter进行序列化 /// </summary> /// <param name="context">上下文</param> /// <returns></returns> protected IEnumerable <KeyValuePair <string, string> > SerializeByFormatter(ConvertContext context) { return(this.SerializeByFormatter(context.Name, context.Value, context.Options)); }
/// <summary> /// 将上下文简单转换为键值对 /// </summary> /// <param name="context">上下文</param> /// <exception cref="ArgumentNullException"></exception> /// <returns></returns> protected KeyValuePair <string, string> ToKeyValuePair(ConvertContext context) { return(this.ToKeyValuePair(context.Name, context.Value, context.Options)); }
/// <summary> /// 执行转换 /// </summary> /// <param name="context">转换上下文</param> /// <returns></returns> public abstract IEnumerable <KeyValuePair <string, string> > Invoke(ConvertContext context);