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

C# Dialog.DialogViewController类代码示例

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

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



DialogViewController类属于MonoTouch.Dialog命名空间,在下文中一共展示了DialogViewController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetViewController

		public UIViewController GetViewController ()
		{
			var network = new BooleanElement ("Remote Server", EnableNetwork);

			var host = new EntryElement ("Host Name", "name", HostName);
			host.KeyboardType = UIKeyboardType.ASCIICapable;
			
			var port = new EntryElement ("Port", "name", HostPort.ToString ());
			port.KeyboardType = UIKeyboardType.NumberPad;
			
			var root = new RootElement ("Options") {
				new Section () { network, host, port }
			};
				
			var dv = new DialogViewController (root, true) { Autorotate = true };
			dv.ViewDissapearing += delegate {
				EnableNetwork = network.Value;
				HostName = host.Value;
				ushort p;
				if (UInt16.TryParse (port.Value, out p))
					HostPort = p;
				else
					HostPort = -1;
				
				var defaults = NSUserDefaults.StandardUserDefaults;
				defaults.SetBool (EnableNetwork, "network.enabled");
				defaults.SetString (HostName ?? String.Empty, "network.host.name");
				defaults.SetInt (HostPort, "network.host.port");
			};
			
			return dv;
		}
开发者ID:playdough,项目名称:Touch.Unit,代码行数:32,代码来源:TouchOptions.cs


示例2: Selected

		public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path)
		{
			Value = !Value;
			var cell = tableView.CellAt (path);
			ConfigCell (cell);
			base.Selected (dvc, tableView, path);
		}
开发者ID:henrikweimenhog,项目名称:MonoTouch.Dialog,代码行数:7,代码来源:CheckboxElement.cs


示例3: TogglePicker

		private void TogglePicker(DialogViewController dvc, UITableView tableView, NSIndexPath path)
		{
			var sectionAndIndex = GetMySectionAndIndex(dvc);
			if(sectionAndIndex.Key != null)
			{
				Section section = sectionAndIndex.Key;
				int index = sectionAndIndex.Value;

				var cell = tableView.CellAt(path);

				if(isPickerPresent)
				{
					// Remove the picker.
					cell.DetailTextLabel.TextColor = UIColor.Gray;
					section.Remove(datePickerContainer);
					isPickerPresent = false;
				} 
				else
				{
					// Show the picker.
					cell.DetailTextLabel.TextColor = UIColor.Red;
					datePickerContainer = new UIViewElement(string.Empty, datePicker, false);
					section.Insert(index + 1, UITableViewRowAnimation.Bottom, datePickerContainer);
					isPickerPresent = true;
				}
			}
		}
开发者ID:ClusterReplyBUS,项目名称:MonoTouch.Dialog,代码行数:27,代码来源:TaggedDateElement.cs


示例4: LoginPageRenderer

        public LoginPageRenderer()
        {
            dialog = new DialogViewController(new RootElement("Login"));

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.RootViewController = new UINavigationController(dialog);
            window.MakeKeyAndVisible();

            if (App.IsGoogleLogin && !App.IsLoggedIn)
            {
                var myAuth = new GoogleAuthenticator("730990345527-h7r23gcdmdllgke4iud4di76b0bmpnbb.apps.googleusercontent.com",
                    "https://www.googleapis.com/auth/userinfo.email",
                    "https://accounts.google.com/o/oauth2/auth",
                    "https://www.googleapis.com/plus/v1/people/me");
				UIViewController vc = myAuth.authenticator.GetUI();

                myAuth.authenticator.Completed += async (object sender, AuthenticatorCompletedEventArgs eve) =>
                {
                    //dialog.DismissViewController(true, null);
                    window.Hidden = true;
                    dialog.Dispose();
                    window.Dispose();
                    if (eve.IsAuthenticated)
                    {
                        var user = await myAuth.GetProfileInfoFromGoogle(eve.Account.Properties["access_token"].ToString());
						await App.SaveUserData(user,true);
						//dialog.DismissViewController(true, null);
						App.IsLoggedIn = true;
						App.SuccessfulLoginAction.Invoke();
                    }
                };

                dialog.PresentViewController(vc, true, null);
            }
        }
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:35,代码来源:LoginPageRenderer.cs


