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


C# Section.Add方法代码示例

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


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

示例1: Initialize

		private void Initialize()
		{
			var loginWithWidgetBtn = new StyledStringElement ("Login with Widget", this.LoginWithWidgetButtonClick) {
				Alignment = UITextAlignment.Center
			};

			var loginWithConnectionBtn = new StyledStringElement ("Login with Google", this.LoginWithConnectionButtonClick) {
				Alignment = UITextAlignment.Center
			};

			var loginBtn = new StyledStringElement ("Login", this.LoginWithUsernamePassword) {
				Alignment = UITextAlignment.Center
			};

			this.resultElement = new StyledMultilineElement (string.Empty, string.Empty, UITableViewCellStyle.Subtitle);

			var login1 = new Section ("Login");
			login1.Add (loginWithWidgetBtn);
			login1.Add (loginWithConnectionBtn);

			var login2 = new Section ("Login with user/password");
			login2.Add (this.userNameElement = new EntryElement ("User", string.Empty, string.Empty));
			login2.Add (this.passwordElement = new EntryElement ("Password", string.Empty, string.Empty, true));
			login2.Add (loginBtn);

			var result = new Section ("Result");
			result.Add(this.resultElement);

			this.Root.Add (new Section[] { login1, login2, result });
		}
开发者ID:ducaciprian,项目名称:Xamarin.Auth0Client,代码行数:30,代码来源:Auth0Client_iOS_SampleViewController.designer.cs

示例2: OnCreateMenu

		/// <summary>
		/// Invoked when it comes time to set the root so the child classes can create their own menus
		/// </summary>
		private void OnCreateMenu(RootElement root)
		{
            var addGistSection = new Section();
            root.Add(addGistSection);
            addGistSection.Add(new MenuElement("New Gist", () => {
                var gistController = new CreateGistController();
                gistController.Created = (id) => {
                    NavigationController.PushViewController(new GistInfoController(id), true);
                };
                var navController = new UINavigationController(gistController);
                PresentViewController(navController, true, null);
            }, Images.Buttons.NewGist));

            var gistMenuSection = new Section() { HeaderView = new MenuSectionView("Gists") };
            root.Add(gistMenuSection);
            gistMenuSection.Add(new MenuElement("My Gists", () => NavigationController.PushViewController(new MyGistsController(), true), Images.Buttons.MyGists));
            gistMenuSection.Add(new MenuElement("Starred", () => NavigationController.PushViewController(new StarredGistsController(), true), Images.Buttons.Star2));
            gistMenuSection.Add(new MenuElement("Public", () => NavigationController.PushViewController(new PublicGistsController(), true), Images.Buttons.Public));

//            var labelSection = new Section() { HeaderView = new MenuSectionView("Tags") };
//            root.Add(labelSection);
//            labelSection.Add(new MenuElement("Add New Tag", () => { }, null));

            var moreSection = new Section() { HeaderView = new MenuSectionView("Info") };
            root.Add(moreSection);
            moreSection.Add(new MenuElement("About", () => NavigationController.PushViewController(new AboutController(), true), Images.Buttons.Info));
            moreSection.Add(new MenuElement("Feedback & Support", () => { 
                var config = UserVoice.UVConfig.Create("http://gistacular.uservoice.com", "lYY6AwnzrNKjHIkiiYbbqA", "9iLse96r8yki4ZKknfHKBlWcbZAH9g8yQWb9fuG4");
                UserVoice.UserVoice.PresentUserVoiceInterface(this, config);
            }, Images.Buttons.Feedback));
            moreSection.Add(new MenuElement("Logout", Logout, Images.Buttons.Logout));
		}
开发者ID:envy4s,项目名称:Gistacular,代码行数:35,代码来源:MenuController.cs

