在Visual Studio 2008中进行拼写检查

时间:2012-07-30 16:35:21

标签: javascript asp.net visual-studio-2008

我通过互联网浏览了几件事,我无法弄清楚visual studio 2008是否支持拼写检查选项,例如visual studio 2010在工具箱中有拼写检查按钮选项...如果可以的话有人建议我一种方式,我可以使它可用于电子邮件消息(我想在发送之前使用电子邮件的拼写检查选项)....是否与服务包2有关....

以下是我的应用程序中发送电子邮件的代码,我需要拼写检查邮件的正文,因为这是我们输入文本的唯一地方

private void setEmailValues()
    {
        var eml = new EmailInformation
        {
            SendTo = this.ctlDocDelivery.EmailAddresses,
            SendCc = this.ctlDocDelivery.CC,
            SendBcc = this.ctlDocDelivery.BCC,
            Subject = this.ctlDocDelivery.Subject,
            Body = this.ctlDocDelivery.MessageBody,
            SendAsAttachment = (this.ctlDocDelivery.SendAs == DocumentDeliveryControl.SendAsSelections.ATTACHMENT),
            DoNotSend = !this.ctlDocDelivery.ShowEmailPanel
        };

        // Mark as do not send if we're not showing the email panel:
        this.setApproverSecondApproverValues();

        Session[AppConstants.SK_EMAILINFORMATION] = eml;
    }

    private void setApproverSecondApproverValues()
    {
        var acct = (Account) Session[AppConstants.SK_ACTION_ACCOUNT];

        if (ctlDocDelivery.ShowApprovalPanel)
        {
            acct.CurrentRisk.ApprovedById = ctlDocDelivery.ApprovalUnderwriterId;
            acct.CurrentRisk.ApprovedDate = ctlDocDelivery.ApprovalDate;
        }

        if (!this.ctlDocDelivery.ShowSecondApprovalPanel)
            return;

        acct.CurrentRisk.SecondApprovedById = this.ctlDocDelivery.SecondApprovalUnderwriterId;
        acct.CurrentRisk.SecondApprovedDate = this.ctlDocDelivery.SecondApprovalDate;
    }

    private void cleanUpCachedEntities()
    {
        var formSessionKeys = (ArrayList) Session[AppConstants.SK_FORM_SESSION_KEYS];

        foreach (string sessionKey in formSessionKeys)
            Session.Remove(sessionKey);
    }

    private void generatePageScripts()
    {
        if (Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "DocumentDelivery"))
            return;

        var sb = new StringBuilder(2048);

        sb.AppendFormat("function {0}_OnClick() {{" + Environment.NewLine, this.ctlDocDelivery.ChkBoxAllReviewsCompletedClientID);
        sb.AppendLine("    var chkBox = document.getElementById('" + this.ctlDocDelivery.ChkBoxAllReviewsCompletedClientID + "');");
        sb.AppendLine("    var btnSendForReview = ig_getWebControlById('" + this.btnSendforReview.ClientID + "');");
        sb.AppendLine("    var btnRelease = ig_getWebControlById('" + this.btnRelease.ClientID + "');");
        sb.AppendLine("    var gbBxDlvryInfo = document.getElementById('" + this.ctlDocDelivery.gbBoxDeliveryInfoClientID + "');");

        sb.AppendLine("    var txtToBox = document.getElementById('" + this.ctlDocDelivery.txtToClientId + "');");
        sb.AppendLine("    var txtCCBox = document.getElementById('" + this.ctlDocDelivery.txtCCClientId + "');");
        sb.AppendLine("    var txtBCCBox = document.getElementById('" + this.ctlDocDelivery.txtBCCClientId + "');");
        sb.AppendLine("    var txtSubBox = document.getElementById('" + this.ctlDocDelivery.txtSubClientId + "');");
        sb.AppendLine("    var txtBodyBox = document.getElementById('" + this.ctlDocDelivery.txtMsgBodyClientId + "');");

        sb.AppendLine("    if (txtToBox !== null) txtToBox.disabled = !chkBox.checked;");
        sb.AppendLine("    if (txtCCBox !== null) txtCCBox.disabled = !chkBox.checked;");
        sb.AppendLine("    if (txtBCCBox !== null) txtBCCBox.disabled = !chkBox.checked;");
        sb.AppendLine("    if (txtSubBox !== null) txtSubBox.disabled = !chkBox.checked;");
        sb.AppendLine("    if (txtBodyBox !== null) txtBodyBox.disabled = !chkBox.checked;");

        sb.AppendLine("    btnSendForReview.setEnabled(!chkBox.checked);");
        sb.AppendLine("    var elemBtnSendForRev = btnSendForReview.getElement();");
        sb.AppendLine("    btnRelease.setEnabled(chkBox.checked);");
        sb.AppendLine("    var elemBtnRel = btnRelease.getElement();");
        sb.AppendLine("");
        sb.AppendLine("    if(btnSendForReview.getEnabled())");
        sb.AppendLine("      elemBtnSendForRev.style.cursor = 'hand';");
        sb.AppendLine("    else");
        sb.AppendLine("      elemBtnSendForRev.style.cursor = 'auto';");
        sb.AppendLine("");
        sb.AppendLine("    var lblNotificationMessage = document.getElementById('" + this.ctlDocDelivery.lblNotificationMessageClientId + "');");
        sb.AppendLine("    var tblNotificationMessage = document.getElementById('" + this.ctlDocDelivery.tblNotificationMessageClientId + "');");
        sb.AppendLine("    if(btnRelease.getEnabled())");
        sb.AppendLine("    {");

        var acct = (Account) this.Session[AppConstants.SK_ACTION_ACCOUNT];
        var displayNotificationMessage = acct.CurrentRisk
                                             .ValidationResults
                                             .Cast<ValidationResult>()
                                             .Any(validationResult => validationResult.ValidationTypeId == (int) EnumValidationType.NOTIFICATION);

        if (displayNotificationMessage)
            sb.AppendLine("             tblNotificationMessage.style.visibility = 'visible';");

        sb.AppendLine("         elemBtnRel.style.cursor = 'hand';");
        sb.AppendLine("    }");
        sb.AppendLine("    else");
        sb.AppendLine("    {");
        sb.AppendLine("         tblNotificationMessage.style.visibility = 'hidden';");
        sb.AppendLine("         elemBtnRel.style.cursor = 'auto';");
        sb.AppendLine("    }");
        sb.AppendLine("");
        sb.AppendLine("    if(gbBxDlvryInfo !== null) gbBxDlvryInfo.disabled = !chkBox.checked;");
        sb.AppendLine("}");

        var chkAllReviewsCompleted = this.Page.FindControl(this.ctlDocDelivery.ChkBoxAllReviewsCompletedUniqueID) as CheckBox;
        chkAllReviewsCompleted.Attributes["onclick"] = this.ctlDocDelivery.ChkBoxAllReviewsCompletedClientID + "_OnClick();";

        this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "DocumentDelivery", sb.ToString(), true);
    }
    #endregion
}

0 个答案:

没有答案