private void playlistTextBox_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { string playlistName = this.playlistTextBox.Text; if (playlistName.Length > 0) { this.CurrentPlaylist = new SimplePlaylist <Song>(playlistName, null); if (!savedPlaylists.Contains(this.CurrentPlaylist)) { this.savedPlaylists.Add(this.CurrentPlaylist); } var node = this.treeView.Nodes["NodePlaylist"].Nodes.Add(CurrentPlaylist.Name); this.playlistTextBox.Enabled = false; AllowDropChangedEventArgs ea = new AllowDropChangedEventArgs(true); this.OnAllowDropChanged(ea); node.ImageIndex = 1; node.SelectedImageIndex = 1; this.treeView.SelectedNode = node; this.treeView.Select(); } } }
protected void OnAllowDropChanged(AllowDropChangedEventArgs e) { if (AllowDropChanged != null) { AllowDropChanged(this, e); } }