示例3: FinishedLaunching

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

			var what = new EntryElement ("What ?", "e.g. pizza", String.Empty);
			var where = new EntryElement ("Where ?", "here", String.Empty);

			var section = new Section ();
			if (CLLocationManager.LocationServicesEnabled) {
				lm = new CLLocationManager ();
				lm.LocationsUpdated += delegate (object sender, CLLocationsUpdatedEventArgs e) {
					lm.StopUpdatingLocation ();
					here = e.Locations [e.Locations.Length - 1];
					var coord = here.Coordinate;
					where.Value = String.Format ("{0:F4}, {1:F4}", coord.Longitude, coord.Latitude);
				};
				section.Add (new StringElement ("Get Current Location", delegate {
					lm.StartUpdatingLocation ();
				}));
			}

			section.Add (new StringElement ("Search...", async delegate {
				await SearchAsync (what.Value, where.Value);
			}));

			var root = new RootElement ("MapKit Search Sample") {
				new Section ("MapKit Search Sample") { what, where },
				section
			};
			window.RootViewController = new UINavigationController (new DialogViewController (root, true));
			window.MakeKeyAndVisible ();
			return true;
		}
开发者ID:GSerjo,项目名称:monotouch-samples,代码行数:33,代码来源:AppDelegate.cs

示例4: BuildListing

		private Section BuildListing(string basePath)
		{
			Section sect = new Section();
			
			foreach(string dir in Directory.GetDirectories(basePath))
			{
				string strDir = dir;
				string strDirDisplay = strDir.Replace(basePath,"");
				if(strDirDisplay[0] == '/')
					strDirDisplay = strDirDisplay.Remove(0,1);
				
				ImageStringElement element = new ImageStringElement (strDirDisplay, imgFolder);
				element.Tapped += delegate { ShowDirectoryTree(strDir, true); };
			
				sect.Add(element);
			}
			
			foreach(string fil in Directory.GetFiles(basePath))
			{
				string strFil = fil;
				string strFilDisplay = strFil.Replace(basePath,"");
				if(strFilDisplay[0] == '/')
					strFilDisplay = strFilDisplay.Remove(0,1);
				
				ImageStringElement element = new ImageStringElement (strFilDisplay, imgFile);
				element.Tapped += delegate { Utilities.UnsuccessfulMessage("File: " + strFil + " tapped"); };
			
				sect.Add(element);
				
			}
			
			return sect;
			
		}
开发者ID:ganeshan,项目名称:MonoTouch.DirectoryRecurser,代码行数:34,代码来源:Main.cs

示例5: DemoLoadMore

		public void DemoLoadMore () 
		{
			Section loadMore = new Section();
			loadMore.Add(new StringElement("Element 1"));
			loadMore.Add(new StringElement("Element 2"));
			loadMore.Add(new StringElement("Element 3"));
						
			
			loadMore.Add (new LoadMoreElement("Load More Elements...", "Loading Elements...", lme => {
				// Launch a thread to do some work
				ThreadPool.QueueUserWorkItem (delegate {
					
					// We just wait for 2 seconds.
					System.Threading.Thread.Sleep(2000);
				
					// Now make sure we invoke on the main thread the updates
					navigation.BeginInvokeOnMainThread(delegate {
						lme.Animating = false;
						loadMore.Insert(loadMore.Count - 1, new StringElement("Element " + (loadMore.Count + 1)),
				    		            new StringElement("Element " + (loadMore.Count + 2)),
				            		    new StringElement("Element " + (loadMore.Count + 3)));
					
					});
				});
				
			}, UIFont.BoldSystemFontOfSize(14.0f), UIColor.Blue));
							
			var root = new RootElement("Load More") {
				loadMore
			};
			
			var dvc = new DialogViewController (root, true);
			navigation.PushViewController (dvc, true);
		}
开发者ID:kangaroo,项目名称:MonoTouch.Dialog,代码行数:34,代码来源:DemoLoadMore.cs

