Ejemplo n.º 1
0
        public override void Load(string fileName)
        {
            ContentName = fileName;

            if (pobject == null)
            {
                var dict = new PDictionary();
                if (dict.Reload(fileName))
                {
                    pobject = dict;
                }
                else
                {
                    var arr = new PArray();
                    if (!arr.Reload(fileName))
                    {
                        MessageService.ShowError(GettextCatalog.GetString("Can't load plist file {0}.", fileName));
                        return;
                    }
                    pobject = arr;
                }

                Buffer = null;
                widget.SetPListContainer(pobject);
                pobject.Changed += (sender, e) => {
                    Buffer  = null;
                    IsDirty = true;
                };
            }
            this.IsDirty = false;
        }
Ejemplo n.º 2
0
 public void SetPListContainer(PObjectContainer value)
 {
     nsDictionary          = value;
     nsDictionary.Changed += delegate {
         QueueDraw();
     };
     RefreshTree();
 }
Ejemplo n.º 3
0
 public void SetPListContainer(PObjectContainer value)
 {
     RootPObject          = value;
     RootPObject.Changed += delegate {
         RefreshTree();
         QueueDraw();
     };
     RefreshTree();
 }
Ejemplo n.º 4
0
        public void SetPListContainer(PObjectContainer container)
        {
            if (!(container is PArray))
            {
                throw new ArgumentException("The PList container must be a PArray.", "container");
            }

            array          = (PArray)container;
            array.Changed += OnArrayChanged;
            RefreshList();
        }
Ejemplo n.º 5
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();
        }