Add() public method

public Add ( IEnumerable
sections ) : void
sections IEnumerable
return void
示例#1
0
        public LabelListScreen(IList<string> labels)
            : base(UITableViewStyle.Grouped, null)
        {
            // Navigation
            NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel, (sender, args) =>
            {
                NavigationController.DismissViewController(true, null);
            });
            NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, DoneButtonClicked);

            Root = new RootElement("");
            var labelSection = new Section();
            Root.Add(labelSection);
            foreach (var label in labels)
            {
                var element = new StringElement(label);
                element.Tapped += () => {};
                labelSection.Add(element);
            }

            var customSection = new Section();
            Root.Add(customSection);
            var customElement = new StringElement("Add Custom Label");
            customElement.Tapped += () => {};
            customSection.Add(customElement);
        }
		public override void LoadView ()
		{
			base.LoadView ();

			var root = new RootElement ("TARP Banks");

			var section = new Section ()
			{
				(usOnlyToggle = new BooleanElement("Show only US banks", false))
			};
			root.Add (section);

			//make a section from the banks. Keep a reference to it
			root.Add ((bankListSection = BuildBankSection (usOnlyToggle.Value)));

			//if the toggle changes, reload the items
			usOnlyToggle.ValueChanged += (sender, e) => {
				var newListSection = BuildBankSection(usOnlyToggle.Value);

				root.Remove(bankListSection, UITableViewRowAnimation.Fade);
				root.Insert(1, UITableViewRowAnimation.Fade, newListSection);
				bankListSection = newListSection;

			};


			Root = root;
		}
        public SettingsViewController()
            : base(new RootElement("Einstellungen"))
        {
            var root = new RootElement("Einstellungen");
            var userEntry = new EntryElement("Benutzername", "benutzername", ApplicationSettings.Instance.UserCredentials.Name);
            var passwordEntry = new EntryElement("Passwort", "passwort", ApplicationSettings.Instance.UserCredentials.Password, true);
            userEntry.AutocorrectionType = MonoTouch.UIKit.UITextAutocorrectionType.No;
            userEntry.AutocapitalizationType = MonoTouch.UIKit.UITextAutocapitalizationType.None;
            userEntry.Changed += UsernameChanged;
            passwordEntry.Changed += PasswordChanged;

            root.Add(new Section("Benutzerinformationen"){
                userEntry,
                passwordEntry
            });

            root.Add(new Section("Stundenplaneinstellungen"){
                new StyledStringElement("Andere Stundenpläne", () => {NavigationController.PushViewController(new SettingsTimetablesDetailViewController(), true);}){
                    Accessory = UITableViewCellAccessory.DisclosureIndicator
                }
            });
            Root = root;
            Title = "Einstellungen";
            NavigationItem.Title = "Einstellungen";
            TabBarItem.Image = UIImage.FromBundle("Settings-icon");
        }
        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 = "Branch Matter Analysis"
            };
            var view = new UIViewBordered ();
            view.Frame = new RectangleF (10, 20, 800, 48);
            view.Add (headerLabel);
            Root.Add (new Section (view));
            //
            for (int i = 0; i < report.branches.Count; i++) {
                Branch branch = report.branches [i];

                Section s = new Section (branch.name + " Branch Totals");
                Root.Add (s);
                //
                if (branch.branchTotals.matterActivity != null) {
                    var matterActivitySection = new Section ();
                    var mTitle = new TitleElement ("Matter Activity");
                    matterActivitySection.Add (mTitle);
                    matterActivitySection.Add (new NumberElement (branch.branchTotals.matterActivity.active, "Active Matters: "));
                    matterActivitySection.Add (new NumberElement (
                        branch.branchTotals.matterActivity.deactivated,
                        "Deactivated Matters: "
                    ));
                    matterActivitySection.Add (new NumberElement (branch.branchTotals.matterActivity.newWork, "New Work: "));
                    matterActivitySection.Add (new NumberElement (branch.branchTotals.matterActivity.workedOn, "Worked On: "));

                    matterActivitySection.Add (new NumberElement (branch.branchTotals.matterActivity.noActivity, "No Activity: "));
                    matterActivitySection.Add (new StringElement ("No Activity Duration: " + branch.branchTotals.matterActivity.noActivityDuration));
                    Root.Add (matterActivitySection);
                }
                //
                if (branch.branchTotals.matterBalances != null) {
                    var matterBalancesSection = new Section ();
                    var mTitle = new TitleElement ("Matter Balances");
                    matterBalancesSection.Add (mTitle);
                    matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.business, S.GetText (S.BUSINESS) + ": "));
                    matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.trust, S.GetText (S.TRUST_BALANCE) + ": "));
                    matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.investment, S.GetText (S.INVESTMENTS) + ": "));
                    matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.unbilled, "Unbilled: "));
                    matterBalancesSection.Add (getElement (branch.branchTotals.matterBalances.pendingDisbursements, "Pending Disb.: "));
                    Root.Add (matterBalancesSection);
                }

            }

            for (var i = 0; i < 10; i++) {
                Root.Add (new Section (" "));
            }
        }
        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 Fee Target Progress"
            };
            var view = new UIViewBordered ();
            view.Frame = new RectangleF (10, 20, 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);
                //var t1 = new StringElement(branch.name + " Branch Totals");
                //s.Add(t1);
                Root.Add (s);

                for (int j = 0; j < branch.owners.Count; j++) {
                    Owner o = branch.owners [j];
                    Section ownerSection = new Section (o.name);
                    ownerSection.Add (new BigFinanceElement ("Invoiced MTD Total:  ", o.invoicedMTDTotal));
                    StyledStringElement recMTD = new StyledStringElement ("Recorded MTD");
                    recMTD.BackgroundColor = UIColor.LightGray;
                    recMTD.TextColor = UIColor.White;
                    ownerSection.Add (recMTD);
                    ownerSection.Add (getElement (o.recordedMTD.achieved, "Achieved:  "));
                    ownerSection.Add (getElement (o.recordedMTD.estimatedTarget, "Estimated Target:  "));
                    ownerSection.Add (getElement (o.recordedMTD.invoicedDebits, "Invoiced Debits:  "));
                    ownerSection.Add (getElement (o.recordedMTD.unbilled, "Unbilled:  "));
                    ownerSection.Add (getElement (o.recordedMTD.total, "Total:  "));
                    //
                    StyledStringElement recYTD = new StyledStringElement ("Recorded YTD");
                    recYTD.BackgroundColor = UIColor.LightGray;
                    recYTD.TextColor = UIColor.White;
                    ownerSection.Add (recYTD);
                    ownerSection.Add (getElement (o.recordedYTD.achieved, "Achieved:  "));
                    ownerSection.Add (getElement (o.recordedYTD.estimatedTarget, "Estimated Target:  "));
                    ownerSection.Add (getElement (o.recordedYTD.invoiced, "Invoiced:  "));
                    ownerSection.Add (getElement (o.recordedYTD.unbilled, "Unbilled:  "));
                    ownerSection.Add (getElement (o.recordedYTD.total, "Total:  "));

                    Root.Add (ownerSection);

                }
            }
            for (var i = 0; i < 10; i++) {
                Root.Add (new Section (" "));
            }
        }
        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));
        }
