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


C# EntryElement.FetchValue方法代码示例

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


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

示例1: SetupDialogController

        public SetupDialogController()
            : base(UITableViewStyle.Grouped, null)
        {
            var nickname = new EntryElement (null, "Nickname", null);
            Root = new RootElement("Gablarski") {
                new Section {
                    nickname
                },

                new Section {
                    new StringElement ("Continue", async () => {
                        nickname.FetchValue();
                        Settings.Nickname = nickname.Value;
                        await Settings.SaveAsync();
                        AppDelegate.StartSetup();

                        PresentViewController (new MainViewController(), true, null);
                    })
                }
            };
        }
开发者ID:ermau,项目名称:Gablarski,代码行数:21,代码来源:SetupDialogController.cs

示例2: 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);
            entryElement = new EntryElement("","Type the text to speak here.","");
            spearkBtn = new StringElement("Speak",delegate{
                entryElement.FetchValue();
                Flite.Flite.ConvertTextToWav(entryElement.Value,"test.wav",0);
            });
            window.RootViewController = new DialogViewController(new RootElement("") {
                new Section(){
                    entryElement,
                    spearkBtn
                }
            });
            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);

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

            return true;
        }
开发者ID:amnextking,项目名称:monotouch-bindings,代码行数:30,代码来源:AppDelegate.cs

示例3: MakeLogin

        UIViewController MakeLogin()
        {
            var login = new EntryElement ("Login", "Type 'Root'", "");
            var pass = new EntryElement ("Password", "Type 'Root'", "");

            var loginButton = new StringElement ("Login", delegate {
                login.FetchValue ();
                pass.FetchValue ();
                if (login.Value == "Root" && pass.Value == "Root"){
                    NSUserDefaults.StandardUserDefaults.SetBool (true, "loggedIn");

                    window.RootViewController.PresentViewController (MakeOptions (), true, delegate {});
                }
            });

            return new DialogViewController (new RootElement ("Login"){
                new Section ("Enter login and password"){
                    login, pass,
                },
                new Section (){
                    loginButton
                }
            });
        }
开发者ID:bholmes,项目名称:MyXamarinPrototypes,代码行数:24,代码来源:AppDelegate.cs

示例4: NewAccountXAuth

 // Creates the login dialog using Xauth, this is a nicer
 // user experience, but requires Twitter to approve your
 // app
 void NewAccountXAuth(DialogViewController parent, NSAction callback)
 {
     var login = new EntryElement (Locale.GetText ("Username"), Locale.GetText ("Your twitter username"), "");
     var password = new EntryElement (Locale.GetText ("Password"), Locale.GetText ("Your password"), "", true);
     var root = new RootElement (Locale.GetText ("Login")){
         new Section (){
             login,
             password
         },
         new Section (){
             new LoadMoreElement (Locale.GetText ("Login to Twitter"), Locale.GetText ("Contacting twitter"), delegate {
                 login.FetchValue ();
                 password.FetchValue ();
                 StartXauthLogin (login.Value.Trim (), password.Value.Trim (), callback);
             }, UIFont.BoldSystemFontOfSize (16), UIColor.Black)
         }
     };
     MakeLoginDialog (parent, root);
 }
开发者ID:kellabyte,项目名称:TweetStation,代码行数:22,代码来源:Main.cs

