Ejemplo n.º 1
0
        private void btnJoinLeave_Click(object sender, EventArgs e)
        {// this button click flips the Joined boolean property.
            if (_vm_seat.Joined)
            {
                _vm_seat.Joined           = false;
                this.labelChipsCount.Text = "Empty";
                // this.btnJoinLeave.Text = "Join";
                // Leaving the table
                if (JoinedTableEvent != null)
                {
                    JoinedTableEvent.Invoke(this._vm_seat.TableNo, this._vm_seat.SeatNo, -1); // sending negative chipcount to indicate leaving
                }
            }
            else
            {
                ViewModel_SelectMoney x = new ViewModel_SelectMoney();
                x.TotalMoney     = this._vm_seat.UserServices.GetPlayerProfile(this._vm_seat.CurrentUserName).TotalMoneyAvailable;
                x.AvailableMoney = x.TotalMoney - this._vm_seat.UserServices.GetPlayerProfile(this._vm_seat.CurrentUserName).MoneyInPlay;
                decimal selectedmoney = 0;

                using (Dialogs.AddChipsToTable x1 = new Dialogs.AddChipsToTable(x))
                {
                    x1.StartPosition = FormStartPosition.Manual;
                    x1.ShowInTaskbar = false;
                    x1.Location      = this.Parent.PointToScreen(Point.Empty);
                    x1.MaximizeBox   = false;
                    x1.MinimizeBox   = false;
                    DialogResult result = x1.ShowDialog(this);

                    if (result == DialogResult.Cancel)
                    {
                        return;
                    }
                    else
                    {
                        selectedmoney = x1.getModel().SelectedMoney;
                    }
                }


                _vm_seat.Joined           = true;
                this.labelChipsCount.Text = this._vm_seat.CurrentUserName;
                // this.btnJoinLeave.Text = "Leave";
                if (JoinedTableEvent != null)
                {
                    JoinedTableEvent.Invoke(this._vm_seat.TableNo, this._vm_seat.SeatNo, selectedmoney);
                }
            }
        }
Ejemplo n.º 2
0
 public void updateModel(ViewModel_SelectMoney vm)
 {
     _vm = vm;
     refresh();
 }
Ejemplo n.º 3
0
 public AddChipsToTable(ViewModel_SelectMoney vm)
 {
     _vm = vm;
     InitializeComponent();
 }