Ejemplo 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);
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            switch (Op)
            {
            case Form1.TOperationType.add:
                AddItem(myType, this);
                break;

            case Form1.TOperationType.edit:
                EditItem(fieldInd, myType, this);
                break;

            case Form1.TOperationType.delete:
                DeleteItem(fieldInd);
                break;
            }
            ShowMethod show = ShowList;

            show.Invoke(this);
            show += reNewComboBox;
            if (ParentForm != null)
            {
                show.Invoke(ParentForm);
            }
            else
            {
                show.Invoke(this);
            }
            this.Close();
        }
Ejemplo n.º 3
0
        private static string GetShowMethod(ShowMethod t)
        {
            string Tipo = "";

            switch (t)
            {
            case ShowMethod.FadeIn:
                Tipo = "fadeIn";
                break;

            case ShowMethod.SlideDown:
                Tipo = "slideDown";
                break;

            case ShowMethod.Show:
                Tipo = "show";
                break;
            }
            return(Tipo);
        }
Ejemplo n.º 4
0
        static void Test3()
        {
            //10+5 = 15
            Console.WriteLine("Enter string");
            string str  = Console.ReadLine();
            char   Sign = ' ';

            try
            {
                if (str.Contains('+'))
                {
                    Sign = '+';
                }
                else if (str.Contains('-'))
                {
                    Sign = '-';
                }
                else if (str.Contains('*'))
                {
                    Sign = '*';
                }
                else if (str.Contains('/'))
                {
                    Sign = '/';
                }
                else
                {
                    Sign = ' ';
                }
                string[] numbers = str.Split(Sign, StringSplitOptions.RemoveEmptyEntries);
                double   av      = double.Parse(numbers[0]);
                double   bv      = double.Parse(numbers[1]);

                MathMethod mathod = null;

                switch (Sign)
                {
                case '+':
                    mathod = (a, b) => a + b;
                    break;

                case '-':
                    mathod = (a, b) => a - b;
                    break;

                case '*':
                    mathod = (a, b) => a * b;
                    break;

                case '/':
                    mathod = (a, b) => a / b;
                    break;
                }
                //Console.WriteLine(mathod(a, b));
                Console.WriteLine(mathod?.Invoke(av, bv));

                ShowMethod sm = d => Console.WriteLine($"d={d}");

                Show show = () => Console.WriteLine($"Hello");

                show += () => Console.WriteLine($"By");

                sm(159.36);
                show();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }