~ubuntu-branches/ubuntu/feisty/monodevelop/feisty

« back to all changes in this revision

Viewing changes to Core/src/MonoDevelop.Components/MonoDevelop.Components.Commands/CommandCheckMenuItem.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-08-18 00:51:23 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060818005123-5iit07y0j7wjg55f
Tags: 0.11+svn20060818-0ubuntu1
* New SVN snapshot
  + Works with Gtk# 2.9.0
* debian/control:
  + Updated Build-Depends
* debian/patches/use_nunit2.2.dpatch,
  debian/patches/use_real_libs.dpatch:
  + Updated
* debian/patches/versioncontrol_buildfix.dpatch:
  + Fix build failure in the version control addin

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
                bool updating;
38
38
                bool isArrayItem;
39
39
                object arrayDataItem;
 
40
                object initialTarget;
40
41
                
41
42
                public CommandCheckMenuItem (object commandId, CommandManager commandManager): base ("")
42
43
                {
47
48
                                this.DrawAsRadio = true; 
48
49
                }
49
50
                
50
 
                void ICommandUserItem.Update ()
 
51
                void ICommandUserItem.Update (object initialTarget)
51
52
                {
52
53
                        if (commandManager != null && !isArrayItem) {
53
 
                                CommandInfo cinfo = commandManager.GetCommandInfo (commandId);
 
54
                                CommandInfo cinfo = commandManager.GetCommandInfo (commandId, initialTarget);
 
55
                                this.initialTarget = initialTarget;
54
56
                                Update (cinfo);
55
57
                        }
56
58
                }
57
59
                
58
 
                void ICommandMenuItem.SetUpdateInfo (CommandInfo cmdInfo)
 
60
                void ICommandMenuItem.SetUpdateInfo (CommandInfo cmdInfo, object initialTarget)
59
61
                {
60
62
                        isArrayItem = true;
61
63
                        arrayDataItem = cmdInfo.DataItem;
 
64
                        this.initialTarget = initialTarget;
62
65
                        Update (cmdInfo);
63
66
                }
64
67
                
67
70
                        base.OnParentSet (parent);
68
71
                        if (Parent == null) return;
69
72
                        
70
 
                        ((ICommandUserItem)this).Update ();
 
73
                        ((ICommandUserItem)this).Update (null);
71
74
                        
72
75
                        // Make sure the accelerators allways work for this item
73
76
                        // while the menu is hidden
84
87
                        if (commandManager == null)
85
88
                                throw new InvalidOperationException ();
86
89
 
87
 
                        commandManager.DispatchCommand (commandId, arrayDataItem);
 
90
                        commandManager.DispatchCommand (commandId, arrayDataItem, initialTarget);
88
91
                }
89
92
                
90
93
                void Update (CommandInfo cmdInfo)