Пример #1
0
        private void UpdateProjectList()
        {
            store.Clear();
            foreach (Project p in this.projects)
            {
                GLib.Value Name = new GLib.Value(p.Projectname);
                Gdk.Pixbuf buf;
                if (p.ProjectStatus.BuildStatus == BuildStatus.Success)
                {
                    Console.WriteLine("OK");
                    buf = new Gdk.Pixbuf(null, "green-24.png");
                }
                else if (p.ProjectStatus.BuildStatus == BuildStatus.Failure)
                {
                    Console.WriteLine("Failed");
                    buf = new Gdk.Pixbuf(null, "red-24.png");
                }
                else
                {
                    Console.WriteLine("Unknown");
                    buf = new Gdk.Pixbuf(null, "gray-24.png");
                }
                store.Append(out iter);
                store.SetValue(iter, 0, Name);
                store.SetValue(iter, 1, buf);
                store.SetValue(iter, 2, this.projects.IndexOf(p));
            }
            MonoTray.SaveProjects(this.projects);

            this.projectsTreeview.ShowAll();
        }
Пример #2
0
 private void AddChildren(NodeInfo r, TreeIter parent)
 {
     foreach (NodeInfo child in Finder.GetChildren(r))
     {
         TreeIter i = memberStore.Append(parent);
         memberStore.SetValue(i, 0, new TreeCell(child));
         TreeIter j = memberStore.Append(i);
         memberStore.SetValue(j, 0, new TreeCell(dummyText));
     }
 }
Пример #3
0
        object AddTypeWithoutNamespace(Type t, Hashtable ht)
        {
            TreeIter iter;

            //Console.WriteLine ("add type {0}", t.FullName);

            if (!IsVisible(t))
            {
                return(null);
            }

            //Console.WriteLine ("try type {0}", t.FullName);
            if (ht [t] != null)
            {
                return((TreeIter)ht [t]);
            }

            //Console.WriteLine ("new line {0}", t.FullName);

            iter = new TreeIter();
            if (t.BaseType == null)             // FIXME? || t.BaseType.Assembly != assembly)
            {
                typeStore.Append(out iter);
            }
            else
            {
                typeStore.Append(out iter, (TreeIter)AddTypeWithoutNamespace(t.BaseType, ht));
            }

            TypeRecord tr = new TypeRecord(t);

            typeStore.SetValue(iter, 0, new GLib.Value(tr.Label));
            typeStore.SetValue(iter, 1, new GLib.Value(t.FullName));
            typeStore.SetValue(iter, 2, new GLib.Value(tr.Icon));

            ht [t] = iter;

            return(iter);
        }
Пример #4
0
 TreeIter MakeNode(TreeIter parent, out TreeIter iter, string text)
 {
     store.Append(out iter, parent);
     store.SetValue(iter, 0, new GLib.Value(text));
     return(iter);
 }
Пример #5
0
        public void Refresh()
        {
            store.Clear();
            memberRecords.Clear();
            if (factory != null && factory.Info != null)
            {
                Hashtable count  = new Hashtable();
                Hashtable parent = new Hashtable();
                TreeIter  iter;

                foreach (MemberRecord mr in factory.Info)
                {
                    if (factory.HideDuplicates && count [mr.Name] != null)
                    {
                        if ((int)count [mr.Name] == 1)
                        {
                            TreeIter   orig = (TreeIter)parent [mr.Name];
                            TreeIter   root;
                            object     name, value;
                            GLib.Value image = new Value();

                            name  = store.GetValue(orig, 0);
                            value = store.GetValue(orig, 1);
                            store.GetValue(orig, 2, image);
                            store.Remove(out orig);

                            store.Append(out root);
                            store.SetValue(root, 0, new GLib.Value(mr.Name));
                            store.SetValue(root, 1, new GLib.Value(mr.Name + " (2)"));

                            parent [mr.Name] = root;

                            store.Append(out orig, root);
                            store.SetValue(orig, 0, name);
                            store.SetValue(orig, 1, value);
                            store.SetValue(orig, 2, image);

                            store.Append(out iter, root);
                            memberRecords [orig] = memberRecords [root];
                            memberRecords [root] = null;
                        }
                        else
                        {
                            //Console.WriteLine ("4");
                            store.Append(out iter, (TreeIter)parent [mr.Name]);
                            store.SetValue((TreeIter)parent [mr.Name], 0, new GLib.Value(mr.Name));
                            store.SetValue((TreeIter)parent [mr.Name], 1, new GLib.Value(mr.Name
                                                                                         + " (" + ((int)count [mr.Name] + 1) + ")"));
                        }

                        count [mr.Name] = 1 + (int)count [mr.Name];
                    }
                    else
                    {
                        store.Append(out iter);
                        count [mr.Name]  = 1;
                        parent [mr.Name] = iter;
                    }

                    memberRecords [iter] = mr;
                    store.SetValue(iter, 0, mr.Name);
                    store.SetValue(iter, 1, mr.Label);
                    store.SetValue(iter, 2, mr.Icon);
                }
            }
        }