コード例 #1
0
        public FormatStringTest()
        {
            _yueluo = Yueluo.Create();
            var _ = _yueluo.FormatToString();

            _cachedObjectVisitor = _yueluo.V()
                                   .WithExtendObject <Yueluo, StringBuilder>()
                                   .ForEach((name, value, sb) => sb.AppendFormat("{0}:{1}{2}", name, value, Environment.NewLine))
                                   .Cache();
        }
コード例 #2
0
        public string NoCacheVisitor()
        {
            var sb = new StringBuilder();

            _yueluo
            .V()
            .WithExtendObject(sb)
            .ForEach((name, value, s) => s.AppendFormat("{0}:{1}{2}", name, value, Environment.NewLine))
            .Run();
            return(sb.ToString());
        }
コード例 #3
0
        public CacheVisitorTest()
        {
            _yueluo = Yueluo.Create();
            var _ = _yueluo.FormatToString();

            _cachedObjectVisitor = _yueluo.V()
                                   .WithExtendObject <Yueluo, StringBuilder>()
                                   .ForEach((name, value, sb) => sb.AppendFormat("{0}:{1}{2}", name, value, Environment.NewLine))
                                   .Cache();

            _propertyInfos = typeof(Yueluo).GetProperties();
        }