Пример #1
0
        public static Rule[] OrderedRules()
        {
            //Very  bad way of sorting....
            List <Rule> Rules = new List <Rule>();

            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Akkara)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Divpada)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Jati)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Ragada)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Ragada2)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Shatpada)))
            {
                Rules.Add(R);
            }


            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.UpaJati)))
            {
                Rules.Add(R);
            }

            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Sisamu)))
            {
                Rules.Add(R);
            }

            for (int i = 1; i <= 27; i++)
            {
                //string cName = Helper.ChandamName(i) + (i <= 26 ? " (" + i + ")" : " (>26)");
                Rule[] VRules = i <= 26 ? RuleHelper.GetRules3(i) : RuleHelper.GetRules4(i);
                foreach (Rule R in SortHelper.SortByName(VRules))
                {
                    Rules.Add(R);
                }
            }

            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.DaMDakamu)))
            {
                Rules.Add(R);
            }

            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.VishamaVruttam)))
            {
                Rules.Add(R);
            }

            //Why doing this again??
            Rule[] Rules2 = new Rule[Rules.Count];
            for (int i = 0; i < Rules.Count; i++)
            {
                Rules2[i] = Rules[i];
            }

            return(Rules2);
        }
Пример #2
0
        public static string BuildBook()
        {
            #region
            //foreach ( Rule R in SortHelper.OrderedRules ( ) )
            //{
            //    s=s+"<li>";
            //    s =s+ BuildHTMLRules ( R ,true);
            //    s = s + "</li>";
            //}
            #endregion

            //Why not going with a Loop...???
            //Should be Something Like this.
            //SortHelper.SortByName2 ( delegate (Rule R)
            //{
            //    return R.PadyamSubType == PadyamSubType.Jati;
            //} );

            string s2 = "<h1>అనుక్రమణిక</h1><ol>";
            string s  = "";

            string[] F = new string[] { };
            F  = SortByName2("జాతులు", PadyamSubType.Jati);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("అక్కరలు", PadyamSubType.Akkara);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("రగడలు", PadyamSubType.Ragada);
            s  = s + F[0];
            s2 = s2 + F[1];


            F  = SortByName2("ముత్యాలసరములు", PadyamSubType.Ragada2);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("షట్పదలు", PadyamSubType.Shatpada);
            s  = s + F[0];
            s2 = s2 + F[1];



            F  = SortByName2("ఉప-జాతులు", PadyamSubType.UpaJati);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("ద్విపదలు", PadyamSubType.Divpada);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("సీసములు", PadyamSubType.Divpada);
            s  = s + F[0];
            s2 = s2 + F[1];



            s  = s + "<h1>వృత్తములు</h1>";
            s2 = s2 + "<li>వృత్తములు</li><ol>";
            for (int i = 1; i <= 27; i++)
            {
                string cName  = Helper.ChandamName(i) + (i <= 26 ? " (" + i + ")" : " (>26)");
                Rule[] VRules = i <= 26 ? RuleHelper.GetRules3(i) : RuleHelper.GetRules4(i);

                s = s + "<h1>" + cName + "</h1>";
                s = s + "<ol>";

                s2 = s2 + "<li>" + cName + "</li>";
                s2 = s2 + "<ol>";
                foreach (Rule R in SortHelper.SortByName(VRules))
                {
                    s  = s + "<li  id='" + R.Identifier + "'>";
                    s  = s + BuildHTMLRules(R, true);
                    s  = s + "&nbsp; <a class='link' href='#TOP_" + R.Identifier + "'>[TOP]</a>";
                    s  = s + "</li>";
                    s2 = s2 + "<li id='TOP_" + R.Identifier + "'><a class='identifier' href='#" + R.Identifier + "'>" + R.Name + "</a></li>";
                }
                s  = s + "</ol>";
                s2 = s2 + "</ol>";
            }
            s2 = s2 + "</ol>";


            F  = SortByName2("దండకములు", PadyamSubType.DaMDakamu);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("అసమ వృత్తములు", PadyamSubType.VishamaVruttam);
            s  = s + F[0];
            s2 = s2 + F[1];

            s2 = s2 + "</ol>";
            return(s2 + s);
        }