private List<CodeGeneration> GetAllSelectCode(FiddlerSessionHolder sess, HtmlDocument htmlDocument)
        {
            var result = new List<CodeGeneration>();
            foreach(var selectNode in htmlDocument.DocumentNode.SelectNodes(".//select"))
            {
                var selectNodeName = selectNode.Attributes.Contains("name") ? selectNode.Attributes["name"].Value : "!!!";
                var select = new CodeGeneration("Select");
                select.Header = "Options for "+selectNodeName;
                var paramz = new StringBuilder();

                var options = selectNode.SelectNodes(".//option");
                foreach (var optioNode in options)
                {
                    paramz.AppendLine(String.Format("\t{{ \"{0}\",\"{1}\" }}, //{2} {3}", selectNodeName,
                        optioNode.Attributes.Contains("value") ? optioNode.Attributes["value"].Value : "",
                        optioNode.NextSibling.InnerText,
                        optioNode.Attributes.Contains("selected") ? "<-default" : ""));
                }
                select.Text = paramz.ToString();
                result.Add(select);
            }
            return result;
        }
        protected CodeGeneration GetAllInputCode(FiddlerSessionHolder sess, HtmlDocument htmlDocument)
        {
            var allInput = new CodeGeneration("Request");
            allInput.Header = "Code";

            var inputNodes = htmlDocument.DocumentNode.SelectNodes(".//input");
            if (inputNodes != null)
            {
                var p = inputNodes
                    .Where(k => k.Attributes.FirstOrDefault(n => n.Name.ToLower() == "name") != null)
                    .Select(k =>
                    {
                        var nameAttr = k.Attributes.FirstOrDefault(n => n.Name.ToLower() == "name");
                        var valueAttr = k.Attributes.FirstOrDefault(n => n.Name.ToLower() == "value");
                        var typeAttr = k.Attributes.FirstOrDefault(n => n.Name.ToLower() == "type");
                        return new Tuple<string, string, string>(
                            nameAttr == null ? null : nameAttr.Value,
                            valueAttr == null ? "" : valueAttr.Value,
                            typeAttr == null ? "default" : typeAttr.Value
                            );
                    }).Where(k => k.Item1 != null);

                var paramz = new StringBuilder();
                paramz.AppendLine(String.Format("var allParams = new NameValueCollection"));
                paramz.AppendLine("{");
                foreach (var kvp in p)
                {
                    paramz.AppendLine(String.Format("\t{{ \"{0}\",\"{1}\" }}, //Type: {2}", kvp.Item1, kvp.Item2, kvp.Item3));
                }
                paramz.AppendLine("});");
                allInput.Text = paramz.ToString();
            }
            return allInput;

        }
        private CodeGeneration GetRequestCode(FiddlerSessionHolder sess, HtmlDocument htmlDocument)
        {
            var requestCode = new CodeGeneration("Request");
            var requestType = sess.FiddlerSession.oRequest.headers.HTTPMethod;
            requestCode.Header = sess.FiddlerSession.url + " (" + requestType + ")";

            switch (requestType)
            {
                case "GET":
                    requestCode.Text = StrNavigateGet(sess.FiddlerSession.fullUrl);
                    break;
                case "POST":
                    requestCode.Text = "todo " + GetIndex();
                    break;
                default:
                    requestCode.Text = "Invalid requestType " + requestType;
                    break;
            }
            return requestCode;
        }