示例5: FinishedLaunching

		//
		// This method is invoked when the application has loaded and is ready to run. In this
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			var web = new WebElement ();
			web.HtmlFile = "instructions";

			var root = new RootElement ("Kannada Keyboard") {
				new Section{
					new UIViewElement("Instruction", web.View, false)
				}
			};
		
			var dv = new DialogViewController (root) {
				Autorotate = true
			};
			var navigation = new UINavigationController ();
			navigation.PushViewController (dv, true);				

			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			window.AddSubview (navigation.View);
			
			return true;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:33,代码来源:AppDelegate.cs


示例6: FinishedLaunching

		// This method is invoked when the application has loaded its UI and its ready to run
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			var Last = new DateTime (2010, 10, 7);
			Console.WriteLine (Last);
			
			window.AddSubview (navigation.View);

			var menu = new RootElement ("Demos"){
				new Section ("Element API"){
					new StringElement ("iPhone Settings Sample", DemoElementApi),
					new StringElement ("Dynamically load data", DemoDynamic),
					new StringElement ("Add/Remove demo", DemoAddRemove),
					new StringElement ("Assorted cells", DemoDate),
				},
				new Section ("Auto-mapped", footer){
					new StringElement ("Reflection API", DemoReflectionApi)
				},
				new Section ("Other"){
					new StringElement ("Headers and Footers", DemoHeadersFooters)
				}
			};

			var dv = new DialogViewController (menu);
			navigation.PushViewController (dv, true);				
			
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:briandonahue,项目名称:MonoTouch.Dialog,代码行数:30,代码来源:Main.cs


示例7: FlyoutNavigationController

        public FlyoutNavigationController(UITableViewStyle navigationStyle = UITableViewStyle.Plain)
        {
            navigation = new DialogViewController(navigationStyle,null);
            navigation.OnSelection += NavigationItemSelected;
            var navFrame = navigation.View.Frame;
            navFrame.Width = menuWidth;
            navigation.View.Frame = navFrame;
            this.View.AddSubview (navigation.View);
            SearchBar = new UISearchBar (new RectangleF (0, 0, navigation.TableView.Bounds.Width, 44)) {
                //Delegate = new SearchDelegate (this),
                TintColor = this.TintColor
            };

            TintColor = UIColor.Black;
            //navigation.TableView.TableHeaderView = SearchBar;
            navigation.TableView.TableFooterView = new UIView (new RectangleF (0, 0, 100, 100)){BackgroundColor = UIColor.Clear};
            navigation.TableView.ScrollsToTop = false;
            shadowView = new UIView ();
            shadowView.BackgroundColor = UIColor.White;
            shadowView.Layer.ShadowOffset = new System.Drawing.SizeF (-5, -1);
            shadowView.Layer.ShadowColor = UIColor.Black.CGColor;
            shadowView.Layer.ShadowOpacity = .75f;
            closeButton = new UIButton ();
            closeButton.TouchDown += delegate {
                HideMenu ();
            };
            AlwaysShowLandscapeMenu = true;

            this.View.AddGestureRecognizer (new OpenMenuGestureRecognizer (this, new Selector ("panned"), this));

            ShouldAutoPushFirstView = true;
        }
开发者ID:neilkennedy,项目名称:FlyoutNavigation,代码行数:32,代码来源:FlyoutNavigationController.cs