示例6: ProvisioningDialog

        public ProvisioningDialog()
            : base(UITableViewStyle.Grouped, null)
        {
            Root = new RootElement ("GhostPractice Mobile");
            var topSec = new Section ("Welcome");
            topSec.Add (new StringElement ("Please enter activation code"));
            activation = new EntryElement ("Code", "Activation Code", "999998-zcrdbrkqwogh");
            topSec.Add (activation);
            var submit = new StringElement ("Send Code");
            submit.Alignment = UITextAlignment.Center;

            submit.Tapped += delegate {
                if (activation.Value == null || activation.Value == string.Empty) {
                    new UIAlertView ("Device Activation", "Please enter activation code", null, "OK", null).Show ();
                    return;
                }
                if (!isBusy) {
                    getAsyncAppAndPlatform ();
                } else {
                    Wait ();
                }

            };
            topSec.Add (submit);
            Root.Add (topSec);

            UIImage img = UIImage.FromFile ("Images/launch_small.png");
            UIImageView v = new UIImageView (new RectangleF (0, 0, 480, 600));
            v.Image = img;
            Root.Add (new Section (v));
        }
开发者ID:rajeshwarn,项目名称:GhostPractice-iPadRepo,代码行数:31,代码来源:ProvisioningDialog.cs

示例7: 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)
        {
            load();
            string[] s;
            mainMenu = new Section("Blogs", "Click for a new Account");
            for(int i = 0; i < titles.Count; i++){
                s = titles.ElementAt(i);
                var a = new Account( s[0], s[1], s[2] );
                accounts.Add( a );
                a.SetDelegate(this);
                mainMenu.Add( a.GetRoot() );
            }
            var nb = new StringElement("new Account", NewBlog);
            nb.Alignment = UITextAlignment.Center;
            mainMenu.Add( nb );

            var dv = new ExtDialogViewController ( new RootElement("Blogs"){ mainMenu } ) {
                Autorotate = true,
                DisableUpsideDown = true
            };

            window.AddSubview (navigation.View);
            navigation.PushViewController (dv, true);
            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:tilos,项目名称:KeyChainDemo,代码行数:28,代码来源:Main.cs

示例8: CreateTable

		private void CreateTable()
		{
			var application = Mvx.Resolve<IApplicationService>();
			var vm = (SettingsViewModel)ViewModel;
			var currentAccount = application.Account;
            var accountSection = new Section("Account");

            accountSection.Add(new TrueFalseElement("Save Credentials".t(), !currentAccount.DontRemember, e =>
            { 
                currentAccount.DontRemember = !e.Value;
                application.Accounts.Update(currentAccount);
            }));

			var showOrganizationsInEvents = new TrueFalseElement("Show Organizations in Events".t(), currentAccount.ShowOrganizationsInEvents, e =>
			{ 
				currentAccount.ShowOrganizationsInEvents = e.Value;
				application.Accounts.Update(currentAccount);
			});

			var showOrganizations = new TrueFalseElement("List Organizations in Menu".t(), currentAccount.ExpandOrganizations, e =>
			{ 
				currentAccount.ExpandOrganizations = e.Value;
				application.Accounts.Update(currentAccount);
			});

			var repoDescriptions = new TrueFalseElement("Show Repo Descriptions".t(), currentAccount.ShowRepositoryDescriptionInList, e =>
			{ 
				currentAccount.ShowRepositoryDescriptionInList = e.Value;
				application.Accounts.Update(currentAccount);
			});

			var startupView = new StyledStringElement("Startup View", vm.DefaultStartupViewName, MonoTouch.UIKit.UITableViewCellStyle.Value1)
			{ 
				Accessory = MonoTouch.UIKit.UITableViewCellAccessory.DisclosureIndicator,
			};
			startupView.Tapped += () => vm.GoToDefaultStartupViewCommand.Execute(null);

            if (vm.PushNotificationsActivated)
                accountSection.Add(new TrueFalseElement("Push Notifications".t(), vm.PushNotificationsEnabled, e => vm.PushNotificationsEnabled = e.Value));

			var totalCacheSizeMB = vm.CacheSize.ToString("0.##");
			var deleteCache = new StyledStringElement("Delete Cache".t(), string.Format("{0} MB", totalCacheSizeMB), MonoTouch.UIKit.UITableViewCellStyle.Value1);
			deleteCache.Tapped += () =>
			{ 
				vm.DeleteAllCacheCommand.Execute(null);
				deleteCache.Value = string.Format("{0} MB", 0);
				ReloadData();
			};

			var usage = new TrueFalseElement("Send Anonymous Usage".t(), vm.AnalyticsEnabled, e => vm.AnalyticsEnabled = e.Value);

			//Assign the root
			var root = new RootElement(Title);
            root.Add(accountSection);
			root.Add(new Section("Appearance") { showOrganizationsInEvents, showOrganizations, repoDescriptions, startupView });
			root.Add(new Section ("Internal") { deleteCache, usage });
			Root = root;

		}
开发者ID:jrschumacher,项目名称:CodeHub,代码行数:59,代码来源:SettingsView.cs

示例9: ViewDidLoad

 public override void ViewDidLoad()
 {
     base.ViewDidLoad ();
     var section = new Section ();
     section.Add (CreateMemoriesScreen ());
     section.Add (CreateUpdateScreen ());
     Root.Add (section);
 }
开发者ID:nastyaK,项目名称:MemorizeIt,代码行数:8,代码来源:MenuController.cs

示例10: AddEditContactScreen

        public AddEditContactScreen(UINavigationController nav)
            : base(UITableViewStyle.Grouped, null, true)
        {
            _rootContainerNavigationController = nav;

            // Navigation
            NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel, (sender, args) =>
            {
                NavigationController.DismissViewController(true, null);
            });
            NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, DoneButtonClicked);
            NavigationItem.Title = "New Contact";

            Root = new RootElement("");

            // Photo
            _photoSection = new Section();
            _photoBadge = new BadgeElement(UIImage.FromBundle("Images/UnknownIcon.jpg"), "Add Photo");
            _photoBadge.Tapped += PhotoBadgeTapped;
            _photoSection.Add(_photoBadge);
            Root.Add(_photoSection);

            // Name
            _nameSection = new Section();
            var firstName = new EntryElement(null, "First", null);
            var middleName = new EntryElement(null, "Middle", null);
            var lastName = new EntryElement(null, "Last", null);
            var org = new EntryElement(null, "Organization", null);
            _nameSection.Add(firstName);
            _nameSection.Add(middleName);
            _nameSection.Add(lastName);
            _nameSection.Add(org);
            Root.Add(_nameSection);

            // Phone numbers
            _phoneSection = new Section("Phone Numbers");
            Root.Add(_phoneSection);
            var phoneLoadMore = new LoadMoreElement("Add More Phone Numbers", "Loading...", PhoneLoadMoreTapped);
            _phoneSection.Add(phoneLoadMore);

            // Emails
            _emailSection = new Section("Emails");
            Root.Add(_emailSection);
            var emailLoadMore = new LoadMoreElement("Add More Emails", "Loading...", EmailLoadMoreTapped);
            _emailSection.Add(emailLoadMore);

            // Urls
            _urlSection = new Section("Urls");
            Root.Add(_urlSection);
            var urlLoadMore = new LoadMoreElement("Add More Urls", "Loading...", UrlLoadMoreTapped);
            _urlSection.Add(urlLoadMore);

            // IMs
            _instantMsgSection = new Section("Instant Messages");
            Root.Add(_instantMsgSection);
            var instantMsgLoadMore = new LoadMoreElement("Add More Instant Messages", "Loading...", InstantMsgLoadMoreTapped);
            _instantMsgSection.Add(instantMsgLoadMore);
        }
