~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric-updates

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.GtkCore/lib/stetic/libsteticui/ActionGroupComponent.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
using System;
3
 
using System.Collections;
4
 
using System.Collections.Specialized;
5
 
 
6
 
namespace Stetic
7
 
{
8
 
        [Serializable]
9
 
        public class ActionGroupComponent: Component
10
 
        {
11
 
                public ActionGroupComponent (Application app, object backend, string name): base (app, backend, name, app.GetComponentType ("Gtk.ActionGroup"))
12
 
                {
13
 
                }
14
 
                
15
 
                public override string Name {
16
 
                        get {
17
 
                                if (name == null)
18
 
                                        name = ((Wrapper.ActionGroup)backend).Name;
19
 
                                return name;
20
 
                        }
21
 
                        set {
22
 
                                name = value;
23
 
                                ((Wrapper.ActionGroup)backend).Name = value;
24
 
                        }
25
 
                }
26
 
                
27
 
                public override bool GeneratePublic {
28
 
                        get { return ((Wrapper.ActionGroup)backend).GeneratePublic; }
29
 
                        set { ((Wrapper.ActionGroup)backend).GeneratePublic = value; }
30
 
                }
31
 
                
32
 
                protected override void OnChanged ()
33
 
                {
34
 
                        name = null;
35
 
                        base.OnChanged ();
36
 
                }
37
 
                
38
 
                public ActionComponent[] GetActions ()
39
 
                {
40
 
                        Wrapper.ActionCollection acts = ((Wrapper.ActionGroup)backend).Actions;
41
 
                        
42
 
                        ArrayList comps = new ArrayList (acts.Count);
43
 
                        
44
 
                        for (int n=0; n<acts.Count; n++) {
45
 
                                ActionComponent ac = (ActionComponent) app.GetComponent (acts[n], null, null);
46
 
                                if (ac != null)
47
 
                                        comps.Add (ac);
48
 
                        }
49
 
                                
50
 
                        return (ActionComponent[]) comps.ToArray (typeof(ActionComponent));
51
 
                }
52
 
                
53
 
                public override Component[] GetChildren ()
54
 
                {
55
 
                        return GetActions ();
56
 
                }
57
 
        }
58
 
}