示例8: RepMaxView

        public RepMaxView(Exercise exerciseToShow)
            : base("RepMaxView", null)
        {
            this._exercise = exerciseToShow;
            this._share = new RMShare(this);

            largestRMValue = 0.0;

            string dbname = "onerm.db";
            string documents = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // This goes to the documents directory for your app
            string dbPath = Path.Combine (documents, dbname);

            db = new SQLiteConnection (dbPath);

            this.LoadRecords();

            this._logRoot = new RootElement ("Records");
            this._dvc = new DialogViewController (UITableViewStyle.Plain, this._logRoot, false);

            // load data from list
            this._logSect = new Section ();
            foreach (RmLog rm in this._rms) {
                StringElement recordString = new StringElement (rm.Weight.ToString(), rm.DateLogged.ToShortDateString());
                this._logSect.Add(recordString);
            }

            this._logRoot.Add(this._logSect);
        }
开发者ID:dan-pennyfarthingapps,项目名称:one-rm-log,代码行数:28,代码来源:RepMaxView.cs


示例9: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            root = new RootElement ("To Do List"){new Section()};

            rootVC = new DialogViewController (root);
            nav = new UINavigationController(rootVC);
            btnAdd = new UIBarButtonItem (UIBarButtonSystemItem.Add);
            rootVC.NavigationItem.RightBarButtonItem = btnAdd;

            btnAdd.Clicked += (sender, e) => {
                ++n;
                var task = new Task{Name = "task" + n, DueDate = DateTime.Now};
                var taskElement = new RootElement(task.Name){
                    new Section (){
                        new EntryElement (task.Name, "Enter task description", task.Description)
                    },
                    new Section(){
                        new DateElement("Due Date", task.DueDate)
                    }
                };
                root[0].Add (taskElement);
            };

            viewController = new to_do_listViewController ();
            window.RootViewController = nav;
            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:aaronhe42,项目名称:MonoTouch-Examples,代码行数:38,代码来源:AppDelegate.cs


示例10: Selected

 public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
 {
     base.Selected(dvc, tableView, path);
     if (Tapped != null)
         Tapped();
     tableView.DeselectRow (path, true);
 }
开发者ID:envy4s,项目名称:Gistacular,代码行数:7,代码来源:CustomElement.cs


