Beispiel #1
0
 private void NewRow_DiceUpdated(object sender, DiceEventArgs e)
 {
     App.Log.WriteDebug("Dice updated");
     DiceData = e.DiceData;
     if (e.DoRefresh)
     {
         PopulateRows();
     }
 }
Beispiel #2
0
        private void deleteDice_Click(object sender, RoutedEventArgs e)
        {
            diceArray.Remove(thisDice.UID);
            //SaveData();
            DiceEventArgs ddea = new DiceEventArgs
            {
                DiceData  = diceArray,
                DoRefresh = true
            };

            OnDiceUpdated(ddea);
        }
Beispiel #3
0
        public void Initialize()
        {
            App.Log.WriteDebug("thisDice for " + this.Name + ": " + thisDice);
            isLoading = true;
            try
            {
                nameLabel.Content      = thisDice.Name;
                nameBox.Text           = thisDice.Name;
                diceBox.SelectedValue  = thisDice.Size;
                diceBoxLabel.Content   = thisDice.Size;
                diceCount.Text         = thisDice.Count.ToString();
                diceCountLabel.Content = thisDice.Count.ToString();
                diceAdded.Text         = thisDice.AddAmount.ToString();
                diceAddedLabel.Content = thisDice.AddAmount.ToString();
                empBox.IsChecked       = thisDice.IsEmpowered;
                if (thisDice.LastRoll != 0 || !resetRolls)
                {
                    diceRoll.Content = thisDice.LastRoll.ToString();
                }
                if (!showEmp)
                {
                    empBox.Visibility = Visibility.Hidden;
                }
            }
            catch (Exception ex)
            {
                App.Log.WriteError(ex.Message);
            }
            isLoading = false;

            DiceEventArgs ddea = new DiceEventArgs
            {
                DiceData = diceArray
            };

            OnDiceUpdated(ddea);
        }
Beispiel #4
0
 protected virtual void OnDiceUpdated(DiceEventArgs e)
 {
     DiceUpdated?.Invoke(this, e);
 }