示例#7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var root = new RootElement(Title);
            root.Add(new Section()
            {
                new MultilinedElement("AppreciateUI") { Value = About }
            });

            root.Add(new Section()
            {
                new StyledElement("Source Code", () => UIApplication.SharedApplication.OpenUrl(new NSUrl("https://github.com/thedillonb/appreciateui")))
            });

            if (MFMailComposeViewController.CanSendMail)
            {
                root.Add(new Section()
                {
                    new StyledElement("Contact Me", OpenMailer)
                });
            }

            root.Add(new Section(String.Empty, "Thank you for downloading. Enjoy!")
            {
                new StyledElement("Follow Me On Twitter", () => UIApplication.SharedApplication.OpenUrl(new NSUrl("https://twitter.com/thedillonb"))),
                new StyledElement("Rate This App", () => UIApplication.SharedApplication.OpenUrl(new NSUrl("https://itunes.apple.com/us/app/appreciateui/id651317060?ls=1&mt=8"))),
                new StyledElement("App Version", NSBundle.MainBundle.InfoDictionary.ValueForKey(new NSString("CFBundleVersion")).ToString())
            });

            root.UnevenRows = true;
            Root = root;
        }
示例#8
0
		public UIViewController GetViewController ()
		{
			var menu = new RootElement ("Test Runner");
			
			Section main = new Section ();
			foreach (TestSuite suite in suites) {
				main.Add (Setup (suite));
			}
			menu.Add (main);
			
			Section options = new Section () {
				new StringElement ("Run Everything", Run),
				new StyledStringElement ("Options", Options) { Accessory = UITableViewCellAccessory.DisclosureIndicator },
				new StyledStringElement ("Credits", Credits) { Accessory = UITableViewCellAccessory.DisclosureIndicator }
			};
			menu.Add (options);
			
			var dv = new DialogViewController (menu) { Autorotate = true };
			
			// AutoStart running the tests (with either the supplied 'writer' or the options)
			if (AutoStart) {
				ThreadPool.QueueUserWorkItem (delegate {
					window.BeginInvokeOnMainThread (delegate {
						Run ();	
						// optionally end the process, e.g. click "Touch.Unit" -> log tests results, return to springboard...
						// http://stackoverflow.com/questions/1978695/uiapplication-sharedapplication-terminatewithsuccess-is-not-there
						if (TerminateAfterExecution)
							TerminateWithSuccess ();
					});
				});
			}
			return dv;
		}
		public override void LoadView ()
		{
			base.LoadView ();

			var root = new RootElement ("Profile");

			root.Add (new Section() {
				new UIViewElement(null, new ProfileImageView(), true)
			});

			root.Add (new BackgroundImageSection () {
				new StyledStringElement("Projects", delegate {}) { BackgroundColor = UIColor.Clear }
			});

			root.Add (new BackgroundImageSection () {
				new StyledStringElement("Comments", delegate {}) { BackgroundColor = UIColor.Clear },
	            new StyledStringElement("Support", delegate {}) { BackgroundColor = UIColor.Clear },
	            new StyledStringElement("Lists", delegate {}) { BackgroundColor = UIColor.Clear }
			});

			root.Add (new Section () {
				new StyledStringElement("Projects", delegate {})
			});

			root.Add (new Section () {
				new StyledStringElement("Comments", delegate {}),
				new StyledStringElement("Support", delegate {}),
				new StyledStringElement("Lists", delegate {})
			});

			Root = root;

			NavigationItem.TitleView = new UIImageView (Resources.KickstarterLogo);
		}
