private void statWeapon_TrackValueChanged(object sender, EventArgs e)
        {
            StatControl s = (StatControl)sender;

            switch (s.ControlText)
            {
            case "Pistol":
                AddressBook.Player.Skills.Weapons.Pistol = s.ControlCurrentValue;
                break;

            case "Silenced Pistol":
                AddressBook.Player.Skills.Weapons.SilencedPistol = s.ControlCurrentValue;
                break;

            case "Desert Eagle":
                AddressBook.Player.Skills.Weapons.DesertEagle = s.ControlCurrentValue;
                break;

            case "Shotgun":
                AddressBook.Player.Skills.Weapons.Shotgun = s.ControlCurrentValue;
                break;

            case "Sawnoff Shotgun":
                AddressBook.Player.Skills.Weapons.SawnoffShotgun = s.ControlCurrentValue;
                break;

            case "Combat Shotgun":
                AddressBook.Player.Skills.Weapons.CombatShotgun = s.ControlCurrentValue;
                break;

            case "Machine Pistol":
                AddressBook.Player.Skills.Weapons.MachinePistol = s.ControlCurrentValue;
                break;

            case "SMG":
                AddressBook.Player.Skills.Weapons.SMG = s.ControlCurrentValue;
                break;

            case "AK47":
                AddressBook.Player.Skills.Weapons.AK47 = s.ControlCurrentValue;
                break;

            case "M4":
                AddressBook.Player.Skills.Weapons.M4 = s.ControlCurrentValue;
                break;

            default:
                throw new ArgumentException();
            }

            UpdateValues();
        }
        public StatControlView(StatControl i_Control) : base(i_Control as ExControl)
        {
            this._StatInfos = new StatInfoCollection();

            this._StatInfos.Add(new StatInfo());

            this._Fitler = new Webb.Data.DBFilter();

            this._Styles = new ExControlStyles();

            this._Styles.RowStyle.Sides = DevExpress.XtraPrinting.BorderSide.None;

            this._Styles.AlternateStyle.Sides = DevExpress.XtraPrinting.BorderSide.None;

            this._Multiline = true;

            this._Overlap = true;

            _AdjustWidth = false;
        }
 private void SetStatControlText(StatControl control, float value)
 {
     control.SetText(value.ToString("F2"));
 }
Esempio n. 4
0
 // 통계 창 표시 함수
 private void TbStats_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     StatControl.Visibility = Visibility.Visible;
     StatControl.Load();
 }
Esempio n. 5
0
        /// <summary>
        /// Resets all controls on a specified form
        /// </summary>
        /// <param name="form">Form to reset</param>
        public static void ResetAllControls(Control form)
        {
            foreach (Control control in form.Controls)
            {
                if (control.Tag == null)
                {
                    PerformReset(control);
                }
                else if (!control.Tag.ToString().Contains("NoReset"))
                {
                    PerformReset(control);
                }
            }

            void PerformReset(Control control)
            {
                if (control is TextBox)
                {
                    TextBox textBox = (TextBox)control;
                    textBox.Text = null;
                }

                if (control is ComboBox)
                {
                    ComboBox comboBox = (ComboBox)control;
                    if (comboBox.Items.Count > 0)
                    {
                        comboBox.SelectedIndex = 0;
                    }
                }

                if (control is CheckBox)
                {
                    CheckBox checkBox = (CheckBox)control;
                    checkBox.Checked = false;
                }

                if (control is ListBox)
                {
                    ListBox listBox = (ListBox)control;
                    listBox.ClearSelected();
                }

                if (control is Label)
                {
                    if (control.Name.StartsWith("lbl"))
                    {
                        control.Text = "0";
                    }
                }

                if (control is TrackBar)
                {
                    TrackBar trackBar = (TrackBar)control;
                    trackBar.Value = 0;
                }

                if (control is StatControl)
                {
                    StatControl statControl = (StatControl)control;
                    statControl.ControlCurrentValue = 0;
                }
            }
        }