示例11: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching (UIApplication app, NSDictionary options)
        {
            exampleInfoList = ExampleLibrary.Examples.GetList();

            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            navigation = new UINavigationController();

            var root = new RootElement ("OxyPlot Example Browser");
            var section = new Section ();
            section.AddAll (exampleInfoList
                .GroupBy (e => e.Category)
                .OrderBy (g => g.Key)
                .Select (g =>
                    (Element)new StyledStringElement (g.Key, delegate {
                        DisplayCategory (g.Key);
                    }) { Accessory = UITableViewCellAccessory.DisclosureIndicator }));
            root.Add (section);

            var dvc = new DialogViewController (root, true);

            navigation.PushViewController(dvc, true);

            window.RootViewController = navigation;

            // make the window visible
            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:Celderon,项目名称:oxyplot,代码行数:38,代码来源:AppDelegate.cs


示例12: DemoElementApi

		public void DemoElementApi ()
		{
			var root = CreateRoot ();
				
			var dv = new DialogViewController (root, true);
			navigation.PushViewController (dv, true);				
		}
开发者ID:narent,项目名称:MonoTouch.Dialog,代码行数:7,代码来源:DemoElementApi.cs


示例13: PopoverContentViewController

        public PopoverContentViewController(SizeF contentSizeForViewInPopover)
        {
            _contentSizeForViewInPopover = contentSizeForViewInPopover;

            QuickFillCore quickFillCore = QuickFillManager.GetQuickFillCore ();
            var quickFillNames = quickFillCore.QuickFillNames;

            var styleHeaderElement = new Section ("Style Header") {
                new RootElement ("Manual Entry", rt => GetNewDialog(StyleEntityManager.GetManualEntry()))
            };

            var quickFillElement = new Section ("Quick Fill");
            var quickFills = StyleEntityManager.GetQuickFills (quickFillCore);

            var styleDialogs = new List<RootElement> ();
            for (int i = 0; i < quickFillNames.Count; i++)
            {
                var style = GetNewDialog (quickFills [i]);
                var rootElement = new RootElement (quickFillNames [i], rt => style);
                styleDialogs.Add (rootElement);
            }
            quickFillElement.AddAll (styleDialogs);

            var rootStyles = new RootElement ("Add New Styles");
            rootStyles.Add (new [] { styleHeaderElement, quickFillElement });

            var rootDialog = new DialogViewController (rootStyles);
            rootDialog.NavigationItem.SetLeftBarButtonItem (new UIBarButtonItem ("Cancel", UIBarButtonItemStyle.Bordered, HandlePopoverCancelledEvent), true);

            this.SetViewControllers (new [] { rootDialog }, true);
        }
开发者ID:semuserable,项目名称:Cloud9,代码行数:31,代码来源:TEMP.cs


示例14: GetCell

 public override MonoTouch.UIKit.UITableViewCell GetCell(DialogViewController dvc, MonoTouch.UIKit.UITableView tv)
 {
     var cell =  base.GetCell (dvc, tv);
     cell.ImageView.Image = ImageStore.GetLocalProfilePicture(Friend.ID);
     cell.DetailTextLabel.Text = "Shot Count: " + Friend.HitCount;
     return cell;
 }
开发者ID:Clancey,项目名称:Facetroids,代码行数:7,代码来源:FriendsViewController.cs


示例15: FinishedLaunching

		//
		// This method is invoked when the application has loaded and is ready to run. In this
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			exampleInfoList = ExampleLibrary.Examples.GetList();

			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			navigation = new UINavigationController();

			var root = new RootElement ("OxyPlot Demo") {
				new Section() {
					from e in exampleInfoList
					group e by e.Category into g
					orderby g.Key
					select (Element)new StyledStringElement (g.Key, delegate {
							DisplayCategory(g.Key);
						}) { Accessory = UITableViewCellAccessory.DisclosureIndicator }
				}
			};

			var dvc = new DialogViewController (root, true);

			navigation.PushViewController(dvc, true);

			window.RootViewController = navigation;

			// make the window visible
			window.MakeKeyAndVisible ();

			return true;
		}
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:38,代码来源:AppDelegate.cs


示例16: PushViewController

 public override void PushViewController()
 {
     var root = CreateRoot();
     var dv = new DialogViewController(root,true);
     PushViewController(dv,true);
     StopAnimatingHud();
 }
开发者ID:GunioRobot,项目名称:AgileZen,代码行数:7,代码来源:StoryDetailsController.cs


示例17: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			InitListOfImages ();
			var root = new RootElement ("SDWebImage Sample") {
				new Section ()
			};
			int count = 0;

			foreach (var item in objects) {
				count++;
				string url = item;

				var imgElement = new ImageLoaderStringElement (
						caption: string.Format ("Image #{0}", count),
						tapped: () => { HandleTapped (url); },
						imageUrl: new NSUrl (url), 
						placeholder: UIImage.FromBundle ("placeholder")
					);

				root[0].Add (imgElement);
			}

			dvcController = new DialogViewController (UITableViewStyle.Plain, root);
			dvcController.NavigationItem.RightBarButtonItem = new UIBarButtonItem ("Clear Cache", UIBarButtonItemStyle.Plain, ClearCache);
			navController = new UINavigationController (dvcController);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:ErikWitkowski,项目名称:TwinTechsFormsLib,代码行数:32,代码来源:AppDelegate.cs


