36
36
ShowCodeGenerationWindow
39
public class ShowCodeGenerationWindowHandler : CommandHandler
41
protected override void Run ()
43
Document document = IdeApp.Workbench.ActiveDocument;
46
var completionWidget = document.GetContent<ICompletionWidget> ();
47
if (completionWidget == null)
49
CodeCompletionContext completionContext = completionWidget.CreateCodeCompletionContext (document.Editor.Caret.Offset);
50
GenerateCodeWindow.ShowIfValid (document, completionContext);
53
protected override void Update (CommandInfo info)
55
Document document = IdeApp.Workbench.ActiveDocument;
56
info.Enabled = document != null && document.Editor != null
57
&& document.Editor.HasFocus && document.GetContent<ICompletionWidget> () != null;