Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 86 additions & 87 deletions RemoteApplicationPublisher/RemoteAppMainWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 12 additions & 15 deletions RemoteApplicationPublisher/RemoteAppMainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace RemoteApplicationPublisher
{
public partial class RemoteAppMainWindow : Form
{
private string clipboardText = string.Empty;

public RemoteAppMainWindow()
{
InitializeComponent();
Expand Down Expand Up @@ -200,24 +202,10 @@ private void aboutToolStripMenuItem1_Click(object sender, EventArgs e)
remoteAppAboutWindow.ShowDialog();
}

private void AppList_MouseClick(object sender, MouseEventArgs e)
{
// if (e.Button == MouseButtons.Right)
// {
// var item = AppList.HitTest(e.Location).Item;
// if (item != null)
// {
// AppList.FocusedItem = item;
// listViewContextMenuStrip.Show(AppList, e.Location);
// }
// }
}

private void copyToClipboardToolStripMenuItem_Click(object sender, EventArgs e)
{
if (AppList.FocusedItem != null)
{
var clipboardText = AppList.FocusedItem.Text;
Clipboard.SetText(clipboardText);
}
}
Expand All @@ -226,11 +214,20 @@ private void AppList_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
var hittest = AppList.HitTest(e.Location);
var item = AppList.HitTest(e.Location).Item;
if (item != null)
{
AppList.FocusedItem = item;
clipboardText = string.Empty;

foreach (var i in item.SubItems)
{
if (((ListViewItem.ListViewSubItem)i).Bounds.Contains(e.Location))
{
clipboardText = ((ListViewItem.ListViewSubItem)i).Text;
}
}

listViewContextMenuStrip.Show(AppList, e.Location);
}
}
Expand Down
Loading