Пример #1
0
		public void SetPListContainer (PObjectContainer container)
		{
			var summaryScrolledWindow = new PListEditorSection ();
			AppendPage (summaryScrolledWindow, new Label (GettextCatalog.GetString ("Summary")));
			
			var advancedScrolledWindow = new PListEditorSection ();
			AppendPage (advancedScrolledWindow, new Label (GettextCatalog.GetString ("Advanced")));
			
			foreach (var section in handler.GetSections (proj, container)) {
				var expander = new MacExpander () {
					ContentLabel = section.Name,
					Expandable = true,
				};
				expander.SetWidget (section.Widget);
				
				if (section.IsAdvanced) {
					advancedScrolledWindow.AddExpander (expander);
				} else {
					summaryScrolledWindow.AddExpander (expander);
				}
				
				if (section.CheckVisible != null) {
					expander.Visible = section.CheckVisible (container);
					//capture section for closure
					var s = section;
					container.Changed += delegate {
						expander.Visible = s.CheckVisible (container);
					};
				}
			}
			Show ();
		}
Пример #2
0
        public void SetPListContainer(PObjectContainer container)
        {
            var summaryScrolledWindow = new PListEditorSection();

            AppendPage(summaryScrolledWindow, new Label(GettextCatalog.GetString("Summary")));

            var advancedScrolledWindow = new PListEditorSection();

            AppendPage(advancedScrolledWindow, new Label(GettextCatalog.GetString("Advanced")));

            foreach (var section in handler.GetSections(proj, container))
            {
                var expander = new MacExpander()
                {
                    ContentLabel = section.Name,
                    Expandable   = true,
                };
                expander.SetWidget(section.Widget);

                if (section.IsAdvanced)
                {
                    advancedScrolledWindow.AddExpander(expander);
                }
                else
                {
                    summaryScrolledWindow.AddExpander(expander);
                }

                if (section.CheckVisible != null)
                {
                    expander.Visible = section.CheckVisible(container);
                    //capture section for closure
                    var s = section;
                    container.Changed += delegate
                    {
                        expander.Visible = s.CheckVisible(container);
                    };
                }
            }
            Show();
        }