Example #1
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (!Visible || !ChatProtectionHelper.IsSupportChatPanelEnabled() || MembershipContext.SignOutPending)
        {
            Visible = false;

            return;
        }

        // Script references insertion
        ChatScriptHelper.RegisterChatSupportManager(Page);
        ChatScriptHelper.RegisterChatNotificationManager(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/Controls/SupportChatHeader.js");

        // Create and launch startup script.
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "SupportChatHeader_" + ClientID, GetStartupScript(), true);
    }
Example #2
0
    private void UiFormControlOnOnItemValidation(object sender, ref string errorMessage)
    {
        var control = sender as FormEngineUserControl;

        switch (control.Field)
        {
        case "ChatRoomDisplayName":
        case "ChatRoomDescription":
            try
            {
                ChatProtectionHelper.CheckNameForBadWords(control.Value.ToString());
            }
            catch (ChatBadWordsException ex)
            {
                errorMessage = ex.Message;
            }
            break;
        }
    }