本文整理汇总了C#中Windows.ApplicationModel.DataTransfer.DataTransferManager类的典型用法代码示例。如果您正苦于以下问题:C# DataTransferManager类的具体用法?C# DataTransferManager怎么用?C# DataTransferManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataTransferManager类属于Windows.ApplicationModel.DataTransfer命名空间,在下文中一共展示了DataTransferManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PageExplorerDataRequested
private void PageExplorerDataRequested(DataTransferManager sender,
DataRequestedEventArgs args)
{
DataPackage data = args.Request.Data;
DataRequestDeferral waiter = args.Request.GetDeferral();
try
{
List<IStorageItem> files = new List<IStorageItem>();
int index = 0;
foreach (var item in itemGridView.SelectedItems)
{
ExplorerItem explorerItem = (ExplorerItem)item;
if (explorerItem != null)
{
if (index == 0)
{
data.Properties.Title = explorerItem.Name;
RandomAccessStreamReference image = RandomAccessStreamReference.CreateFromFile(explorerItem.StorageFile);
data.Properties.Thumbnail = image;
data.SetBitmap(image);
}
files.Add(explorerItem.StorageFile);
}
index++;
}
data.SetStorageItems(files);
data.SetText("\n");
}
finally
{
waiter.Complete();
}
}
示例2: OnDataRequested
private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
if (GoProFacebookModel != null)
{
GoProFacebookModel.GetShareContent(args.Request);
}
}
示例3: OnDataRequested
private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
if (HeyIsItOnVODModel != null)
{
HeyIsItOnVODModel.GetShareContent(args.Request);
}
}
示例4: OnDataRequested
private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
if (SpecialOffersModel != null)
{
SpecialOffersModel.GetShareContent(args.Request);
}
}
示例5: DataRequested
private void DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
DataRequest request = e.Request;
request.Data.Properties.Title = "";
request.Data.SetText("this app help you to know the best 10 programming languages of every year and learn them by many ways ( books or totrail ) and offer to you all the matraile" + "\n" + (new Uri("ms-windows-store:navigate?appid=" + CurrentApp.AppId)).ToString());
}
示例6: OnDataRequested
private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
if (PolarProModel != null)
{
PolarProModel.GetShareContent(args.Request);
}
}
示例7: DataTransferManager_DataRequested
private void DataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
DataRequest request = args.Request;
request.Data.Properties.Title = "【番剧】"+txt_Name.Text;
request.Data.Properties.Description = txt_Desc.Text + "\r\n——分享自BiliBili UWP";
request.Data.SetWebLink(new Uri("http://bangumi.bilibili.com/anime/" + banID));
}
示例8: ShareLinkHandler
private async void ShareLinkHandler(DataTransferManager sender, DataRequestedEventArgs e)
{
DataRequest request = e.Request;
var uri = string.Format("http://www.last.fm/music/{0}/{1}", Locator.MusicPlayerVM.CurrentArtist?.Name, Locator.MusicPlayerVM.CurrentAlbum?.Name);
var title = string.Format("#NowPlaying {0} - {1}", Locator.MusicPlayerVM.CurrentTrack?.Name, Locator.MusicPlayerVM.CurrentArtist?.Name);
request.Data.Properties.Title = title;
request.Data.Properties.Description = title;
request.Data.SetWebLink(new Uri(uri, UriKind.Absolute));
DataRequestDeferral deferral = request.GetDeferral();
try
{
string fileName = string.Format("{0}.jpg", Locator.MusicPlayerVM.CurrentAlbum.Id);
var albumPic = await ApplicationData.Current.LocalFolder.GetFolderAsync("albumPic");
if (await albumPic.ContainsFileAsync(fileName))
{
var file = await albumPic.GetFileAsync(fileName);
request.Data.SetStorageItems(new List<StorageFile> { file });
}
}
catch
{
deferral.Complete();
}
finally
{
deferral.Complete();
}
}
示例9: OnDataRequested
private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
if (AthleteTipsModel != null)
{
AthleteTipsModel.GetShareContent(args.Request);
}
}
示例10: ShareLinkHandler
private void ShareLinkHandler(DataTransferManager sender, DataRequestedEventArgs args)
{
DataRequest request = args.Request;
request.Data.Properties.Title = "分享博客";
request.Data.Properties.Description = "向好友分享这篇博客";
request.Data.SetWebLink(new Uri(_blog.BlogRawUrl));
}
示例11: ShareLinkHandler
private void ShareLinkHandler(DataTransferManager sender, DataRequestedEventArgs args)
{
DataRequest request = args.Request;
request.Data.Properties.Title = "分享文章[来自UWP应用:知乎日报]";
request.Data.Properties.Description = "向好友分享这篇文章";
request.Data.SetWebLink(new Uri(_viewModel.ShareUrl));
}
示例12: dataTransferManager_DataRequested
private void dataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
if (OnShareRequested != null)
{
OnShareRequested(args.Request.Data);
}
}
示例13: DataRequested
private void DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
DataRequest request = e.Request;
request.Data.Properties.Title = "كلام جرايد";
request.Data.SetText("يقوم هذا البرنامج بتجميع الأخبار من مصادر متنوعة و تقسيمه حسب نوعه ويقوم بعرض العناوين الأخبار فى الصفحة الرئيسية و يقوم ايضا بعرض الخبر كامل من مصدره" + "\n" + (new Uri("ms-windows-store:navigate?appid=" + CurrentApp.AppId)).ToString());
}
示例14: DataTransferManager_DataRequested
private void DataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
DataRequest request = args.Request;
var currentImage = dataContext.AlbumItem.AlbumImages[dataContext.SelectedIndex];
request.Data.Properties.Title = currentImage.Title ?? dataContext.AlbumItem.Title;
request.Data.SetWebLink(new Uri(currentImage.Link));
}
示例15: OnNavigatedTo
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
_dataTransferManager = DataTransferManager.GetForCurrentView();
_dataTransferManager.DataRequested += OnDataRequested;
_navigationHelper.OnNavigatedTo(e);
if (InstagramModel != null)
{
await InstagramModel.LoadItemsAsync();
InstagramModel.SelectItem(e.Parameter);
InstagramModel.ViewType = ViewTypes.Detail;
}
DataContext = this;
// Allow this page to rotate
_currentOrientations = DisplayInformation.AutoRotationPreferences;
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait
| DisplayOrientations.Landscape
| DisplayOrientations.LandscapeFlipped
| DisplayOrientations.PortraitFlipped;
// Handle orientation changes
DisplayInformation.GetForCurrentView().OrientationChanged += this.OnOrientationChanged;
this.TransitionStoryboardState();
}