コード例 #1
0
        public void SetData(string header, SerializedTreeNode treeNode = null, Type type = null)
        {
            _responseTree.BeginUpdate();
            _responseTree.Nodes.Clear();

            var documentation = "";
            var command       = "";

            if (type != null)
            {
                documentation = type.GetDocumentation();
            }

            if (treeNode != null)
            {
                command = "Response";

                var firstNode = _responseTree.Nodes.Add(treeNode.ToString());
                AddElements(firstNode, treeNode);
                firstNode.Expand();
                _responseTree.SelectedNode = _responseTree.Nodes[0];
            }

            webBrowser.DocumentText = VaultAssembly.Html("Response Type", header, documentation, command);
            _responseTree.EndUpdate();
        }
コード例 #2
0
        public void SetData(string header, List <SerializedTreeNode> treeNodes, Type type = null)
        {
            _responseTree.BeginUpdate();
            _responseTree.Nodes.Clear();

            var documentation = "";
            var command       = "";

            if (type != null)
            {
                documentation = type.GetDocumentation();
            }

            if (treeNodes != null && treeNodes.Count > 0)
            {
                command = "Response";

                foreach (var treeNode in treeNodes)
                {
                    var firstNode = _responseTree.Nodes.Add(treeNode.Name);
                    AddElements(firstNode, treeNode);
                    firstNode.Expand();
                }
                _responseTree.SelectedNode = _responseTree.Nodes[0];
            }

            webBrowser.DocumentText = VaultAssembly.Html("Response Type", header, documentation, command);
            _responseTree.EndUpdate();
        }
コード例 #3
0
        public void Clear(string error = null)
        {
            _responseTree.BeginUpdate();
            _responseTree.Nodes.Clear();

            if (string.IsNullOrEmpty(error))
            {
                error = SoapError;
            }

            webBrowser.DocumentText = VaultAssembly.Html(error, string.Empty, string.Empty, string.Empty);
            _responseTree.EndUpdate();
        }
コード例 #4
0
        public void Clear(string error = null)
        {
            _requestTree.BeginUpdate();
            _requestTree.Nodes.Clear();

            if (string.IsNullOrEmpty(error))
            {
                error = SoapError;
            }

            txtCommand.Text         = string.Empty;
            webBrowser.DocumentText = VaultAssembly.Html(error, string.Empty, string.Empty, string.Empty);

            _requestTree.EndUpdate();
            if (_requestTree.Nodes.Count > 0)
            {
                _requestTree.SelectedNode = _requestTree.Nodes[0];
            }
        }
コード例 #5
0
        public void SetData(XmlDocument xml = null, string service = null)
        {
            _requestTree.BeginUpdate();
            _requestTree.Nodes.Clear();

            txtCommand.Text = string.Empty;
            var h1 = "";

            var documentation = "";
            var command       = "";
            var parameterList = new List <string>();

            if (xml != null && service != null)
            {
                var xmlNamespaceManagers = new XmlNamespaceManager(xml.NameTable);
                xmlNamespaceManagers.AddNamespace(xml.FirstChild.Prefix, xml.FirstChild.NamespaceURI);
                var bodyNode = xml.DocumentElement?.SelectSingleNode("//s:Body", xmlNamespaceManagers);
                if (bodyNode != null)
                {
                    var firstNode  = _requestTree.Nodes.Add(service);
                    var methodNode = bodyNode.FirstChild;
                    var method     = methodNode.Name;
                    AddElements(firstNode, methodNode);
                    _requestTree.ExpandAll();

                    var info       = VaultAssembly.GetServiceType(service);
                    var methodInfo = info.GetMethod(method);
                    if (methodInfo != null)
                    {
                        h1            = methodInfo.Name;
                        documentation = methodInfo.GetDocumentation();
                        command       = "Request";

                        var parameterInfos = methodInfo.GetParameters();
                        txtCommand.Text = GenerateCommand(service, method, parameterInfos);

                        foreach (var parameterInfo in parameterInfos)
                        {
                            var parameterName     = parameterInfo.Name;
                            var parameterTypeName = parameterInfo.ParameterType.FullName;
                            parameterList.Add($"[{parameterTypeName}] ${parameterName}");
                        }
                    }
                }
            }

            if (parameterList.Count > 0)
            {
                var s = "<parameter>";
                foreach (var p in parameterList)
                {
                    s += p + "<br/>";
                }
                s += "</parameter>";

                documentation += s;
            }

            webBrowser.DocumentText = VaultAssembly.Html(h1 + " Method", service, documentation, command);

            _requestTree.EndUpdate();
            if (_requestTree.Nodes.Count > 0)
            {
                _requestTree.SelectedNode = _requestTree.Nodes[0];
            }
        }