public void OnAlertFromLeftButtonClicked()
    {
        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize("Example with a dialog animation that comes from the left", null, "OK", "Alert!", MaterialIconHelper.GetRandomIcon(), null, null);
        dialog.dialogAnimator = new DialogAnimatorSlide(0.5f, DialogAnimatorSlide.SlideDirection.Left, DialogAnimatorSlide.SlideDirection.Right);
        dialog.Show();
    }
示例#2
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "MainMenu":
            {
                if (T_Helper.user.thisUser == null)
                {
                    UserControlsModule.NavigateContent("Login");
                }
                else
                {
                    UserControlsModule.NavigateContent("MainMenu");
                }
            }
            break;

            case "Settings":
            {
                UserControlsModule.NavigateContent("Settings");
            }
            break;

            case "Logout":
            {
                T_Helper.user.thisUser = null;
                Send("Logout");
                UserControlsModule.NavigateContent("Login");
            }
            break;

            case "Close":
            {
                DialogAlert.exitYasNo();
            }
            break;

            default: break;
            }
        }
示例#3
0
    public void OnAlertFromLeftButtonClicked()
    {
        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize("Example with a dialog animation that comes from the left", null, "OK", "Alert!", MaterialIconHelper.GetRandomIcon(), null, null);

        var oldAnimator = dialog.GetComponent <AbstractTweenBehaviour>() as Component;

        if (oldAnimator != null)
        {
            Object.DestroyImmediate(oldAnimator);
        }

        var animator = dialog.gameObject.AddComponent <EasyFrameAnimator>();

        animator.slideIn           = true;
        animator.slideInDirection  = ScreenView.SlideDirection.Left;
        animator.slideOut          = true;
        animator.slideOutDirection = ScreenView.SlideDirection.Left;

        dialog.Show();
    }
示例#4
0
    static public DialogAlert ShowDialog(string text, Action yesAction, string yesText, Action cancelAction, string cancelText)
    {
        if (dialogAlert != null)
        {
            dialogAlert.Hide();
        }

        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize(text, yesAction, yesText, null, null, cancelAction, cancelText);

        var animator = new DialogAnimatorSlide(0.2f, DialogAnimatorSlide.SlideDirection.Left, DialogAnimatorSlide.SlideDirection.Right);

        animator.backgroundAlpha = 0f;

        dialog.dialogAnimator = animator;
        dialog.ShowModal();

        // 保证单实例
        dialogAlert = dialog;

        return(dialogAlert);
    }
示例#5
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "PageBefore":
            {
                PageThis--;
                Search();
            }
            break;

            case "PageNext":
            {
                PageThis++;
                Search();
            }
            break;

            case "Add":
            {
                VisibilityTableEdit_Visible();
                TableUsersEditViewModel.Send(null);
            }
            break;

            case "Edit":
            {
                VisibilityTableEdit_Visible();
                if (DataGridSelectedItem != null)
                {
                    TableUsersEditViewModel.Send(DataGridSelectedItem);
                }
            }
            break;

            case "Delete":
            {
                try
                {
                    var delete = DialogAlert.Delete();
                    if (delete == MessageBoxResult.OK)
                    {
                        if (DataGridSelectedItem != null)
                        {
                            T_Helper.user.Delete(F_File.GetPropertyInt(DataGridSelectedItem, "ID"));
                        }
                    }
                }
                catch (Exception e)
                {
                    F_File.LogError(e);
                    DialogError.Error();
                }
                Search();
            }
            break;

            //********************************************************************
            case "OverlayGridCancel":
            {
                Visibility_Collapsed();
            }
            break;

            default: break;
            }
        }
示例#6
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "PageBefore":
            {
                PageThis--;
                Search();
            }
            break;

            case "PageNext":
            {
                PageThis++;
                Search();
            }
            break;

            case "Add":
            {
                VisibilityTableEdit_Visible();
                TableWholesalerEditViewModel.Send(null);
            }
            break;

            case "Edit":
            {
                VisibilityTableEdit_Visible();
                if (DataGridSelectedItem != null)
                {
                    TableWholesalerEditViewModel.Send(DataGridSelectedItem);
                }
            }
            break;

            case "Delete":
            {
                try
                {
                    var delete = DialogAlert.Delete();
                    if (delete == MessageBoxResult.OK)
                    {
                        if (DataGridSelectedItem != null)
                        {
                            T_Helper.wholesaler.Delete(F_File.GetPropertyInt(DataGridSelectedItem, "ID"));
                        }
                    }
                }
                catch (Exception e)
                {
                    F_File.LogError(e);
                    DialogError.Error();
                }
                Search();
            }
            break;

            case "MouseDoubleClick":
            {
                if (DataGridSelectedItem != null)
                {
                    int wholesaler_id = F_File.GetPropertyInt(DataGridSelectedItem, "ID");
                    if (ReceiverFrom == KeyStatic.class_.InvoicePurchaseViewModel)
                    {
                        InvoicePurchaseViewModel.Send(new KeyValuePair <string, int>(KeyStatic.view_.wholesaler_id, wholesaler_id));
                        ReceiverFrom = "";
                    }
                    else
                    {
                        MessageBox.Show("ReceiverFrom: error: " + ReceiverFrom);
                    }
                }
            }
            break;

            //********************************************************************
            case "OverlayGridCancel":
            {
                Visibility_Collapsed();
            }
            break;

            default: break;
            }
        }