示例#10
0
		/// <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));
		}
示例#11
0
        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);
        }
示例#12
0
        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);
        }
示例#13
0
		private void CreateTable()
		{
			var application = Mvx.Resolve<IApplicationService>();
			var vm = (SettingsViewModel)ViewModel;
			var currentAccount = application.Account;

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

			var showOrganizationsInEvents = new TrueFalseElement("Show Teams under Events".t(), currentAccount.ShowTeamEvents, e =>
			{ 
				currentAccount.ShowTeamEvents = e.Value;
				application.Accounts.Update(currentAccount);
			});

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

			var repoDescriptions = new TrueFalseElement("Show Repo Descriptions".t(), currentAccount.RepositoryDescriptionInList, e =>
			{ 
				currentAccount.RepositoryDescriptionInList = 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);

			//var pushNotifications = 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(new Section("Account") { saveCredentials /*			, pushNotifications */ });
			root.Add(new Section("Apperance") { showOrganizationsInEvents, showOrganizations, repoDescriptions, startupView });
			root.Add(new Section ("Internal") { deleteCache, usage });
			Root = root;

		}
        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);
            }
        }
        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 (" "));
            }
        }
        /*
         * "practiceTotals":{"invoicedMTDTotal":0.0,
        "matterActivity":{"active":581,"workedOn":529,"newWork":581,"deactivated":0,"noActivity":0,"noActivityDuration":"6 Months"},
        "matterBalances":{"unbilled":107253.15,"pendingDisbursements":500.0,"investment":-1000.0,"trust":-5852921.0,"business":704265.82}}}}
         */
        public void buildFeeTargetReport()
        {
            //NumberFormatInfo nfi = new CultureInfo ("en-US", false).NumberFormat;
            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 = "Practice Matter Analysis"
            };
            var view = new UIViewBordered ();
            view.Frame = new RectangleF (10, 10, 800, 48);
            view.Add (headerLabel);
            Root.Add (new Section (view));

            PracticeTotals totals = this.report.practiceTotals;

            var totSection = new Section ("Practice Totals");
            Root.Add (totSection);

            if (totals.matterActivity != null) {
                var matterActivitySection = new Section ();
                var mTitle = new TitleElement ("Matter Activity");
                matterActivitySection.Add (mTitle);
                matterActivitySection.Add (new NumberElement (totals.matterActivity.active, "Active:  "));
                matterActivitySection.Add (new NumberElement (totals.matterActivity.deactivated, "Deactivated:  "));
                matterActivitySection.Add (new NumberElement (totals.matterActivity.newWork, "New Work:  "));

                matterActivitySection.Add (new NumberElement (totals.matterActivity.workedOn, "Worked On:  "));
                matterActivitySection.Add (new NumberElement (totals.matterActivity.noActivity, "No Activity:  "));
                matterActivitySection.Add (new StringElement ("No Activity Duration:  " + totals.matterActivity.noActivityDuration));
                Root.Add (matterActivitySection);
            }
            //
            if (totals.matterBalances != null) {
                var matterBalancesSection = new Section ();
                var mTitle = new TitleElement ("Matter Balances");
                matterBalancesSection.Add (mTitle);
                matterBalancesSection.Add (getElement (totals.matterBalances.business, S.GetText (S.BUSINESS) + ": "));
                matterBalancesSection.Add (getElement (totals.matterBalances.trust, S.GetText (S.TRUST_BALANCE) + ": "));
                matterBalancesSection.Add (getElement (totals.matterBalances.investment, S.GetText (S.INVESTMENTS) + ": "));
                matterBalancesSection.Add (getElement (totals.matterBalances.unbilled, "Unbilled: "));
                matterBalancesSection.Add (getElement (totals.matterBalances.pendingDisbursements, "Pending Disb.: "));
                Root.Add (matterBalancesSection);
            }

            for (var i = 0; i < 10; i++) {
                Root.Add (new Section (" "));
            }
        }
