private void tsmiCopyPublicLink_Click(object sender, EventArgs e) { if (lvDropboxFiles.SelectedItems.Count > 0) { DropboxContentInfo content = lvDropboxFiles.SelectedItems[0].Tag as DropboxContentInfo; if (content != null && !content.Is_dir && content.Path.StartsWith("/Public/", StringComparison.InvariantCultureIgnoreCase)) { string url = Dropbox.GetPublicURL(dropboxAccountInfo.Uid, content.Path); ClipboardHelpers.CopyText(url); } } }