开发者ID:NamXH,项目名称:Graphy,代码行数:58,代码来源:AddEditContactScreen.cs

示例11: FieldImage

        public FieldImage(string farmName,int farmID,FlyoutNavigationController fnc,SelectField sf)
            : base(UITableViewStyle.Grouped, null)
        {
            Root = new RootElement (null) {};
            this.Pushing = true;

            var section = new Section () {};
            var totalRainGuage = new StringElement ("Total Raid Guage(mm): " + DBConnection.getRain (farmID),()=>{});
            var rainGuage=new EntryElement ("New Rain Guage(mm): ",null,"         ");
            rainGuage.KeyboardType = UIKeyboardType.NumbersAndPunctuation;
            var update=new StringElement("Add",()=>{
                try{
                DBConnection.updateRain(farmID,Int32.Parse(rainGuage.Value));
                }
                catch(Exception e){
                    new UIAlertView ("Error", "Wrong input format!", null, "Continue").Show ();
                    return;
                }
                UIAlertView alert = new UIAlertView ();
                alert.Title = "Success";
                alert.Message = "Your Data Has Been Saved";
                alert.AddButton("OK");
                alert.Show();
            });
            var showDetail=new StringElement("Show Rain Guage Detail",()=>{
                RainDetail rd=new RainDetail(farmID,farmName);
                sf.NavigationController.PushViewController(rd,true);
            });
            section.Add (totalRainGuage);
            section.Add (rainGuage);
            section.Add (update);
            section.Add (showDetail);

            Root.Add (section);

            var section2 = new Section () { };
            var farmImg=UIImage.FromFile ("img/"+farmName+".jpg");
            if(farmImg==null)
                farmImg=UIImage.FromFile ("Icon.png");
            var imageView = new UIImageView (farmImg);
            if(farmImg==null)
                farmImg=UIImage.FromFile ("Icon.png");

            var scrollView=new UIScrollView (
                new RectangleF(0,0,fnc.View.Frame.Width-20,250)
            );

            scrollView.ContentSize = imageView.Image.Size;
            scrollView.AddSubview (imageView);

            scrollView.MaximumZoomScale = 3f;
            scrollView.MinimumZoomScale = .1f;
            scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return imageView; };

            var imageElement=new UIViewElement(null,scrollView,false);
            section2.Add(imageElement);
            Root.Add (section2);
        }