示例#17
0
        public Login()
            : base(UITableViewStyle.Grouped, null)
        {
            Root = new RootElement ("Login") {};

            var input = new Section(){};
            var userName=new EntryElement ("User Name", "Enter your user name",null);
            var password = new EntryElement ("Password", "Enter your password", null, true);
            input.Add (userName);
            input.Add (password);
            Root.Add (input);

            var submit = new Section () { };
            var btnSubmit=new StringElement("Submit",()=>{
                Console.WriteLine("user name is: "+userName.Value);
                Console.WriteLine("password is: "+password.Value);

                var pass=DBConnection.isUser(userName.Value,password.Value);//change this and use userName.Vale...

                if(pass){
                    // download templates, before go to another screen
                    var webRequest = WebRequestManager.getWebRequestManager();
                    webRequest.downloadSeedTemplate();
                    webRequest.downloadChemicalTemplate();
                    webRequest.downloadUsers();
                    webRequest.downloadFarms();

                    //
                    var farm=new SelectFarm();
                    this.NavigationController.PushViewController(farm,true);
                }

                else{
                    new UIAlertView ("Error", "Wrong UserName or Password!", null, "Continue").Show ();
                }
            });
            submit.Add (btnSubmit);
            Root.Add (submit);

            /*
            //code to add user
            var addUser=new Section(){};
            var btnAddUser=new StringElement("Adduser",()=>{
                Console.WriteLine("Add user name: "+userName.Value);
                Console.WriteLine("The password is: "+password.Value);
                DBConnection.insertUser(userName.Value,password.Value);
            });
            addUser.Add(btnAddUser);
            Root.Add(addUser);
            //end of code for add user
            */
        }
        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 = "Branch Fee Target Progress"
            };
            var view = new UIViewBordered ();
            view.Frame = new RectangleF (10, 20, 800, 48);
            view.Add (headerLabel);
            Root.Add (new Section (view));

            for (int i = 0; i < report.branches.Count; i++) {
                Branch branch = report.branches [i];

                Section s = new Section (branch.name);

                var t2 = new BigFinanceElement ("Invoiced MTD Total:  ", branch.branchTotals.InvoicedMTDTotal);
                s.Add (t2);
                //
                Section s2 = new Section (branch.name + " Recorded MTD");
                s2.Add (getElement (branch.branchTotals.recordedMTD.achieved, "Achieved:  "));
                s2.Add (getElement (branch.branchTotals.recordedMTD.estimatedTarget, "Estimated Target:  "));
                s2.Add (getElement (branch.branchTotals.recordedMTD.invoicedDebits, "Invoiced Debits:  "));
                s2.Add (getElement (branch.branchTotals.recordedMTD.unbilled, "Unbilled:  "));
                s2.Add (getElement (branch.branchTotals.recordedMTD.total, "Total:  "));
                //
                Section s21 = new Section (branch.name + " Recorded YTD");
                s21.Add (getElement (branch.branchTotals.recordedYTD.achieved, "Achieved:  "));
                s21.Add (getElement (branch.branchTotals.recordedYTD.estimatedTarget, "Estimated Target:  "));
                s21.Add (getElement (branch.branchTotals.recordedYTD.invoiced, "Invoiced:  "));
                s21.Add (getElement (branch.branchTotals.recordedYTD.unbilled, "Unbilled:  "));
                s21.Add (getElement (branch.branchTotals.recordedYTD.total, "Total:  "));

                Root.Add (s);
                Root.Add (s2);
                Root.Add (s21);

            }
            for (var i = 0; i < 10; i++) {
                Root.Add (new Section (" "));
            }
        }
		public RootElement BuildRootWithLoop()
		{
			bankSelection = new RadioGroup (0);

			Section section = null;
			string lastLetter = "";
			RootElement root = new RootElement("Pick your bank", bankSelection);

			foreach(var name in data)
			{
				string currentFirstLetter = name.Substring(0,1);
				if (currentFirstLetter != lastLetter)
				{
					if (section != null && section.Count > 0) root.Add (section);

					lastLetter = currentFirstLetter;
					section = new Section(currentFirstLetter);
				}

				section.Add (new RadioElement(name));

			}

			if (section != null && section.Count > 0) root.Add (section);

			return root;

		}
示例#20
0
        public RootElement BuildRootElement()
        {
            //make a root element and a single section.
            var root = new RootElement("TEST!");

            root.UnevenRows = true;
            ScrollingElement scrollElement, scrollElement2;

            //put in 2 scrollingin elements - this is our wide thing!
            root.Add(new Section() {
                new StringElement("whatever"),
                (scrollElement = new ScrollingElement()),
                (scrollElement2 = new ScrollingElement())
            });

            //populate the scrolling areas with some subviews. Just colored blocks for the moment.
            for (int i = 0; i < 5; i++)
            {
                scrollElement.Add(new ScrollElementItem(UIColor.Red));
                scrollElement.Add(new ScrollElementItem(UIColor.Green));
                scrollElement.Add(new ScrollElementItem(UIColor.Blue));
                scrollElement.Add(new ScrollElementItem(UIColor.Black));
                scrollElement.Add(new ScrollElementItem(UIColor.Yellow));

                scrollElement2.Add(new ScrollElementItem(UIColor.Yellow, 132f));
                scrollElement2.Add(new ScrollElementItem(UIColor.Green));
                scrollElement2.Add(new ScrollElementItem(UIColor.Blue));

            }

            return root;
        }
        public void ExerciseLog(Exercise exercise)
        {
            Exercise ex = exercise;

            RootElement logRoot = new RootElement (ex.Name + " log") { };
            var dvc = new DialogViewController (logRoot, true);

            Section entries = ex.getAllEntries();
            logRoot.Add (entries);

            UIBarButtonItem addButton = new UIBarButtonItem(UIBarButtonSystemItem.Add);

            dvc.NavigationItem.RightBarButtonItem = addButton;

            //
            // TODO: add logic to grab the last weight value to make it easier to change
            //
            addButton.Clicked += (sender, e) => {
                DateTime creationDate = new DateTime();
                creationDate = DateTime.Now;
                ex.LogRM(creationDate, 150.5);		// add it to the exercise list in the obj

                StyledStringElement entry = ex.getEntryForKey(creationDate);

                //CounterElement entry = new CounterElement(DateTime.Now.ToShortDateString(), "150.5");

                entries.Insert(0, entry);			// put new one on top

            };

            navigation.PushViewController (dvc, true);
        }
示例#22
0
        public TankMix_History_Fill(List<Fill> Fills,int F)
            : base(UITableViewStyle.Grouped, null)
        {
            this.Pushing = true;
            Root = new RootElement ("Fills");
            var Section = new Section ();

            for(int i=1; i<=F; i++)
            {
                var btn = new StringElement ("Fill "+i, string.Empty);
                btn.Tapped += () => {
                    //this.NavigationController.PushViewController(new TankMix_CalculationCreateFill (Convert.ToInt32(btn.Caption.Split(' ')[1]),Fills,F),true);
                    var index = Convert.ToInt32(btn.Caption.Split(' ')[1])-1;
                    try{
                        this.NavigationController.PushViewController(new TankMix_CalculationCreateNewFill(Fills[index],index+1),true);

                    }catch{
                        new UIAlertView ("Error", "This fill has no data !", null, "Continue").Show ();
                    }
                };
                Section.Add (btn);
            }

            Root.Add (Section);
        }
示例#23
0
        private RootElement CreateRootElement()
        {
            var root = new RootElement("Movies App");

            root.Add (new[] {
                new Section() {
                    new StringElement("Now Playing Movies", delegate {
                        _next = new MoviesController(MovieType.NowPlaying);
                        NavigationController.PushViewController (_next, true);
                    }),
                    new StringElement("Upcoming Movies", delegate {
                        _next = new MoviesController(MovieType.Upcoming);
                        NavigationController.PushViewController (_next, true);
                    }),
                    new StringElement("Top Rated Movies", delegate {
                        _next = new MoviesController(MovieType.TopRated);
                        NavigationController.PushViewController (_next, true);
                    }),
                    new StringElement("Similar Movies", delegate {
                        _next = new MoviesController(MovieType.Similar, 77948);
                        NavigationController.PushViewController (_next, true);
                    }),
                    new StringElement("The Dark Knight Rises", delegate {
                        _next = new MovieDetailsController(49026, "The Dark Knight Rises");
                        NavigationController.PushViewController (_next, true);
                    }),
                }
            });

            return root;
        }
		void Initialize ()
		{		
			try
			{
				var rootElement = new RootElement ("timelineTitle") { UnevenRows = true };
				var section = new Section();
				rootElement.Add(section);				
				
				int ht = 80 + 10;
				var photoPanelRect = new RectangleF (0, 0, this.View.Frame.Width, ht);
				var membersPhotoPanel = new MembersPhotoPanelView (this, _IsModal, photoPanelRect, _UserID);			
				membersPhotoPanel.prevController = _ActivityView;
				membersPhotoPanel.MemberRoot = rootElement;							
				
				var mediaView = new MembersView(false, _UserID);
				mediaView.Root = rootElement;
				mediaView.View.Frame = new RectangleF(0, ht, UIScreen.MainScreen.Bounds.Width, this.View.Frame.Height - ht);
							
				this.View.AddSubview (membersPhotoPanel);
				this.View.AddSubview(mediaView.View);
				
				var view = new UIView(new RectangleF(0, _IsModal ? 90 : 80 , 320, 1));
				view.Layer.BackgroundColor = UIColor.LightGray.CGColor;
				this.View.AddSubview(view);				
			}
			catch (Exception ex)
			{
				Util.LogException("MembersPhotoViewController Initialize", ex);
			}
		}
