Ejemplo n.º 1
0
        private void OnOpenFile()
        {
            var dlg = new OpenFileDialog();

            dlg.Filter = "Hex files (*.hex) | *.hex";
            if (dlg.ShowDialog().GetValueOrDefault())
            {
                try
                {
                    long size = (settings.MemoryType == MemoryType.FLASH)
                        ? settings.SettingsInfo.Processor.FlashSize
                        : settings.SettingsInfo.Processor.EepromSize;
                    IMemory memory = new Memory(size);
                    hexFileManager.OpenFile(dlg.FileName, memory);
                    var hfvm = new HexFileViewModel(memory, dlg.FileName, this);
                    _files.Add(hfvm);
                    ActiveDocument = hfvm;
                }
                catch (Exception ex)
                {
                    NotificationOpenViewModel vm = new NotificationOpenViewModel(ex.Message);
                    NotificationView          v  = new NotificationView(vm);
                    v.Owner = Application.Current.MainWindow;
                    v.ShowDialog();
                }
                RaiseCanExecuteChanged();
            }
        }
Ejemplo n.º 2
0
        private bool ShowDialog(NotificationViewModel vm)
        {
            var v = new NotificationView(vm);

            v.Owner = Application.Current.MainWindow;
            return((bool)v.ShowDialog());
        }
Ejemplo n.º 3
0
    public void DoJoinLobby(GameObject go)
    {
        if (Common.ValidateChipToBetting(lobby.betting, GameManager.PlayGoldOrChip) == false)
        {
            int rule = Common.RULE_CHIP_COMPARE_BETTING;
            Common.MessageRecharge("Số tiền của bạn phải lớn hơn hoặc bằng " + rule + " lần tiền cược.");
            return;
        }

        GetComponent <CUIHandle>().StopImpact(2f);

        if (lobby.numberUserInRoom == lobby.maxNumberPlayer)
        {
            NotificationView.ShowMessage("Bàn chơi đã đầy. Xin vui lòng tìm bàn chơi khác.", 2f);
            return;
        }
        GameManager.Instance.selectedLobby = lobby;

        if (lobby.isPassword)
        {
            NotificationView.ShowDialog("Nhập mật khẩu để truy cập bàn chơi", ProcessInputPassword);
        }
        else
        {
            ProcessInputPassword("");
        }
    }
Ejemplo n.º 4
0
    public void DoJoinLobby(GameObject go)
    {
        if (CommonTLMN.ValidateChipToBetting(lobby.betting, lobby.config.GAME_TYPE_TLMN) == false)
        {
            int rule = lobby.config.GAME_TYPE_TLMN == LobbyTLMN.GameConfig.GameTypeLTMN.XEP_HANG ? CommonTLMN.RULE_XEP_HANG_CHIP_COMPARE_BETTING : CommonTLMN.RULE_DEM_LA_CHIP_COMPARE_BETTING;
            Common.MessageRecharge("Số tiền của bạn phải lớn hơn hoặc bằng " + rule + " lần tiền cược.");
            return;
        }

        GetComponent <CUIHandle>().StopImpact(2f);

        if (lobby.numberUserInRoom == lobby.maxNumberPlayer)
        {
            NotificationView.ShowMessage("Bàn chơi đã đầy. Xin vui lòng tìm bàn chơi khác.", 2f);
            return;
        }

        Debug.Log("DoJoinLobby zone,room,lobby: " + lobby.zoneId + "," + lobby.roomId + "," + lobby.gameId);
        GameManager.Instance.selectedLobby = lobby;

        if (lobby.isPassword)
        {
            NotificationView.ShowDialog("Nhập mật khẩu để truy cập bàn chơi.", ProcessInputPassword);
        }
        else
        {
            ProcessInputPassword("");
        }
    }