internal bool DisplayCommand(DeviceCommand.ParamCommand command, DeviceCommand device) { DeviceCommand.CommandParam[] args = command.Parameters; if ((args == null) || (args.Length == 0)) { return(false); } Device = device; Command = command; this.webBrowser.ObjectForScripting = this; string result = HTMLstart(); result += "<div id=\"stylized\" class=\"myform\">"; result += "<FORM action=\"\" method=\"GET\" name=\"" + ParamsFormName + "\"><br/>"; result += "<h1>" + command.DisplayName + " form</h1>"; result += "<p>Command <b>" + command.DisplayName + "</b> requires the following parameters:</p>"; foreach (DeviceCommand.CommandParam arg in args) { result += "<label>" + arg.Name + "<span class=\"small\">Input Web Method parameter</span></label>"; result += "<input type=\"text\" name=\"" + arg.Name + "\"><br/>"; } result += "<button onClick=\"ClientCallback(this.form)\">Perform</button>"; result += "<div class=\"spacer\"></div>"; result += "</FORM></div>"; result += HTMLend(); webBrowser.DocumentText = result; return(true); }
public CommandView() { InitializeComponent(); webBrowser.AllowNavigation = true; webBrowser.ScriptErrorsSuppressed = false; webBrowser.Navigate("about: blank"); Device = null; Command = null; }