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


C# Section.AddAll方法代码示例

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


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

示例1: RefreshAsync

		// Load the list of lists and setup their events
		private Task RefreshAsync()
		{
			AppDelegate.AddActivity();

			return this.db.Table<List>().ToListAsync().ContinueWith (t => {
				if (t.Exception != null) {
					BeginInvokeOnMainThread (ReloadComplete);
					AppDelegate.FinishActivity();
					ShowError (t.Exception.Flatten().InnerException);
					return;
				}

				Section section = new Section();
				section.AddAll (t.Result.Select (l =>
					new StringElement (l.Name, () => {
						var tasks = new TasksViewController (this.db, l);
						NavigationController.PushViewController (tasks, true);
					})
				).Cast<Element>());

				InvokeOnMainThread (() => {
					Root.Clear();
					Root.Add (section);

					ReloadComplete();

					AppDelegate.FinishActivity();
				});
			});
		}
开发者ID:DiLRandI,项目名称:Xamarin.android,代码行数:31,代码来源:TaskListsViewController.cs

示例2: OptionsRootElement

        public OptionsRootElement(Model.Options options)
            : base("Bedside Clock")
        {
            customFontNames = new string[] { "LCDMono" };
            standardFontNames = UIFont.FamilyNames.OrderBy(f => f).ToArray();

            use24Hour = new BooleanElement("24 hour", options.Use24Hour);
            showSeconds = new BooleanElement("Seconds", options.ShowSeconds);
            fontGroup = new RadioGroup(GetIndexForSelectedFont(options.Font));

            var customFontSection = new Section("Custom");
            customFontSection.AddAll(customFontNames.Select(f => new FontEntryElement(f)));

            var fontSection = new Section("Standard Fonts");
            fontSection.AddAll(standardFontNames.Select(f => new FontEntryElement(f)));

            Add(new Section("Clock Display") {
                new StringElement("Color", "Green"),
                new RootElement("Font", fontGroup) { customFontSection, fontSection },
                use24Hour,
                showSeconds
            });
            Add(new Section("Brightness") {
                new FloatElement(null, null, 0.5f)
            });
        }
开发者ID:pjquirk,项目名称:BedsideClock,代码行数:26,代码来源:OptionsRootElement.cs

示例3: OrderView

        public OrderView(IntPtr handle)
            : base(handle)
        {
            Pushing = true;

            var deliveryLocationList = new Section();
            deliveryLocationList.AddAll(from i in ViewModel.DeliveryLocationList select new RadioElement(i));

            var titleList = new Section();
            titleList.AddAll(from i in ViewModel.TitleList select new RadioElement(i));

            var m = ViewModel;
            Root = new RootElement("Order") {
                new Section() {
                    new RootElement("Deliver", new RadioGroup(0)) {
                        deliveryLocationList }                    .Bind(bp, () => m.DeliveryLocation, listProperty: () => m.DeliveryLocationList)
                },
                new Section() {
                    new RootElement("Title", new RadioGroup(0)) {
                        titleList }                               .Bind(bp, () => m.Title, listProperty: () => m.TitleList),
                    new EntryElement("Name"   , "First name", "") .Bind(bp, () => m.FirstName), // Note that you MUST specify "" for the initial element value; any other value will update the viewmodel property in a 2-way binding.
                    new EntryElement(null     , "Middle name", "").Bind(bp, () => m.MiddleName),
                    new EntryElement(null     , "Last name", "")  .Bind(bp, () => m.LastName),
                    new EntryElement("Address", "Street", "")     .Bind(bp, () => m.Street),
                    new EntryElement(null     , "Zip", "")        .Bind(bp, () => m.Zip),
                    new EntryElement(null     , "City", "")       .Bind(bp, () => m.City),
                    new EntryElement(null     , "Country", "")    .Bind(bp, () => m.Country),
                    new EntryElement("Email"  , "", "")           .Bind(bp, () => m.Email),
                    new EntryElement("Mobile" , "", "")           .Bind(bp, () => m.Mobile),
                    new EntryElement("Phone"  , "", "")           .Bind(bp, () => m.Phone)
                }
            };
        }
