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


C# Xamarin.GetShareUI方法代码示例

本文整理汇总了C#中Xamarin.GetShareUI方法的典型用法代码示例。如果您正苦于以下问题:C# Xamarin.GetShareUI方法的具体用法?C# Xamarin.GetShareUI怎么用?C# Xamarin.GetShareUI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Xamarin的用法示例。


在下文中一共展示了Xamarin.GetShareUI方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Sharing

        void Sharing(Xamarin.Social.Service service, Button shareButton)
        {
            Item item = new Item {
                Text = "I'm sharing great things using Xamarin!"
            };

            Intent intent = service.GetShareUI (this, item, shareResult => {
                shareButton.Text = service.Title + " shared: " + shareResult;
            });

            StartActivity (intent);
        }
开发者ID:Pat-Dolan,项目名称:CMPS285_Team7,代码行数:12,代码来源:MainActivity.cs

示例2: Share

		void Share (Xamarin.Social.Service service)
		{
			if (fileName == string.Empty || fileName == "in-progress")
				return;

			// 2. Create an item to share
			var text = "Xamarin.SoMA ... Social Mobile & Auth! ";
			if (shareItem != null) { // use the existing one passed to the activity
				text = shareItem.Text;
				fileName = shareItem.ImagePath;
				location = shareItem.Location;
			}
			var item = new Item { Text = text };
			item.Images.Add (new ImageData (fileName));
			if (isLocationSet)
				item.Links.Add (new Uri ( "https://maps.google.com/maps?q=" + location));

			// 3. Present the UI on Android
			var shareIntent = service.GetShareUI (this, item, result => {
				// result lets you know if the user shared the item or canceled
				if (result == ShareResult.Cancelled)
					return;

				Console.WriteLine ("{0} shared", service.Title);

				// 4. Now save to the database for the MainScreen list
				var si = new ShareItem {
					Text = item.Text, // get the edited text from the share UI
					ImagePath = fileName,
					Location = location
				};
				if (item.Links.Count > 0) si.Link = item.Links[0].AbsoluteUri;
				si.SocialType = service.Title;

				App.Database.SaveItem(si);
				shareItem = si; // replace the one in the activity
			});
			StartActivity (shareIntent);
		}
开发者ID:mansourb7,项目名称:mobile-samples,代码行数:39,代码来源:PhotoScreen.cs

示例3: Share

		//Evento de publicacion Estado
		void Share (Xamarin.Social.Service service, string textshare)
		{
			Item item = new Item {
				Text = textshare,
			};

			Intent intent = service.GetShareUI (this, item, shareResult => {
				RunOnUiThread(()=>{
					Toast.MakeText(this, shareResult.ToString(), ToastLength.Short).Show();
				});
			});

			StartActivity (intent);
		}
开发者ID:EnriqueProinfo,项目名称:Mono,代码行数:15,代码来源:ShareActivity.cs

示例4: ShareImage

		//Evento de publicacion Fotografia
		void ShareImage (Xamarin.Social.Service service, string textshare)
		{
			Item item = new Item {
				Text = textshare,
			};
			item.Images.Add(new ImageData(BitmapFactory.DecodeFile(_Archivo.AbsoluteFile.ToString())));
			Intent intent = service.GetShareUI (this, item, shareResult => {
				RunOnUiThread(()=>{
					Toast.MakeText(this, shareResult.ToString(), ToastLength.Short).Show();
				});
			});

			StartActivity (intent);
		}
开发者ID:EnriqueProinfo,项目名称:Mono,代码行数:15,代码来源:ShareActivity.cs

示例5: ShareLink

		//Evento de publicacion Estado+Link
		void ShareLink (Xamarin.Social.Service service, string textshare)
		{
			Item item = new Item {
				Text = textshare,
				Links = new List<Uri> {
					new Uri ("http://alejandroruizvarela.blogspot.mx/"),
				},
			};

			Intent intent = service.GetShareUI (this, item, shareResult => {
				RunOnUiThread(()=>{
					Toast.MakeText(this, shareResult.ToString(), ToastLength.Short).Show();
				});
			});

			StartActivity (intent);
		}
开发者ID:EnriqueProinfo,项目名称:Mono,代码行数:18,代码来源:ShareActivity.cs


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