Exemplo n.º 1
0
        private void CallDebuger(string request)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            var data = new Dictionary <string, object>();

            data["request"]     = request;
            data["stopOnEntry"] = false;
            data["program"]     = "remote debug";

            string path = dte.Solution.FileName;

            while (true)
            {
                int index = path.LastIndexOf('\\');
                if (index < 0)
                {
                    break;
                }
                path = path.Substring(0, index);
                if (Directory.Exists(path + @"\res\lua"))
                {
                    data["resDir"] = path + @"\res";
                    break;
                }
            }

            string tempFile = Path.GetTempFileName();

            File.WriteAllText(tempFile, CJsonHelper.Save(data));
            string parameters = string.Format(@"/LaunchJson:""{0}"" /EngineGuid:""94eb6cd0-3439-4af2-971c-0327a9daea68""", tempFile);

            dte.Commands.Raise("0ddba113-7ac1-4c6e-a2ef-dcac3f9e731e", 0x0101, parameters, IntPtr.Zero);
            File.Delete(tempFile);
        }
Exemplo n.º 2
0
        static string Msg2Txt(Dictionary <string, object> res)
        {
            string json = CJsonHelper.Save(res);

            return("Content-Length: " + Encoding.UTF8.GetByteCount(json).ToString() + "\r\n\r\n" + json);
        }