Esempio n. 1
0
        public static string Show(TipoMensaje Tipo, string msg, string title, ShowMethod sMethod, HideMethod hMethod,
                                  ShowEasing sEasing, HideEasing hEasing, ToastPosition tPosition, bool btnCerrar)
        {
            string shortCutFunction = GetTipo(Tipo);
            string showEasing       = GetShowEasing(sEasing);
            string hideEasing       = GetHideEasing(hEasing);
            string showMethod       = GetShowMethod(sMethod);
            string hideMethod       = GetHideMethod(hMethod);
            string position         = GetPosition(tPosition);
            int    toastIndex       = 0;
            int    showDuration     = 1000;
            int    hideDuration     = 1000;
            int    timeOut          = 2000;
            int    extendedTimeout  = 1000;

            string ScriptError =
                @"
                    $(document).ready(
                        function() { MensajeError('" + shortCutFunction + "', '"
                + msg + "', '"
                + title + "', "
                + showDuration + ", "
                + hideDuration + ", "
                + timeOut + ", "
                + extendedTimeout + ", '"
                + showEasing + "', '"
                + hideEasing + "', '"
                + showMethod + "', '"
                + hideMethod + "', "
                + toastIndex + ", '"
                + btnCerrar.ToString().ToLower() + "', '"
                + position + @"');});";

            return(ScriptError);
        }
Esempio n. 2
0
        private static string GetShowEasing(ShowEasing t)
        {
            string Tipo = "";

            switch (t)
            {
            case ShowEasing.Swing:
                Tipo = "swing";
                break;

            case ShowEasing.Linear:
                Tipo = "linear";
                break;
            }
            return(Tipo);
        }