开发者ID:Bibo77,项目名称:MADMUCfarm,代码行数:58,代码来源:SelectField.cs

示例12: SelectFarm

        public SelectFarm()
            : base(UITableViewStyle.Grouped, null)
        {
            Root = new RootElement (null){};
            this.Pushing=true;

            //farm section
            var farms = DBConnection.getAllFarms();
            int farmNumber=farms.Count();
            var section = new Section ("Farms:"){};

            foreach(Farm farm in farms){
                int farmID = farm.farmID;
                string farmName = farm.farmName;
                int fieldNumber = DBConnection.getAllFields(farmID).Count ();
                var farmImg=UIImage.FromFile ("img/"+farmName+".jpg");
                if(farmImg==null)
                    farmImg=UIImage.FromFile ("Icon.png");

                var theFarm=new BadgeElement(farmImg,farmName+"      "+fieldNumber+" fields",()=>{
                    Console.WriteLine("Farm Name is: "+farmName);
                    var field=new SelectField(farmName,farmID,fieldNumber);
                    this.NavigationController.PushViewController(field,true);
                });
                section.Add(theFarm);
            }
            Root.Add(section);

            //grain section
            var section2 = new Section ("Grain Inventory:"){};
            var grin1 = new StringElement ("Bin (1-15)", () => {
                var selectBin=new SelectBin(1);
                this.NavigationController.PushViewController(selectBin,true);
            });
            var grin2 = new StringElement ("Bin(16-30)", () => {
                var selectBin=new SelectBin(16);
                this.NavigationController.PushViewController(selectBin,true);
            });
            var grin3 = new StringElement ("Bin(31-45)", () => {
                var selectBin=new SelectBin(31);
                this.NavigationController.PushViewController(selectBin,true);
            });
            var grin4 = new StringElement ("Bin(46-60)", () => {
                var selectBin=new SelectBin(46);
                this.NavigationController.PushViewController(selectBin,true);
            });
            var grin5 = new StringElement ("Bin(61-75)", () => {
                var selectBin=new SelectBin(61);
                this.NavigationController.PushViewController(selectBin,true);
            });

            section2.Add (grin1);
            section2.Add (grin2);
            section2.Add (grin3);
            section2.Add (grin4);
            section2.Add (grin5);
            Root.Add (section2);
        }
开发者ID:Bibo77,项目名称:MADMUCfarm,代码行数:58,代码来源:SelectFarm.cs

