예제 #1
0
        public static ICoder <T> GenRegion <T>(ICoder <T> coder, string name) where T : class
        {
            var coderBegin = new UnitCoder <T>(string.Format("\n#region {0}", name));
            var coderEnd   = new UnitCoder <T>("#endregion\n");

            return(new SequenceCoder <T>(coderBegin.Code
                                         , GenUnit("\n").Code
                                         , coder.Code
                                         , GenUnit("\n").Code
                                         , coderEnd.Code));
        }
예제 #2
0
        public static ICoder <T> WithPrefix <T>(this ICoder <T> coder, string prefix) where T : class
        {
            var coderPrefix = new UnitCoder <T>(prefix);

            return(new SequenceCoder <T>(coderPrefix.Code, coder.Code));
        }