/// <summary> /// 画像一覧で選択された画像データに、キーワードを追加する /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Click_AddKeyword(object sender, EventArgs e) { //ListView1.Enabled = false; string keytext = Add_KeywordComboBox.Text; //if(ListView1.SelectedItems.Count == 0) //{ // MessageBox.Show("リストの写真を選択してください", "エラー"); //} try { for (int i = 0; i < PhotoListView.SelectedItems.Count; i++) { int index = PhotoListView.SelectedItems[i].Index; Photo photo = this.photos.ElementAt(index); bool result = addKeyword.Execute(keytext); if (result) { photo = changeKeyword.Execute(photo, keytext); Update_PhotoList(index, photo); } else { //追加をしない } //photo = changeKeyword.Execute(photo, keytext); //Update_PhotoList(index, photo); } } catch (Exception ex) { MessageBox.Show(ex.Message, "エラー"); } //ListView.Enabled = true; }
public Photo ChangeKeyword(Photo photo, string keyword) { return(_changeKeyword.Execute(photo, keyword)); }
public Photo Changekeyword(Photo photo, string keytext) { return(changeKeyword.Execute(photo, keytext)); //済み }