示例13: buildFeeTargetReport

        public void buildFeeTargetReport()
        {
            Root = new RootElement ("Practice Fee Target Progress");
            Stripper.SetReportHeader (Root, "Practice Fee Target Progress", null, contentWidth);

            PracticeTotals totals = this.report.practiceTotals;

            var totSection = new Section ("");
            var tot1 = new BigFinanceElement ("Invoiced MTD Total:  ", totals.invoicedMTDTotal);

            totSection.Add (tot1);
            Root.Add (totSection);
            //Fee Target Progress: The Invoiced Debits MTD field display the invoiced YTD value
            if (totals.recordedMTD != null) {

                var mtdSection = new Section ("Recorded MTD");
                mtdSection.Add (getElement (totals.recordedMTD.achieved, "Achieved: "));
                mtdSection.Add (getElement (totals.recordedMTD.estimatedTarget, "Estimated Target: "));
                mtdSection.Add (getElement (totals.recordedMTD.invoicedDebits, "Invoiced: "));
                mtdSection.Add (getElement (totals.recordedMTD.unbilled, "Unbilled: "));
                mtdSection.Add (getElement (totals.recordedMTD.total, "Total: "));
                Root.Add (mtdSection);
            }
            if (totals.recordedYTD != null) {

                var mtdSection = new Section ("Recorded YTD");
                mtdSection.Add (getElement (totals.recordedYTD.achieved, "Achieved: "));
                mtdSection.Add (getElement (totals.recordedYTD.estimatedTarget, "Estimated Target: "));
                mtdSection.Add (getElement (totals.recordedYTD.invoiced, "Invoiced: "));
                mtdSection.Add (getElement (totals.recordedYTD.unbilled, "Unbilled: "));
                mtdSection.Add (getElement (totals.recordedYTD.total, "Total: "));
                Root.Add (mtdSection);
            }
            if (totals.matterActivity != null) {
                var matterActivitySection = new Section ("Matter Activity");
                var tot2 = new NumberElement (totals.matterActivity.active, "Active Matters: ");
                matterActivitySection.Add (tot2);
                var tot3 = new NumberElement (totals.matterActivity.deactivated, "Deactivated Matters: ");
                matterActivitySection.Add (tot3);
                var tot4 = new NumberElement (totals.matterActivity.newWork, "New Work: ");
                matterActivitySection.Add (tot4);
                var tot5 = new NumberElement (totals.matterActivity.noActivity, "No Activity: ");
                matterActivitySection.Add (tot5);
                var tot6 = new StringElement ("No Activity Duration:   " + totals.matterActivity.noActivityDuration);
                matterActivitySection.Add (tot6);
                Root.Add (matterActivitySection);
            }
            //
            if (totals.matterBalances != null) {
                var matterBalancesSection = new Section ("Matter Balances");
                matterBalancesSection.Add (getElement (totals.matterBalances.business, "Business: "));
                matterBalancesSection.Add (getElement (totals.matterBalances.unbilled, "Unbilled: "));
                matterBalancesSection.Add (getElement (totals.matterBalances.trust, "Trust Balance: "));
                matterBalancesSection.Add (getElement (totals.matterBalances.investment, "Investments: "));
                Root.Add (matterBalancesSection);
            }
        }
开发者ID:rajeshwarn,项目名称:GhostPractice-iPadRepo,代码行数:57,代码来源:FeeTargetProgressController.cs

