コード例 #1
0
ファイル: Program.cs プロジェクト: zixuan203344/Pycad
 static void Main(string[] args)
 {
     while (true)
     {
         Console.Write(">>>");
         string code = Console.ReadLine();
         if (code.ToLower() == "quit")
         {
             break;
         }
         IConsoleServer proxy = ServUtils.CreateClient <IConsoleServer, WSDualHttpBinding, Pyconsole>("http://localhost/pycad/servers/console");
         string         res   = proxy.Exec(code);
         if (!string.IsNullOrEmpty(res))
         {
             res += "\r\n";
         }
         Console.Write(res);
     }
 }
コード例 #2
0
ファイル: Pyconsole.cs プロジェクト: zixuan203344/Pycad
        public void Read()
        {
            string result   = "\n";
            string previous = null;
            string current  = null;

            for (int count = 0; count < 2 || previous != "" && current != ""; count++)
            {
                previous = current;
                current  = Console.ReadLine();
                result  += "\n" + current;
            }
            result.TrimEnd(' ', '\n');
            IConsoleServer proxy = ServUtils.CreateClient <IConsoleServer, WSDualHttpBinding, Pyconsole>("http://localhost/pycad/servers/console");
            string         res   = proxy.Exec(result);

            if (!string.IsNullOrEmpty(res))
            {
                res += "\r\n";
            }
            Console.Write(res);
        }