//ContextMenu private void MyTweetLabel_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (status.User.Id == Properties.Settings.Default.UserId) { MyActionMenu.Show(this, PointToClient(Cursor.Position)); } else { ActionMenu.Show(this, PointToClient(Cursor.Position)); } } }
private async void ActionMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { switch (e.ClickedItem.ToString()) { case "通神帯接続": ActionMenu.Close(); if (innerUrl != "") { Process.Start(innerUrl); } else { MessageBox.Show("リンクが無いよ"); } break; case "会話を表示": ActionMenu.Close(); if (status.InReplyToStatusId != null) { // すでに出ているMentionFrameが無いか検索 MentionFrame existFrame = null; foreach (var mentionFrame in TwitterTools.mentionFrameList) { var replies = mentionFrame.GetStatus(); foreach (var reply in replies) { if (status.Equals(reply)) { existFrame = mentionFrame; } } } // 無かったら新規に表示 if (existFrame == null) { MentionFrame mFrame = new MentionFrame(status); TwitterTools.mentionFrameList.Add(mFrame); mFrame.Show(); } else { existFrame.Activate(); } } else { MessageBox.Show("会話が無いよ"); } break; case "削除": MyActionMenu.Close(); bool res = await TwitterTools.DestroyStatus(status); if (res) { BackColor = Color.FromArgb(150, 150, 150); NameLabel.ForeColor = Color.FromArgb(1, 1, 1); } break; default: break; } }