private void btAdd_Click(object sender, EventArgs e) { if (!SelectedFiles.ContainsValue(txtFileName.Text)) { SelectedFiles.Add(new ComboItem(Path.GetFileName(txtFileName.Text), txtFileName.Text)); LoadListOfFiles(); } else { MessageBox.Show("The file is already in the collection."); } txtFileName.Text = String.Empty; }
/// <summary> /// Creates a new content builder. /// </summary> public ContentBuilder() { CreateTempDirectory(); CreateBuildProject(); Importers = new ComboItemCollection(); //Seguindo a Ordem: Extensão, Importer, Processor Importers.Add(new ComboItem(".mp3", "Mp3Importer", "SongProcessor")); Importers.Add(new ComboItem(".wav", "WavImporter", "SoundEffectProcessor")); Importers.Add(new ComboItem(".wma", "WmaImporter", "SongProcessor")); Importers.Add(new ComboItem(".bmp", "TextureImporter", "TextureProcessor")); Importers.Add(new ComboItem(".jpg", "TextureImporter", "TextureProcessor")); Importers.Add(new ComboItem(".png", "TextureImporter", "TextureProcessor")); Importers.Add(new ComboItem(".tga", "TextureImporter", "TextureProcessor")); Importers.Add(new ComboItem(".dds", "TextureImporter", "TextureProcessor")); Importers.Add(new ComboItem(".spritefont", "FontDescriptionImporter", "FontDescriptionProcessor")); }
private void btAdd_Click(object sender, EventArgs e) { using (var jnl = new OpenFileDialog()) { jnl.Multiselect = true; jnl.Filter = (string)this.cboTipoArquivo.SelectedValue; if (jnl.ShowDialog() == DialogResult.OK) { foreach (var s in jnl.FileNames) { SelectedFiles.Add(new ComboItem(Path.GetFileName(s), s)); LoadListOfFiles(); } } } }