Ejemplo n.º 1
0
        public FormatNode <TResult> Branch()
        {
            var formatNode = new FormatNode <TResult>();

            branches.Add(formatNode);
            return(formatNode);
        }
Ejemplo n.º 2
0
        public void AddCulture(CultureInfo culture)
        {
            var dtfmt   = culture.DateTimeFormat;
            var allfmts = dtfmt.GetAllDateTimePatterns();

            // Reading all patterns and creating a parse tree
            // that can distinguish them.
            var rootNode = new FormatNode <DateTimePartition>();

            foreach (var eachfmt in allfmts)
            {
                var currentNode = rootNode.Branch();
                var chx         = '\0';
                var cnt         = 0;
                for (int itch = 0; itch < eachfmt.Length; itch++)
                {
                }
            }

            //var numNode0 = branch
            //    .Branch(numParser)
            //    .Result(n => new GregorianYearValue(n.Value));
            //var sepNode0 = startNum2.Next(dateSeparatorParser);
            //var numNode1 = sepNode0
            //    .Branch(numParser)
            //    .Result(n => new MonthOfYearValue(n.Value));
            //var sepNode1 = numNode1.Next(dateSeparatorParser);
            //var numNode2 = sepNode1
            //    .Branch(numParser)
            //    .Result(n => new DayOfMonthValue(n.Value));
        }