Beispiel #1
0
        public frmAddGame(GameKeyItem gameKeyItem)
        {
            InitializeComponent();

            isNew             = false;
            this._gameKeyItem = gameKeyItem;
            txtName.Text      = gameKeyItem.Title;

            var result = from row in gameKeyItem.KeysList select new { Key = row };

            dgvKeys.DataSource = result.ToArray();
        }
Beispiel #2
0
        private void AddKey(string key)
        {
            //Add new Key
            string steamkeyPattern = "([a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5})";

            if (key != string.Empty && Regex.IsMatch(txtKey.Text, steamkeyPattern))
            {
                if (_gameKeyItem == null && isNew)
                {
                    _gameKeyItem = new GameKeyItem
                    {
                        KeysList = new List <string>()
                    };
                }
                _gameKeyItem.KeysList.Add(txtKey.Text);
                ReloadKeyGrid();
            }
            else
            {
                MessageBox.Show("No proper Key entered");
            }
        }
Beispiel #3
0
 public AddedGamesEventArgs(GameKeyItem gamekey, bool isNew)
 {
     _result = gamekey;
     _isNew  = isNew;
 }