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


C# Dialog.Section类代码示例

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


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

示例1: GenerateRoot

        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;
        }
开发者ID:megsoftconsulting,项目名称:MonkeySpace,代码行数:29,代码来源:FavoritesViewController.cs

示例2: LoadView

		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;
		}
开发者ID:rmawani,项目名称:EvolveMonoTouchDialog,代码行数:28,代码来源:MixAndMatchViewController.cs

示例3: BuildRootWithLoop

		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;

		}
开发者ID:rmawani,项目名称:EvolveMonoTouchDialog,代码行数:28,代码来源:ListApiViewController.cs

示例4: CreateDynamicContent

		// Creates the dynamic content from the twitter results
		RootElement CreateDynamicContent (XDocument doc)
		{
			var users = doc.XPathSelectElements ("./statuses/status/user").ToArray ();
			var texts = doc.XPathSelectElements ("./statuses/status/text").Select (x=>x.Value).ToArray ();
			var people = doc.XPathSelectElements ("./statuses/status/user/name").Select (x=>x.Value).ToArray ();
			
			var section = new Section ();
			var root = new RootElement ("Tweets") { section };
			
			for (int i = 0; i < people.Length; i++){
				var line = new RootElement (people [i]) { 
					new Section ("Profile"){
						new StringElement ("Screen name", users [i].XPathSelectElement ("./screen_name").Value),
						new StringElement ("Name", people [i]),
						new StringElement ("oFllowers:", users [i].XPathSelectElement ("./followers_count").Value)
					},
					new Section ("Tweet"){
						new StringElement (texts [i])
					}
				};
				section.Add (line);
			}
			
			return root;
		}
开发者ID:hisystems,项目名称:MonoTouch.Dialog,代码行数:26,代码来源:DemoDynamic.cs

示例5: TankMix_History_Fill

        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);
        }
开发者ID:WenF,项目名称:TankMix_App,代码行数:25,代码来源:TankMix_History_Fill.cs

示例6: EchoDicomServer

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

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

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

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

            };

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

示例7: FinishedLaunching

        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Forms.Init ();

            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            rootElement = new RootElement("View.iOS - NetAtmo");

            textSection = new Section();

            buttonSection = new Section()
            {
                new StringElement("Refresh", () =>
                {
                    Refresh();
                })  
            };

            Refresh();

            rootElement.Add(buttonSection);
            rootElement.Add(textSection);


            var rootVC = new DialogViewController(rootElement);
            var nav = new UINavigationController(rootVC);
            Window.RootViewController = nav;
            Window.MakeKeyAndVisible();

            return true;
        }
开发者ID:EifelMono,项目名称:NetAtmo,代码行数:31,代码来源:AppDelegate.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: 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

示例10: SelectBin

        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);
        }
开发者ID:Bibo77,项目名称:MADMUCfarm,代码行数:32,代码来源:SelectBin.cs

示例11: 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

示例12: 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

示例13: RepMaxView

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

            largestRMValue = 0.0;

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

            db = new SQLiteConnection (dbPath);

            this.LoadRecords();

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

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

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

示例14: 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

示例15: FoundResults

        private void FoundResults(ParseObject[] array, NSError error)
        {
            var easySection = new Section("Easy");
            var mediumSection = new Section("Medium");
            var hardSection = new Section("Hard");

            var objects = array.Select(x=> x.ToObject<GameScore>()).OrderByDescending(x=> x.Score).ToList();

            foreach(var score in objects)
            {
                var element = new StringElement(score.Player,score.Score.ToString("#,###"));
                switch(score.Dificulty)
                {
                case GameDificulty.Easy:
                    easySection.Add(element);
                    break;
                case GameDificulty.Medium:
                    mediumSection.Add(element);
                    break;
                case GameDificulty.Hard:
                    hardSection.Add (element);
                    break;
                }
            }
            Root = new RootElement("High Scores")
            {
                easySection,
                mediumSection,
                hardSection,
            };
        }
开发者ID:radiofish,项目名称:monotouch-bindings,代码行数:31,代码来源:HighScoreViewController.cs


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