• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DataTransfer.DataTransferManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Windows.ApplicationModel.DataTransfer.DataTransferManager的典型用法代码示例。如果您正苦于以下问题:C# DataTransferManager类的具体用法?C# DataTransferManager怎么用?C# DataTransferManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataTransferManager类属于Windows.ApplicationModel.DataTransfer命名空间,在下文中一共展示了DataTransferManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: DataRequested

        async void DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
        {
            if (this.selectedTrip.LocalPathImage.Equals(loader.GetString("DefaultParentImage")))
            {
                await App.ShowSimpleMessage("You can't share the default trip image", "Sharing photo");
            }
            else
            {
                ParentViewModel trip = MainViewModel.GetSelectedTrip();

                DataPackage requestData = e.Request.Data;
                e.Request.Data.Properties.Title = trip.Title;
                e.Request.Data.Properties.Description = trip.Description;

                // It's recommended to use both SetBitmap and SetStorageItems for sharing a single image
                // since the target app may only support one or the other.
                Uri imageUri = new Uri(selectedTrip.LocalPathImage);

                List<IStorageItem> imageItems = new List<IStorageItem>();
                imageItems.Add(await StorageFile.GetFileFromApplicationUriAsync(imageUri));
                requestData.SetStorageItems(imageItems);

                RandomAccessStreamReference imageStreamRef = RandomAccessStreamReference.CreateFromUri(imageUri);
                requestData.Properties.Thumbnail = imageStreamRef;
                requestData.SetBitmap(imageStreamRef);
            }

        }
开发者ID:soreygarcia,项目名称:Sugges.me,代码行数:28,代码来源:ItemDetailPage.xaml.cs


示例17: ShareLinkHandler

 private void ShareLinkHandler(DataTransferManager sender, DataRequestedEventArgs e)
 {
     DataRequest request = e.Request;
     request.Data.Properties.Title = "Title";
     request.Data.Properties.Description = "Description";
     request.Data.SetWebLink(new Uri(""+ Windows.ApplicationModel.Store.CurrentApp.LinkUri));
 }
开发者ID:mohamedemam0,项目名称:RateAndShare,代码行数:7,代码来源:MainPage.xaml.cs


示例18: OnShareRequested

 private void OnShareRequested(DataTransferManager sender,
     DataRequestedEventArgs args)
 {
     DataPackage data = args.Request.Data;
     data.Properties.Title = _title;
     data.SetText(_content);
 }
开发者ID:JavierErdozain,项目名称:Events,代码行数:7,代码来源:ShareService.cs


示例19: BlankPage_DataRequested

 void BlankPage_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
 {
     var request = args.Request;
     request.Data.Properties.Title = App.ViewModel.SelectedDocument.GetDisplayName();
     request.Data.Properties.Description = string.Format("Created {0}", App.ViewModel.SelectedDocument.GetCreatedDate().ToString("g"));
     request.Data.SetText(_GetCurrentDocumentText());
 }
开发者ID:sourcebits-thrivikramkashyap,项目名称:MetroPad,代码行数:7,代码来源:BlankPage.xaml.cs


示例20: RNShareModule

        /// <summary>
        /// Instantiates the <see cref="RNShareModule"/>.
        /// </summary>
        internal RNShareModule()
        {
            _dataTransferManager = DataTransferManager.GetForCurrentView();
            _dataTransferManager.DataRequested += DataRequested;

            _queue = new Queue<RequestData>();
        }
开发者ID:EstebanFuentealba,项目名称:react-native-share,代码行数:10,代码来源:RNShareModule.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Resources.ResourceLoader类代码示例发布时间:2022-05-26
下一篇:
C# DataTransfer.DataRequestedEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap