~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        public class CodeTemplateToolboxProvider : IToolboxDynamicProvider
37
37
        {
38
38
                static string category = MonoDevelop.Core.GettextCatalog.GetString ("Text Snippets");
39
 
                
 
39
 
 
40
 
40
41
                public System.Collections.Generic.IEnumerable<ItemToolboxNode> GetDynamicItems (IToolboxConsumer consumer)
41
42
                {
42
43
                        
46
47
                                foreach (CodeTemplate ct in CodeTemplateService.GetCodeTemplatesForFile (editor.Name)) {
47
48
                                        if (ct.CodeTemplateContext != CodeTemplateContext.Standard)
48
49
                                                continue;
49
 
                                        TemplateToolboxNode n = new TemplateToolboxNode (ct);
50
 
                                        n.Description = ct.Description;
51
 
                                        n.Name = ct.Shortcut;
52
 
                                        n.Category = category;
53
 
                                        n.Icon = ImageService.GetPixbuf ("md-template", Gtk.IconSize.Menu);
54
 
                                        yield return n;
 
50
                                        yield return new TemplateToolboxNode (ct) {
 
51
                                                Category = category,
 
52
                                                Icon = ImageService.GetPixbuf ("md-template", Gtk.IconSize.Menu)
 
53
                                        };
55
54
                                }
56
55
                        }
57
56
                        yield break;
58
57
                }
59
58
                
60
 
                public event EventHandler ItemsChanged;
 
59
                public event EventHandler ItemsChanged {
 
60
                        add { CodeTemplateService.TemplatesChanged += value; }
 
61
                        remove { CodeTemplateService.TemplatesChanged -= value; }
 
62
                }
61
63
        }
62
64
}