开发者ID:rvdplas,项目名称:QuickCross,代码行数:33,代码来源:OrderView.cs

示例4: PopoverContentViewController

        public PopoverContentViewController(SizeF contentSizeForViewInPopover)
        {
            _contentSizeForViewInPopover = contentSizeForViewInPopover;

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

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

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

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

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

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

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

示例5: FinishedLaunching

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

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

            navigation = new UINavigationController();

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

            var dvc = new DialogViewController (root, true);

            navigation.PushViewController(dvc, true);

            window.RootViewController = navigation;

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

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

示例6: FinishedLaunching

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

            // open a new storage group with name "Demo" --- this is even possible
            // in code which is shared between Android and iOS because EditGroup is
            // a property holding a delegate which creates a plattform specific
            // instance
            var storage = SimpleStorage.EditGroup("Demo");

            // loading key "app_launches" with an empty string as default value
            var appLaunches = storage.Get("app_launches", "").Split(',').ToList();

            // adding a new timestamp to list to show that SimpleStorage is working
            appLaunches.Add(DateTime.Now.ToString());

            // save the value with key "app_launches" for next application start
            storage.Put("app_launches", String.Join(",", appLaunches));

            // simple presentation of the timestamp list with MonoTouch.Dialog
            var section = new Section();
            section.AddAll(from l in appLaunches where !String.IsNullOrEmpty(l) select new StringElement(l));
            window.RootViewController = new DialogViewController(new RootElement("SimpleStorage Demo") {
                section
            });
            
            window.MakeKeyAndVisible();
            
            return true;
        }
开发者ID:EmiiFont,项目名称:MyShuttle_RC,代码行数:30,代码来源:AppDelegate.cs

示例7: DatePickerDemoViewController

        public DatePickerDemoViewController()
            : base(UITableViewStyle.Grouped, new RootElement ("Demo"), true)
        {
            //NOTE: ENSURE THAT ROOT.UNEVENROWS IS SET TO TRUE
            // OTHERWISE THE DatePickerElement.Height function is not called
            Root.UnevenRows = true;

            // Create section to hold date picker
            Section section = new Section ("Date Picker Test");

            // Create elements
            StringElement descriptionElement = new StringElement ("This demo shows how the date picker works within a section");
            DatePickerElement datePickerElement = new DatePickerElement ("Select date", section, DateTime.Now, UIDatePickerMode.DateAndTime);
            EntryElement entryElement = new EntryElement ("Example entry box", "test", "test");
            StringElement buttonElement = new StringElement ("Reset Date Picker", () => {
                // This is how you can set the date picker after it has been created
                datePickerElement.SelectedDate = DateTime.Now;
            });
            StringElement buttonFinalElement = new StringElement ("Show Selected Date", () => {
                // This is how you can access the selected date from the date picker
                entryElement.Value = datePickerElement.SelectedDate.ToString();
            });

            // Add to section
            section.AddAll (new Element[] { descriptionElement, datePickerElement, entryElement, buttonElement, buttonFinalElement });

            // Add section to root
            Root.Add (section);
        }
开发者ID:RothA,项目名称:Xamarin-iOS7-DatePicker,代码行数:29,代码来源:DatePickerDemoViewController.cs

示例8: ParentListPickerElement

        public ParentListPickerElement(string caption, Item list)
            : base(caption, new RadioGroup(null, 0))
        {
            lists = new List<Item>();
            foreach (var f in App.ViewModel.Folders.OrderBy(f => f.SortOrder))
            {
                lists.Add(new Item() { Name = f.Name, FolderID = f.ID, ID = Guid.Empty });
                var s = new Section() { new RadioElement(f.Name, f.Name) };
                // get all the lists in this folder except for the current list (if passed in)
                var folderlists = f.Items.
                    Where(li => li.IsList == true && li.ItemTypeID != SystemItemTypes.Reference && (list == null || li.ID != list.ID)).
                    OrderBy(li => li.Name).ToList();
                foreach (var l in folderlists)
                    lists.Add(l);
                var radioButtons = folderlists.Select(li => (Element) new RadioElement("        " + li.Name, f.Name)).ToList();
                s.AddAll(radioButtons);
                this.Add(s);
            };

            Item thisList = null;
            Guid listID = list != null && list.ParentID != null ? (Guid) list.ParentID : Guid.Empty;
            if (list != null && lists.Any(li => li.FolderID == list.FolderID && li.ID == listID))
                thisList = lists.First(li => li.FolderID == list.FolderID && li.ID == listID);

            this.RadioSelected = thisList != null ? Math.Max(lists.IndexOf(thisList, 0), 0) : 0;
        }
