public static ICoder <T> GenFunction <T, T1>(ICoder <T1> signatureCoder, ICoder <T> bodyCoder, Func <T, T1> selector) where T : class where T1 : class { var body = bodyCoder.WithPrefix("\n").WithPostfix("\n").Brace().WithPostfix("\n"); return(GenCombineReverse(signatureCoder.WithPostfix("\n"), body, selector)); }
public static ICoder <T> SkipLine <T>(this ICoder <T> coder, int num = 1) where T : class { var postFix = new char[num]; for (int i = 0; i < num; i++) { postFix[i] = '\n'; } return(coder.WithPostfix(new string(postFix))); }
// () public static ICoder <T> Bracket <T>(this ICoder <T> coder) where T : class { return(coder.WithPostfix(")").WithPrefix("(")); }
public static ICoder <T> Between <T>(this ICoder <T> coder, string str) where T : class { return(coder.WithPostfix(str).WithPrefix(str)); }
public static ICoder <T> Statement <T>(this ICoder <T> coder) where T : class { return(coder.WithPostfix(";")); }
public static ICoder <T> Brace <T>(this ICoder <T> coder) { return(coder.WithPostfix("}").WithPrefix("{")); }