コード例 #1
0
        public static void Show(JsString strPrompt, JsString strTitle, JsString strOKPrompt, JsString strCancelPrompt, JsString OKFunction, JsString CancelFunction)
        {
            //Defaults
            if (strPrompt == null)
            {
                strPrompt = "Would you like to confirm or cancel this action?";
            }
            if (strTitle == null)
            {
                strTitle = "Confirmation";
            }
            if (strOKPrompt == null)
            {
                strOKPrompt = "Confirm";
            }
            if (strCancelPrompt == null)
            {
                strCancelPrompt = "Cancel";
            }

            //create the hidden DIV to hold the confirmation box on load
            if (divConfirmationBox == null)
            {
                divConfirmationBox                       = new HtmlDivElement();
                divConfirmationBox.id                    = "divConfirmatonPopup";
                divConfirmationBox.style.display         = "none";
                divConfirmationBox.style.backgroundColor = "#333";
                divConfirmationBox.style.textAlign       = "center";
                divConfirmationBox.style.position        = "absolute";
                divConfirmationBox.style.width           = "1px";
                divConfirmationBox.style.height          = "1px";
                divConfirmationBox.style.top             = "312px";
                divConfirmationBox.style.left            = "84px";
                divConfirmationBox.style.opacity         = ".8";
                divConfirmationBox.style.border          = "solid 3px #aaa";
                divConfirmationBox.style.fontSize        = "24px";
                divConfirmationBox.style.overflow        = "hidden";
                //                divConfirmationBox.style.borderRadius = "30px";
                divConfirmationBox.SetAttribute("style", "border-radius:30px");
                HtmlBodyElement.GetByTagName()[0].AppendChild(divConfirmationBox);
            }

            //set the confirmation box actions
            confirmationBox_OKCall     = OKFunction;
            confirmationBox_CancelCall = CancelFunction;

            JsString tmpPopupHTML = "<table width='600' height='400'><tr><td colspan='2' valign='top'><span style='font-size:32pt;font-weight:bold;'>" + strTitle + "</span></td></tr><tr><td colspan='2' valign='middle'>" + strPrompt + "</td></tr>";

            tmpPopupHTML += "<tr><td valign='bottom' align='middle' width='50%' ontouchstart='eval(confirmationBox_OKCall);confirmationBox_hide();'    ><div style='border-radius:30px;opacity:.95;border: solid 3px #aaa;background-color:#000;width:250px;font-size:28pt;font-weight:bold;padding-top:30px;padding-bottom:30px;margin-bottom:15px;'>" + strOKPrompt + "</div></td>";
            tmpPopupHTML += "<td valign='bottom' align='middle' width='50%' ontouchstart='eval(confirmationBox_CancelCall);confirmationBox_hide();'><div style='border-radius:30px;opacity:.95;border: solid 3px #aaa;background-color:#000;width:250px;font-size:28pt;font-weight:bold;padding-top:30px;padding-bottom:30px;margin-bottom:15px;'>" + strCancelPrompt + "</div></td></tr></table>";


            HtmlDivElement.GetById("divConfirmatonPopup").innerHTML     = tmpPopupHTML;
            HtmlDivElement.GetById("divConfirmatonPopup").style.width   = "600px";
            HtmlDivElement.GetById("divConfirmatonPopup").style.height  = "400px";
            HtmlDivElement.GetById("divConfirmatonPopup").style.display = "block";
        }
コード例 #2
0
ファイル: DOM.cs プロジェクト: zzc000/AngleSharp
        public void HtmlHasRightBodyElement()
        {
            var document = new HtmlDocument();
            var root     = new HtmlHtmlElement(document);

            document.AppendChild(root);
            var body = new HtmlBodyElement(document);

            root.AppendChild(body);
            Assert.AreEqual(body, document.Body);
        }
コード例 #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="code">Error code resulting from a failed media capture operation.</param>
 /// <param name="source">URI to the source.</param>
 /// <param name="target">URI to the target.</param>
 /// <param name="status">HTTP status code. This attribute is only available when a response code is received from the HTTP connection.</param>
 /// <param name="body"></param>
 public FileTransferError(FileTransferErrorCode code, JsString source, JsString target, long status, HtmlBodyElement body = null) { }
コード例 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="code">Error code resulting from a failed media capture operation.</param>
 /// <param name="source">URI to the source.</param>
 /// <param name="target">URI to the target.</param>
 /// <param name="status">HTTP status code. This attribute is only available when a response code is received from the HTTP connection.</param>
 /// <param name="body"></param>
 public FileTransferError(FileTransferErrorCode code, JsString source, JsString target, long status, HtmlBodyElement body = null)
 {
 }