示例5: VisitDetailsView

			public VisitDetailsView(VisitDetailsViewController parent)
			{
				Parent = parent;
				BackgroundColor = UIColor.FromRGB(239,239,244);

				addVisitor = new UIButton
				{
					Frame = new RectangleF(0, 0, 150, 150),
					TintColor = UIColor.White,
					Layer =
					{
						CornerRadius = 75,
						MasksToBounds = true,
					}
				};
				addVisitor.SetTitle("Add a visitor", UIControlState.Normal);
				addVisitor.ImageView.ContentMode = UIViewContentMode.ScaleAspectFill;;
				addVisitor.SetImage(Theme.UserImageDefaultLight.Value,UIControlState.Normal);
				addVisitor.TouchUpInside += (sender, args) => { if (Parent.PickVisitor != null) Parent.PickVisitor(); };
				AddSubview(addVisitor);

				addEmployee = new UIButton
				{
					Frame = new RectangleF(0, 0, 150, 150),
					TintColor = UIColor.White,
					Layer =
					{
						CornerRadius = 75,
						MasksToBounds = true,
					}
				};
				addEmployee.SetTitle("Add an employee", UIControlState.Normal);
				addEmployee.ImageView.ContentMode = UIViewContentMode.ScaleAspectFill; ;
				addEmployee.SetImage(Theme.UserImageDefaultLight.Value, UIControlState.Normal);
				addEmployee.TouchUpInside += (sender, args) => { if (Parent.PickEmployee != null) Parent.PickEmployee(); };
				AddSubview(addEmployee);

				editButton = new UIButton(new RectangleF(0,0,40,40));
				editButton.SetBackgroundImage(UIImage.FromBundle("edit"),UIControlState.Normal );
				editButton.TouchUpInside += (sender, args) =>
				{
					var vc = new EditVisitorViewController
					{
						Visitor = new VMVisitor{Visitor = visit.Visitor}
					};
					this.Parent.NavigationController.PushViewController(vc,true);
				};

				visitorLabel = new UILabel { Text = "Visitor", Font = UIFont.FromName(font2, 30), TextAlignment = UITextAlignment.Center, AdjustsFontSizeToFitWidth = true,};

				visitorLabel.SizeToFit();
				AddSubview(visitorLabel);

				employeeLabel = new UILabel { Text = "Employee", Font = UIFont.FromName(font2, 30), TextAlignment = UITextAlignment.Center, AdjustsFontSizeToFitWidth = true,};
				employeeLabel.SizeToFit();
				AddSubview(employeeLabel);

				date = new DateTimeElement("Date", DateTime.Now);
				comment = new EntryElement("Reason: ", "Reason", "");
				comment.Changed += (sender, args) =>
				{
					Console.WriteLine("Comment");
				};
				vehicle = new BooleanElement("Vehicle",false);
				licensePlate = new EntryElement("Lic Plate: ", "License Plate", "");
				licensePlate.Changed += (sender, args) =>
				{
					Console.WriteLine("licensePlate");
				};
				vehicle.ValueChanged += (sender, args) =>
				{
					if (vehicle.Value)
					{
						if (!section.Elements.Contains(licensePlate))
							section.Add(licensePlate);
						datadvc.ReloadData();
					}
					else
					{
						licensePlate.FetchValue();
						section.Remove(licensePlate);
					}
				};


				datadvc = new DialogViewController(new RootElement("visit")
				{
					(section = new Section
					{
						date,
						comment,
						vehicle,
						licensePlate
					})
				});
				datadvc.TableView.SectionHeaderHeight = 0;
				datadvc.TableView.TableHeaderView = null;
				datadvc.View.BackgroundColor = UIColor.White;
				datadvc.View.Layer.CornerRadius = 5f;
				var height = Enumerable.Range(0, datadvc.TableView.Source.RowsInSection(datadvc.TableView,0)).Sum(x => datadvc.TableView.Source.GetHeightForRow(datadvc.TableView, NSIndexPath.FromRowSection(x, 0)));
//.........这里部分代码省略.........
开发者ID:stecenko,项目名称:MyCompany,代码行数:101,代码来源:VisitDetailsViewController.cs

示例6: DebugPage

        public void DebugPage()
        {
            TraceHelper.AddMessage("Debug: constructor");

            // render URL and status
            var serviceUrl = new EntryElement("URL", "URL to connect to", WebServiceHelper.BaseUrl);
            var service = new Section("Service")
            {
                serviceUrl,
                new StringElement("Store New Service URL", delegate
                {
                    serviceUrl.FetchValue();
                    // validate that this is a good URL before storing it (a bad URL can hose the phone client)
                    Uri uri = null;
                    if (Uri.TryCreate(serviceUrl.Value, UriKind.RelativeOrAbsolute, out uri) &&
                        (uri.Scheme == "http" || uri.Scheme == "https"))
                        WebServiceHelper.BaseUrl = serviceUrl.Value;
                    else
                        serviceUrl.Value = WebServiceHelper.BaseUrl;
                }),
                new StringElement("Connected", App.ViewModel.LastNetworkOperationStatus.ToString()),
            };

            // render user queue
            var userQueue = new Section("User Queue");
            userQueue.Add(new StringElement(
                "Clear Queue",
                delegate
                {
                    RequestQueue.DeleteQueue(RequestQueue.UserQueue);
                    userQueue.Clear ();
                }));

            List<RequestQueue.RequestRecord> requests = RequestQueue.GetAllRequestRecords(RequestQueue.UserQueue);
            if (requests != null)
            {
                foreach (var req in requests)
                {
                    string typename;
                    string reqtype;
                    string id;
                    string name;
                    RequestQueue.RetrieveRequestInfo(req, out typename, out reqtype, out id, out name);
                    var sse = new StyledStringElement(String.Format("  {0} {1} {2} (id {3})", reqtype, typename, name, id))
                    {
                        Font = UIFont.FromName("Helvetica", UIFont.SmallSystemFontSize),
                    };
                    userQueue.Add (sse);
                }
            }

            // render system queue
            var systemQueue = new Section("System Queue");
            systemQueue.Add(new StringElement(
                "Clear Queue",
                delegate
                {
                    RequestQueue.DeleteQueue(RequestQueue.SystemQueue);
                    systemQueue.Clear ();
                }));

            requests = RequestQueue.GetAllRequestRecords(RequestQueue.SystemQueue);
            if (requests != null)
            {
                foreach (var req in requests)
                {
                    string typename;
                    string reqtype;
                    string id;
                    string name;
                    RequestQueue.RetrieveRequestInfo(req, out typename, out reqtype, out id, out name);
                    var sse = new StyledStringElement(String.Format("  {0} {1} {2} (id {3})", reqtype, typename, name, id))
                    {
                        Font = UIFont.FromName("Helvetica", UIFont.SmallSystemFontSize),
                    };
                    systemQueue.Add (sse);
                }
            }

            var traceMessages = new Section("Trace Messages");
            traceMessages.Add(new StringElement(
                "Clear Trace",
                delegate
                {
                    TraceHelper.ClearMessages();
                    traceMessages.Clear ();
                }));
            traceMessages.Add(new StringElement(
                "Send Trace",
                delegate
                {
                    TraceHelper.SendMessages(App.ViewModel.User);
                }));
            foreach (var m in TraceHelper.GetMessages().Split('\n'))
            {
                // skip empty messages
                if (m == "")
                    continue;

                // create a new (small) string element with a detail indicator which
//.........这里部分代码省略.........
开发者ID:ogazitt,项目名称:zaplify,代码行数:101,代码来源:DebugPage.cs

示例7: SignInViewController

        public SignInViewController()
            : base(UITableViewStyle.Grouped, new RootElement ("Crisis Checkin"), false)
        {
            webService = WebServiceFactory.Create ();

            username = new EntryElement ("Email", "[email protected]", "") {
                KeyboardType = UIKeyboardType.EmailAddress,
                AutocorrectionType = UITextAutocorrectionType.No
            };
            password = new EntryElement ("Password", "password", "", true) {
                AutocorrectionType = UITextAutocorrectionType.No
            };

            Root = new RootElement ("Crisis Checkin") {
                new Section ("Already have an account?") {
                    username,
                    password,
                    new StyledStringElement ("Sign In", async () => {

                        username.ResignFirstResponder (true);
                        password.ResignFirstResponder (true);

                        //TODO: Show progress HUD
                        ProgressHud.Show ("Signing In");

                        // You have to fetch values first from MonoTouch.Dialog elements
                        username.FetchValue ();
                        password.FetchValue ();

                        // Actually sign in
                            var r = await webService.SignInAsync(new SignInRequest {
                            Username = username.Value,
                            Password = password.Value
                        });

                        if (!r.Succeeded) {
                            // Show failure message
                            Utility.ShowError ("Sign In Failed", "Invalid Username or Password");
                            return;
                        }

                        // Store our credentials for future web service calls
                        AppDelegate.Settings.SignedInUsername = username.Value;
                        AppDelegate.Settings.SignedInPassword = password.Value;

                        //TODO: Hide progress hud
                        ProgressHud.Dismiss ();

                        // Navigate to commitments after successfuly login
                        commitmentsViewController = new CommitmentsViewController ();
                        NavigationController.PushViewController (commitmentsViewController, true);

                    }) {
                        Alignment = UITextAlignment.Center
                    }
                },
                new Section ("Don't have an account yet?") {
                    new StyledStringElement ("Create an Account", () => {

                        // Navigate to registration controller
                        registerViewController = new RegisterViewController();
                        NavigationController.PushViewController (registerViewController, true);

                    }) {
                        Alignment = UITextAlignment.Center
                    }
                }
            };
        }
开发者ID:Redth,项目名称:crisischeckin,代码行数:69,代码来源:SignInViewController.cs


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