开发者ID:ogazitt,项目名称:zaplify,代码行数:26,代码来源:ParentListPickerElement.cs

示例9: BuildMoviesElement

		RootElement BuildMoviesElement()
		{
			var element = new RootElement ("Movies");
			var section = new Section ("Recorded At");
			section.AddAll (GetMediaElements (rootVideoPath, MediaFileType.Movie));
			element.Add (section);
			return element;
		}
开发者ID:sergiimaindev,项目名称:monotouch-samples,代码行数:8,代码来源:MediaBrowserDialog.cs

示例10: buildMoviesElement

		private RootElement buildMoviesElement()
		{
			RootElement element = new RootElement("Movies");
			Section section = new Section("Recorded At");
			section.AddAll( getMediaElements(this.rootVideoPath, MediaFileType.Movie ) );
			element.Add( section );
			return element;
		}
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:8,代码来源:MediaBrowserDialog.cs

示例11: BuildImagesElement

		RootElement BuildImagesElement ()
		{
			var element = new RootElement ("Images");
			var section = new Section ("Captured At");
			section.AddAll (GetMediaElements (rootImagePath, MediaFileType.Image));
			element.Add (section);
			return element;
		}
开发者ID:sergiimaindev,项目名称:monotouch-samples,代码行数:8,代码来源:MediaBrowserDialog.cs

示例12: PopulateTable

		protected void PopulateTable()
		{
			tasks = TaskManager.GetTasks().ToList ();
			var rows = from t in tasks
				select (Element)new StringElement ((t.Name == "" ? "<new task>" : t.Name), t.Notes);
			var s = new Section ();
			s.AddAll(rows);
			Root = new RootElement("Tasky") {s}; 
		}
开发者ID:williamnz,项目名称:MyFirstProject,代码行数:9,代码来源:HomeScreen.cs

示例13: ViewWillAppear

        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            var root = new RootElement(Title);
            var accountSection = new Section();
            accountSection.AddAll(PopulateAccounts());
            root.Add(accountSection);
            Root = root;
        }
开发者ID:rcaratchuk,项目名称:CodeFramework,代码行数:10,代码来源:AccountsView.cs

示例14: GetStatusRootView

        private RootElement GetStatusRootView()
        {
            var statusNames = Enum.GetNames(typeof(UserStatuses));
            var radioElements = statusNames.Select(name => new RadioElement(name)).ToList();

            var radioSection = new Section();
            radioSection.AddAll(radioElements);

            return new RootElement("Status", _statusRadioGroup = new RadioGroup(_settings.StatusId)) {radioSection};
        }
开发者ID:sbondini,项目名称:BleChat,代码行数:10,代码来源:SettingsView.cs

示例15: PopulateTable

		protected void PopulateTable()
		{
			tasks = TodoItemManager.GetTasks().ToList ();
//			var rows = from t in tasks
//				select (Element)new StringElement ((t.Name == "" ? "<new task>" : t.Name), t.Notes);
			// TODO: use this element, which displays a 'tick' when item is completed
			var rows = from t in tasks
				select (Element)new CheckboxElement ((t.Name == "" ? "<new task>" : t.Name), t.Done);
			var s = new Section ();
			s.AddAll(rows);
			Root = new RootElement("Tasky") {s}; 
		}
开发者ID:neonderthaler,项目名称:mobile-samples,代码行数:12,代码来源:HomeScreen.cs


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