Here are the examples of the csharp api class System.Windows.Forms.Clipboard.SetFileDropList(System.Collections.Specialized.StringCollection) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
8 Examples
0
1. Example
View licenseprivate void CopyFile() { try { if (GlobalSetting.IsImageError || !File.Exists(GlobalSetting.ImageList.GetFileName(GlobalSetting.CurrentIndex))) { return; } } catch { return; } GlobalSetting.StringClipboard = new StringCollection(); GlobalSetting.StringClipboard.Add(GlobalSetting.ImageList.GetFileName(GlobalSetting.CurrentIndex)); Clipboard.SetFileDropList(GlobalSetting.StringClipboard); DisplayTextMessage( string.Format(GlobalSetting.LangPack.Items["frmMain._CopyFileText"], GlobalSetting.StringClipboard.Count), 1000); }
0
2. Example
View licenseprivate void CopyMultiFiles() { try { if (GlobalSetting.IsImageError || !File.Exists(GlobalSetting.ImageList.GetFileName(GlobalSetting.CurrentIndex))) { return; } } catch { return; } //get filename string filename = GlobalSetting.ImageList.GetFileName(GlobalSetting.CurrentIndex); //exit if duplicated filename if (GlobalSetting.StringClipboard.IndexOf(filename) != -1) { return; } //add filename to clipboard GlobalSetting.StringClipboard.Add(filename); Clipboard.SetFileDropList(GlobalSetting.StringClipboard); DisplayTextMessage( string.Format(GlobalSetting.LangPack.Items["frmMain._CopyFileText"], GlobalSetting.StringClipboard.Count), 1000); }
0
3. Example
View licenseprivate static void SaveClipboardPicture(IList<object> copiedObjs) { try { Logger.Log("Save clipboard begins."); foreach (var copiedObj in copiedObjs) { if (copiedObj == null) { continue; } if (copiedObj is Image) { Clipboard.SetImage((Image)copiedObj); } else if (copiedObj is StringCollection) { Clipboard.SetFileDropList((StringCollection)copiedObj); } else if (!string.IsNullOrEmpty(copiedObj as string)) { Clipboard.SetText((string)copiedObj); } } Logger.Log("Save clipboard done."); } catch (Exception e) { // sometimes Clipboard may fail Logger.LogException(e, "SaveClipboardPicture"); } }
0
4. Example
View licenseprotected override void EndProcessing() { ExecuteWrite(delegate { switch (ParameterSetName) { case ParamSetFiles: if (_paths.Count == 0) WinFormsClipboard.Clear(); else WinFormsClipboard.SetFileDropList(_paths); break; case ParamSetImage: if (_image == null) WinFormsClipboard.Clear(); else WinFormsClipboard.SetImage(_image); break; case ParamSetRtf: SetTextContents(_rtf, TextDataFormat.Rtf); break; case ParamSetHtml: SetTextContents(_html, TextDataFormat.Html); break; default: SetTextContents(_text, TextDataFormat.UnicodeText); break; } }); }
0
5. Example
View licensepublic void CopyFile() { Thread thread = new Thread(() => { System.Collections.Specialized.StringCollection files = new System.Collections.Specialized.StringCollection(); files.Add(File); Clipboard.SetFileDropList(files); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
0
6. Example
View licenseprivate void CopyAsFile(string output) { string fileName = this.PasteFileName; if (String.IsNullOrEmpty(fileName)) { fileName = Path.ChangeExtension(Path.GetRandomFileName(), ".txt"); } // illegal characters in filename? if (Array.TrueForAll( Path.GetInvalidFileNameChars(), invalidChar => !fileName.Contains(invalidChar.ToString())) == false) { ErrorHandler.ThrowIllegalCharsInPath(this.PasteFileName); } byte[] buffer = Encoding.UTF8.GetBytes(output); WriteVerbose( String.Format( "Constructing file '{0}.' Length is {1} byte(s).", fileName, buffer.Length)); string tempFile = Path.Combine(Path.GetTempPath(), fileName); using (var stream = FileHandler.OpenWrite(tempFile, false, true, true)) { stream.Write(buffer, 0, buffer.Length); } ExecuteWrite( () => Clipboard.SetFileDropList( new StringCollection {tempFile})); }
0
7. Example
View licensestatic int CUIExec(bool q, List<string> files) { IOutputController Output = new CU/n ..... /n //View Source file for more details /n }
0
8. Example
View licenseprivate void convertWorker_DoWork(object sender, DoWorkEventArgs e) { Properties.Setting/n ..... /n //View Source file for more details /n }