Ejemplo n.º 1
0
        public static string CodeIt(Rule R)
        {
            string template = @"public class {0} :Rule 
{ 
	public {0}()
	{ 
		Lines = {1};
		Threshold = {2};

		RuleType = {3};
		PadyamType = {4};
		PadyamSubType ={5};
		Frequency = Frequency.Rare;
		YatiMode = {6};

		Prasa = {7};
		PrasaYati = {8};
		AnthyaPrasa={9};
		InfiniteLength = {16};

		Rules = {10};
		Yati = {11};
		
		Identifier = {12};
		Name = {13};
		ShortName = {14};
		
		Examples = {15};
		
		References={17};
	}
}";

            CSWriter C          = new CSWriter();
            string   identifier = R.Identifier;
            string   nm         = R.Name;
            string   s          = template.Replace("{0}", identifier);

            s = s.Replace("{1}", R.Lines.ToString());
            s = s.Replace("{2}", Helper.CalcThreshold(R).ToString());
            s = s.Replace("{3}", C.CSRuleType(R.RuleType));
            s = s.Replace("{4}", C.CSPadyamType(R.PadyamType));
            s = s.Replace("{5}", C.CSPadyamSubType(R.PadyamSubType));
            s = s.Replace("{6}", C.CSYatiMode(R.YatiMode));
            s = s.Replace("{7}", C.CSBool(R.Prasa));
            s = s.Replace("{8}", C.CSBool(R.PrasaYati));
            s = s.Replace("{9}", C.CSBool(R.AnthyaPrasa));
            s = s.Replace("{10}", C.CSRules(R.Rules, R.RuleType));
            s = s.Replace("{11}", C.CSyati(R.Yati));
            s = s.Replace("{12}", C.CSString(identifier));
            s = s.Replace("{13}", C.CSString(nm));
            s = s.Replace("{14}", C.CSString(nm));
            s = s.Replace("{15}", C.CStringArray(R.Examples));
            s = s.Replace("{16}", C.CSBool(R.InfiniteLength));
            s = s.Replace("{17}", C.CStringArray(R.References));
            return(s);
        }
Ejemplo n.º 2
0
        private static void Share(Rule R, string cc)
        {
            string r = Business.Rules3(R);
            string c = CSWriter.CodeIt(R);

            r = FixRequest(r);
            c = FixRequest(c);

            string content = "t=rc&e=" + cc + "&n=" + R.Name + "&r=" + r + "&c=" + c;

            Ajax.MakeCall("/Log.ashx", new AjaxCallback(delegate(string err, string data, XHR xhr)
            {
                Debug2.Write("Status: " + xhr.Status.ToString() + "<br />" +
                             "Error: " + err + "<br/>" +
                             "Response: " + data);
                if (xhr.Status.ToString() == "200")
                {
                    Window.Alert("మీరు పద్య లక్షణాలు 'ఛందం ©' తో పంచుకున్నందుకు చాలా సంతోషం.\nThanks for your contribution.! Details are Shared with  'Chandam©' team.");
                }
            }), HTTPMethod.POST, content);
        }