private void ExecuteOpenImageFile() { System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog(); openFileDialog.Filter = "PNG Files (.png)|*.png|JPG Files (.jpg)|*.jpg|JPEG Files (.jpeg)|*.jpeg|All Files (*.*)|*.*"; openFileDialog.FilterIndex = 1; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.Image NewImage = new Model.Image(openFileDialog.FileName); ImageList.Add(NewImage); XMLMedia XMLImage = new XMLMedia(); XMLImage.LoadXML("Image.xml"); XMLImage.AddMedia(NewImage); XMLImage.WriteXML("Image.xml"); } }
private void ExecuteOpenVideoFile() { System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog(); openFileDialog.Filter = "MP4 Files (.mp4)|*.mp4|WMV Files (.wmv)|*.wmv"; openFileDialog.FilterIndex = 1; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.Video NewVideo = new Model.Video(openFileDialog.FileName); VideoList.Add(NewVideo); XMLMedia XMLVideo = new XMLMedia(); XMLVideo.LoadXML("Video.xml"); XMLVideo.AddMedia(NewVideo); XMLVideo.WriteXML("Video.xml"); } }
private void ExecuteOpenMusicFile() { System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog(); openFileDialog.Filter = "MP3 Files (.mp3)|*.mp3|All Files (*.*)|*.*"; openFileDialog.FilterIndex = 1; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.Music NewMusic = new Model.Music(openFileDialog.FileName); MusicList.Add(NewMusic); XMLMedia XMLMusic = new XMLMedia(); XMLMusic.LoadXML("Music.xml"); XMLMusic.AddMedia(NewMusic); XMLMusic.WriteXML("Music.xml"); } }