Exemple #1
0
        private void 查看ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var box = new mybox("结果");

            box.setText(postman.ToString());
            box.ShowDialog();
        }
Exemple #2
0
        private void StartClicked(object sender, EventArgs e)
        {
            if (bStart == false)
            {
                this.start.Text = "停止";
                bStart          = true;

                var name = "";
                var mbox = new mybox("输入一下postman的名字");
                mbox.onClose += (box, embe) =>
                {
                    name = ((MyBoxEvent)embe).text;
                };
                mbox.ShowDialog();

                var info = new JObject();
                info.Add("_postman_id", Guid.NewGuid().ToString());
                info.Add("name", name);
                info.Add("schema", "https://schema.getpostman.com/json/collection/v2.1.0/collection.json");
                if (postman.ContainsKey("name"))
                {
                    postman["info"] = info;
                    return;
                }

                if (postman.ContainsKey("info"))
                {
                    postman["info"] = info;
                    postman["protocolProfileBehavior"] = new JObject();
                }
                else
                {
                    postman.Add("info", info);
                    postman.Add("protocolProfileBehavior", new JObject());
                }
            }
            else
            {
                this.start.Text = "开始";
                bStart          = false;
                var box = new mybox("结果");
                box.setText(postman.ToString());
                box.ShowDialog();
            }
        }