本文整理汇总了C#中System.Windows.DataObject.ContainsFileDropList方法的典型用法代码示例。如果您正苦于以下问题:C# DataObject.ContainsFileDropList方法的具体用法?C# DataObject.ContainsFileDropList怎么用?C# DataObject.ContainsFileDropList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.DataObject
的用法示例。
在下文中一共展示了DataObject.ContainsFileDropList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePreviewDropCommand
private void HandlePreviewDropCommand(DataObject droppedObject)
{
if (!droppedObject.ContainsFileDropList()) return;
foreach (var filePath in droppedObject.GetFileDropList())
{
LocalPhotos.Add(new SinglePhotoFlickrMatchesViewModel(filePath, _flickrModel));
}
}
示例2: ClipboardReceived
private void ClipboardReceived(object sender, RunWorkerCompletedEventArgs eventArgs)
{
if (!eventArgs.Cancelled && eventArgs.Error == null)
{
ArrayList data = (ArrayList)eventArgs.Result;
if (data != null)
{
DataObject dataObj = new DataObject();
Console.WriteLine("Count: " + data.Count);
for (int i = 0; i < data.Count; i++)
{
string format = (string)data[i++];
Console.WriteLine(format);
dataObj.SetData(format, data[i]);
}
if (dataObj.ContainsFileDropList())
{
StringCollection files = dataObj.GetFileDropList();
dataObj = new DataObject();
StringCollection adjusted = new StringCollection();
foreach (string f in files)
{
if (!f.StartsWith("\\"))
{
string toadd = "\\\\" + Ip + "\\" + f.Replace(":", "");
Console.WriteLine(toadd);
adjusted.Add(toadd);
}
else
{
adjusted.Add(f);
}
}
dataObj.SetFileDropList(adjusted);
}
Clipboard.SetDataObject(dataObj);
}
}
}
示例3: SetClipboard
public void SetClipboard(string Ip, Object obj)
{
try
{
ArrayList data = (ArrayList)obj;
if (data != null)
{
DataObject dataObj = new DataObject();
Console.WriteLine("Count: " + data.Count);
for (int i = 0; i < data.Count; i++)
{
string format = (string)data[i++];
Console.WriteLine(format);
dataObj.SetData(format, data[i]);
}
if (dataObj.ContainsFileDropList())
{
StringCollection files = dataObj.GetFileDropList();
dataObj = new DataObject();
StringCollection adjusted = new StringCollection();
foreach (string f in files)
{
if (!f.StartsWith("\\"))
{
string toadd = "\\\\" + Ip + "\\" + f.Replace(":", "");
Console.WriteLine(toadd);
adjusted.Add(toadd);
}
else
{
adjusted.Add(f);
}
}
dataObj.SetFileDropList(adjusted);
}
Clipboard.SetDataObject(dataObj);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}