当前位置: 首页>>代码示例>>C#>>正文


C# DataTransfer.DataTransferManager类代码示例

本文整理汇总了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();
            }
        }
开发者ID:CasaTeam,项目名称:MetroExplorer,代码行数:34,代码来源:PageExplorerSearchShare.cs

示例2: OnDataRequested

 private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
 {
     if (GoProFacebookModel != null)
     {
         GoProFacebookModel.GetShareContent(args.Request);
     }
 }
开发者ID:jookie,项目名称:Gaj2,代码行数:7,代码来源:GoProFacebookDetailPage.xaml.cs

示例3: OnDataRequested

 private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
 {
     if (HeyIsItOnVODModel != null)
     {
         HeyIsItOnVODModel.GetShareContent(args.Request);
     }
 }
开发者ID:KonradIT,项目名称:HeyIsItOn,代码行数:7,代码来源:HeyIsItOnVODDetailPage.xaml.cs

示例4: OnDataRequested

 private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
 {
     if (SpecialOffersModel != null)
     {
         SpecialOffersModel.GetShareContent(args.Request);
     }
 }
开发者ID:compkos,项目名称:Menu,代码行数:7,代码来源:SpecialOffersDetailPage.xaml.cs

示例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());
        }
开发者ID:MohamedELSaQeR,项目名称:My-Apps,代码行数:7,代码来源:about.xaml.cs

示例6: OnDataRequested

 private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
 {
     if (PolarProModel != null)
     {
         PolarProModel.GetShareContent(args.Request);
     }
 }
开发者ID:jookie,项目名称:Gaj2,代码行数:7,代码来源:PolarProPage.xaml.cs

示例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));
 }
开发者ID:GeminiLab,项目名称:BiliBili-UWP,代码行数:7,代码来源:BanInfoPage.xaml.cs

示例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();
            }
        }
开发者ID:robUx4,项目名称:vlc-winrt,代码行数:30,代码来源:ShareNowPlayingMusicCommand.cs

示例9: OnDataRequested

 private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
 {
     if (AthleteTipsModel != null)
     {
         AthleteTipsModel.GetShareContent(args.Request);
     }
 }
开发者ID:KonradIT,项目名称:BePro,代码行数:7,代码来源:AthleteTipsDetailPage.xaml.cs

示例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));
 }
开发者ID:BourbonShi,项目名称:CNBlogs.UWP,代码行数:7,代码来源:BlogContentPage.xaml.cs

示例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));
 }
开发者ID:Mukosame,项目名称:ZhihuDaily,代码行数:7,代码来源:ContentPage.xaml.cs

示例12: dataTransferManager_DataRequested

		private void dataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
		{
			if (OnShareRequested != null)
			{
				OnShareRequested(args.Request.Data);
			}
		}
开发者ID:JacobAtchley,项目名称:MyVote,代码行数:7,代码来源:ShareManager.cs

示例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());
        }
开发者ID:MohamedELSaQeR,项目名称:My-Apps,代码行数:7,代码来源:about_page.xaml.cs

示例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));
 }
开发者ID:nilsbenson,项目名称:MonocleGiraffe,代码行数:7,代码来源:AlbumPage.xaml.cs

示例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();
        }
开发者ID:Hackaju,项目名称:App_Hackaju_WP,代码行数:27,代码来源:InstagramDetailPage.xaml.cs


注:本文中的Windows.ApplicationModel.DataTransfer.DataTransferManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。