示例18: EchoDicomServer

        public void EchoDicomServer()
        {
            RootElement root = null;
            Section resultSection = null;

            var hostEntry = new EntryElement("Host", "Host name of the DICOM server", "server");
            var portEntry = new EntryElement("Port", "Port number", "104");
            var calledAetEntry = new EntryElement("Called AET", "Called application AET", "ANYSCP");
            var callingAetEntry = new EntryElement("Calling AET", "Calling application AET", "ECHOSCU");

            var echoButton = new StyledStringElement("Click to test",
            delegate {
                if (resultSection != null) root.Remove(resultSection);
                string message;
                var echoFlag = DoEcho(hostEntry.Value, Int32.Parse(portEntry.Value), calledAetEntry.Value, callingAetEntry.Value, out message);
                var echoImage = new ImageStringElement(String.Empty, echoFlag ? new UIImage("yes-icon.png") : new UIImage("no-icon.png"));
                var echoMessage = new StringElement(message);
                resultSection = new Section(String.Empty, "C-ECHO result") { echoImage, echoMessage };
                root.Add(resultSection);
            })
            { Alignment = UITextAlignment.Center, BackgroundColor = UIColor.Blue, TextColor = UIColor.White };

            root = new RootElement("Echo DICOM server") {
                new Section { hostEntry, portEntry, calledAetEntry, callingAetEntry},
                new Section { echoButton },

            };

            var dvc = new DialogViewController (root, true) { Autorotate = true };
            navigation.PushViewController (dvc, true);
        }
开发者ID:GMZ,项目名称:mdcm,代码行数:31,代码来源:EchoDicomServer.cs


示例19: DateTimeElement2

		public DateTimeElement2 (string caption, DateTime date, DialogViewController dvc) : base (caption, null, null)
		{			
			this.Dvc = dvc;
			DateValue = date;
			
			// create picker elements
			datePicker = CreatePicker ();
			datePicker.Mode = UIDatePickerMode.DateAndTime; 
			datePicker.ValueChanged += delegate {
				DateValue = datePicker.Date;				
				Value = FormatDate(DateValue);
				RefreshValue();
				
				if (DateSelected != null)
					DateSelected (this);								
			};		
			
			//datePicker.Frame = PickerFrameWithSize (datePicker.SizeThatFits (SizeF.Empty));					
			closeBtn = new UIButton(new RectangleF(0,0,31,32));
			closeBtn.SetImage(UIImage.FromFile("Images/closebox.png"),UIControlState.Normal);
			closeBtn.TouchDown += delegate {
				HidePicker();
			};			
			datePicker.AddSubview(closeBtn);			
						
			Value = FormatDate (date);			
			
			this.Alignment = UITextAlignment.Left;
		}	
开发者ID:siddharth-pandey,项目名称:MonoTouch.Dialog-PickerElement,代码行数:29,代码来源:DateTimeElement2.cs


示例20: DemoHeadersFooters

		public void DemoHeadersFooters () 
		{
			var section = new Section () { 
				HeaderView = new UIImageView (UIImage.FromFile ("caltemplate.png")),
#if !__TVOS__
				FooterView = new UISwitch (new RectangleF (0, 0, 80, 30)),
#endif // !__TVOS__
			};
			
			// Fill in some data 
			var linqRoot = new RootElement ("LINQ source"){
				from x in new string [] { "one", "two", "three" }
					select new Section (x) {
						from y in "Hello:World".Split (':')
							select (Element) new StringElement (y)
				}
			};

			section.Add (new RootElement ("Desert", new RadioGroup ("desert", 0)){
				new Section () {
					new RadioElement ("Ice Cream", "desert"),
					new RadioElement ("Milkshake", "desert"),
					new RadioElement ("Chocolate Cake", "desert")
				},
			});
			
			var root = new RootElement ("Headers and Footers") {
				section,
				new Section () { linqRoot }
			};
			var dvc = new DialogViewController (root, true);
			navigation.PushViewController (dvc, true);
		}
开发者ID:prashantvc,项目名称:MonoTouch.Dialog,代码行数:33,代码来源:DemoHeadersFooters.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Dialog.EntryElement类代码示例发布时间:2022-05-26
下一篇:
C# Client.PeerId类代码示例发布时间: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