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(); }
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"); } }
public AddedGamesEventArgs(GameKeyItem gamekey, bool isNew) { _result = gamekey; _isNew = isNew; }