示例14: Generate

 private Element Generate(StudentGuideModel item)
 {
     var root=new RootElement(item.Title);
     var section=new Section(item.Title);
     root.Add (section);
     if (item.Phone!="") {
         var phoneStyle = new StyledStringElement("Contact Number",item.Phone) {
             BackgroundColor=UIColor.FromRGB(71,165,209),
             TextColor=UIColor.White,
             DetailColor=UIColor.White,
         };
         phoneStyle.Tapped+= delegate {
             UIAlertView popup = new UIAlertView("Alert","Do you wish to send a text or diall a number?",null,"Cancel","Text","Call");
             popup.Show();
             popup.Dismissed += delegate(object sender, UIButtonEventArgs e) {
                 if (e.ButtonIndex==1) {
                     MFMessageComposeViewController msg = new MFMessageComposeViewController();
                     msg.Recipients=new string[] {item.Phone};
                     this.NavigationController.PresentViewController(msg,true,null);
                 } else if (e.ButtonIndex==2) {
                     AppDelegate.getControl.calling(item.Phone);
                 };
             };
         };
         section.Add(phoneStyle);
     };
     if (item.Email!="") {
         var style = new StyledStringElement("Contact Email",item.Email) {
             BackgroundColor=UIColor.FromRGB(71,165,209),
             TextColor=UIColor.White,
             DetailColor=UIColor.White,
         };
         style.Tapped += delegate {
             MFMailComposeViewController email = new MFMailComposeViewController();
             email.SetToRecipients(new string[] {item.Email});
             this.NavigationController.PresentViewController(email,true,null);
         };
         section.Add (style);
     }
     if (item.Address!="") {
         section.Add(new StyledMultilineElement(item.Address) {
             BackgroundColor=UIColor.FromRGB(71,165,209),
             TextColor=UIColor.White,
             DetailColor=UIColor.White,
         });
     }
     if (item.Description!="") {
         section.Add (new StyledMultilineElement(item.Description) {
             BackgroundColor=UIColor.FromRGB(71,165,209),
             TextColor=UIColor.White,
             DetailColor=UIColor.White,
             Alignment=UITextAlignment.Center,
         });
     }
     return root;
 }
开发者ID:kieran0077,项目名称:Eastleigh-College,代码行数:56,代码来源:Facilities.cs

示例15: buildReport

        public void buildReport()
        {
            Root = new RootElement ("");
            var v = new UIView ();
            v.Frame = new RectangleF (10, 10, 600, 10);
            var dummy = new Section (v);
            Root.Add (dummy);
            var headerLabel = new UILabel (new RectangleF (10, 10, 800, 48)) {
                Font = UIFont.BoldSystemFontOfSize (18),
                BackgroundColor = ColorHelper.GetGPPurple (),
                TextAlignment = UITextAlignment.Center,
                TextColor = UIColor.White,
                Text = "Owner Matter Analysis"
            };
            var view = new UIViewBordered ();
            view.Frame = new RectangleF (10, 10, 800, 48);
            view.Add (headerLabel);
            Root.Add (new Section (view));

            //NumberFormatInfo nfi = new CultureInfo ("en-US", false).NumberFormat;
            for (int i = 0; i < report.branches.Count; i++) {
                Branch branch = report.branches [i];
                Section s = new Section (branch.name);
                Root.Add (s);

                for (int j = 0; j < branch.owners.Count; j++) {
                    Owner o = branch.owners [j];
                    Section seco = new Section (o.name);

                    var recMTD = new TitleElement ("Matter Activity");
                    seco.Add (recMTD);
                    seco.Add (new NumberElement (o.matterActivity.active, "Active:  "));
                    seco.Add (new NumberElement (o.matterActivity.deactivated, "Deactivated:  "));
                    seco.Add (new NumberElement (o.matterActivity.newWork, "New Work:  "));
                    seco.Add (new NumberElement (o.matterActivity.workedOn, "Worked On:  "));
                    seco.Add (new NumberElement (o.matterActivity.noActivity, "No Activity:  "));
                    seco.Add (new StringElement ("No Activity Duration:  " + o.matterActivity.noActivityDuration));
                    //
                    var recYTD = new TitleElement ("Matter Balances");
                    seco.Add (recYTD);
                    seco.Add (getElement (o.matterBalances.business, S.GetText (S.BUSINESS) + ":  "));
                    seco.Add (getElement (o.matterBalances.trust, S.GetText (S.TRUST) + ":  "));
                    seco.Add (getElement (o.matterBalances.investment, S.GetText (S.INVESTMENTS) + ":  "));
                    seco.Add (getElement (o.matterBalances.unbilled, "Unbilled:  "));
                    seco.Add (getElement (o.matterBalances.pendingDisbursements, "Pending Disb:  "));

                    Root.Add (seco);

                }

            }

            for (var i = 0; i < 10; i++) {
                Root.Add (new Section (" "));
            }
        }
开发者ID:rajeshwarn,项目名称:GhostPractice-iPadRepo,代码行数:56,代码来源:MatterAnalysisBranchOwnerController.cs


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