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


C# DialogViewController.SetToolbarItems方法代码示例

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


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

示例1: FinishedLaunching


//.........这里部分代码省略.........
			_downloader.Progress += (progress) => {
				float percent = (progress.Written / (float)progress.Total) * 100;
				int ipercent = (int)percent;
				string caption = string.Format("{0} {1} {2}% ({3} / {4})", 
					"Global", 
					progress.State.ToString(),
					ipercent,
					progress.Written,
					progress.Total
				);
				InvokeOnMainThread(() => {
					globalprogress.Caption = caption;
					globalprogress
						.GetImmediateRootElement()
						.Reload(globalprogress, UITableViewRowAnimation.Automatic);
				});
			};
			
			_sample = new DialogViewController (root);

			var add = new UIBarButtonItem ("Add", 
				UIBarButtonItemStyle.Bordered, 
				 (sender, e) => {
					string url = string.Format(templateurl, 1);
				 Add(url);
			});
			
			var addall = new UIBarButtonItem ("All", 
				UIBarButtonItemStyle.Bordered, 
				 (sender, e) => {
					for(int i=1; i<80; i++) {
						string url = string.Format(templateurl, i);
					 Add(url);
					}
				});
			
			var zips = new UIBarButtonItem ("Z", 
				UIBarButtonItemStyle.Bordered, 
				 (sender, e) => {
					foreach(string coll in collections) {
						string url = string.Format(zipurl, coll);
					 Add(url);
					}
				});


			var s404 = new UIBarButtonItem ("4", 
				UIBarButtonItemStyle.Bordered, 
				 (sender, e) => {
					string url = string.Format(httpurl, 404);
					 Add(url);
				});

			var s500 = new UIBarButtonItem ("5", 
				UIBarButtonItemStyle.Bordered, 
				 (sender, e) => {
					string url = string.Format(httpurl, 500);
					 Add(url);
				});

			var s301 = new UIBarButtonItem ("3", 
				UIBarButtonItemStyle.Bordered, 
				 (sender, e) => {
					string url = string.Format(httpurl, 301);
					 Add(url);
				});


			var s301p = new UIBarButtonItem ("3+", 
				UIBarButtonItemStyle.Bordered, 
				 (sender, e) => {
					string url = string.Format(redirecturl, 301);
					 Add(url);
				});

			var reset = new UIBarButtonItem ("Reset", 
				UIBarButtonItemStyle.Bordered, 
				async (sender, e) => {
					await _downloader.Reset();
					Sync();
				});

			var sync = new UIBarButtonItem ("S", 
				UIBarButtonItemStyle.Bordered, 
				(sender, e) => {
					Sync();
				});


			Navigation = new UINavigationController ();
			Window.RootViewController = Navigation;
			Window.MakeKeyAndVisible ();

			Navigation.PushViewController (_sample, false);

			_sample.SetToolbarItems (new [] { add, addall, zips, s404, s500, s301, s301p, reset, sync}, true);
			Navigation.SetToolbarHidden (false, true);

			return true;
		}
开发者ID:lduchosal,项目名称:DownloadManager.Xamarin,代码行数:101,代码来源:AppDelegate.cs


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