示例#25
0
	RootElement CreateNewRoot(IEnumerable<IGrouping<string, Account>> accountsByGroup)
	{
		var root = new RootElement ("My Accounts");
			
		var sections = from _group 
			in accountsByGroup 
			select new Section () {  //  i.e.: Deposits 
			from account in _group select
					new AccountRootElement(account,true, StyleTransactionsScreen) 
					{
						new Section()  // Section for Account Header 
						{
							new AccountElement(account, false) as Element,
						},
						new Section("Transactions")  // Section for Transactions 
						{
						//	account.Transactions.Select(tx=> new StyledStringElement(tx.Description, string.Format (@"{0:M/d hh:mm tt} {1:C}",tx.OccuredOn, tx.Amount),UITableViewCellStyle.Subtitle) as Element),
							account.Transactions.Select(tx=> new TransactionElement(tx) as Element),

						},

				} as Element
		};

		root.Add (sections);

		return root;
	}
示例#26
0
        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);
        }
示例#27
0
		/// <summary>
		/// Populates the page with sessions, grouped by time slot
		/// that are marked as 'favorite'
		/// </summary>
		protected override void PopulateTable()
		{
			// get the sessions from the database
			var sessions = BL.Managers.SessionManager.GetSessions ();
			var favs = BL.Managers.FavoritesManager.GetFavorites();
			// extract IDs from Favorites query
			List<string> favoriteIDs = new List<string>();
			foreach (var f in favs) favoriteIDs.Add (f.SessionKey);

			// build list, matching the Favorite.SessionKey with actual
			// Session.Key rows - which might have moved if the data changed
			var root = 	new RootElement ("Favorites") {
						from s in sessions
							where favoriteIDs.Contains(s.Key)
							group s by s.Start.Ticks into g
							orderby g.Key
							select new Section (new DateTime (g.Key).ToString ("dddd HH:mm")) {
							from hs in g
							   select (Element) new SessionElement (hs)
			}};	
			
			if(root.Count == 0) {
				var section = new Section("No favorites") {
					new StyledStringElement("Touch the star to favorite a session") 
				};
				root.Add(section);
			}
			Root = root;
		}	
示例#28
0
        public SelectBin(int startBin)
            : base(UITableViewStyle.Grouped, null)
        {
            this.Pushing = true;

            Root = new RootElement ("Bin "+startBin+" - "+(startBin+14)) {};

            //var bins = DBConnection.getBins(startBin);
            var section = new Section () { };
            for(int i=0;i<15;i++){
                var newBinID=startBin+i;
                var theBinElem=new StringElement("Bin "+newBinID,()=>{
                    Console.WriteLine("BinID is"+ newBinID);
                    var theBin=new ModifyBin(newBinID);
                    this.NavigationController.PushViewController(theBin,true);
                });
                section.Add(theBinElem);
            }

            /*
            foreach(Bin bin in bins){
                var newBinID=bin.binID;
                var theBinElem=new StringElement("Bin "+newBinID,()=>{
                    Console.WriteLine("BinID is"+ newBinID);
                    var theBin=new ModifyBin(newBinID);
                    this.NavigationController.PushViewController(theBin,true);
                });
                section.Add(theBinElem);
            }
            */
            Root.Add(section);
        }
示例#29
0
        //
        // 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;
        }
        RootElement GenerateRoot()
        {
            var favs = AppDelegate.UserData.GetFavoriteCodes();
            var root = 	new RootElement ("Favorites".GetText()) {
                from s in MonkeySpace.Core.ConferenceManager.Sessions.Values.ToList () //AppDelegate.ConferenceData.Sessions
                            where favs.Contains(s.Code )
                            group s by s.Start.Ticks into g
                            orderby g.Key
                            select new Section (HomeViewController.MakeCaption ("", new DateTime (g.Key))) {
                            from hs in g
                               select (Element) new SessionElement (hs)
            }};

            if(favs.Count == 0)
            {

                /**
                 * var logoView = new UIImageView(UIImage.FromFile("100x100_icon.png"));
                logoView.Alpha = .5f;
                logoView.Frame = new RectangleF(0,42,320,100);
                NavigationController.NavigationBar.Layer.AddSublayer(logoView.Layer);
            **/

                var section = new Section("Whoops, Star a few sessions first!".GetText());
                root.Add(section);

            }
            return root;
        }