Exemple #1
0
        private void Add(bool hasParent, TreeIter parent, string prefix, object obj, bool loadMembers, bool raw)
        {
            IObjectViewer viewer;

            if (raw)
            {
                viewer = ObjectViewerDirectory.Standard;
            }
            else
            {
                viewer = ObjectViewerDirectory.Choose(obj);
            }

            ObjectViewHeader header = viewer.GetHeader(obj);

            if (!loadMembers)
            {
                if (hasParent)
                {
                    parent = store.AppendValues(parent, prefix + header.Description, GtkProofBox.Box(obj), false);
                }
                else
                {
                    parent = store.AppendValues(prefix + header.Description, GtkProofBox.Box(obj), false);
                }
            }

            if (header.HasMembers || header.AllowRawView)
            {
                if (loadMembers)
                {
                    List <Tupple <string, object> > members = viewer.GetMembers(obj);

                    foreach (Tupple <string, object> member in members)
                    {
                        Add(true, parent, member.A + " = ", member.B, false, false);
                    }

                    if (header.AllowRawView)
                    {
                        parent = store.AppendValues(parent, "Raw view", GtkProofBox.Box(obj), true);

                        ObjectViewHeader rawHeader = ObjectViewerDirectory.Standard.GetHeader(obj);

                        if (rawHeader.HasMembers)
                        {
                            store.AppendValues(parent, "**load on expand placeholder**", null, false);
                        }
                    }
                }
                else
                {
                    store.AppendValues(parent, "**load on expand placeholder**", null);
                }
            }
        }
Exemple #2
0
 private void Add(TreeIter parent, string prefix, string node)
 {
     store.AppendValues(parent, prefix + TextEscape.Quote(node), GtkProofBox.Box(node));
 }