public string Haxe_withContextualGenerator(string sourceText, MemberModel currentMember, string newName, int contextualGeneratorItem) { ASContext.Context.SetHaxeFeatures(); ASContext.Context.CurrentModel.Returns(new FileModel { haXe = true, Context = ASContext.Context }); ASContext.Context.CurrentMember.Returns(currentMember); Sci.Text = sourceText; Sci.ConfigurationLanguage = "haxe"; SnippetHelper.PostProcessSnippets(Sci, 0); var command = new ExtractLocalVariableCommand(false, newName); command.Execute(); ((CompletionListItem)command.CompletionList[contextualGeneratorItem]).PerformClick(); return(Sci.Text); }
/// <summary> /// Invoked when the user selects the "Extract Local Variable" command /// </summary> private void ExtractLocalVariableClicked(Object sender, EventArgs e) { try { String suggestion = "newVar"; String label = TextHelper.GetString("Label.NewName"); String title = TextHelper.GetString("Title.ExtractLocalVariableDialog"); LineEntryDialog askName = new LineEntryDialog(title, label, suggestion); DialogResult choice = askName.ShowDialog(); if (choice == DialogResult.OK && askName.Line.Trim().Length > 0 && askName.Line.Trim() != suggestion) { suggestion = askName.Line.Trim(); } if (choice == DialogResult.OK) { ExtractLocalVariableCommand command = new ExtractLocalVariableCommand(suggestion); command.Execute(); } } catch (Exception ex) { ErrorManager.ShowError(ex); } }
public string Haxe_withContextualGenerator(string sourceText, MemberModel currentMember, string newName, int contextualGeneratorItem) { ASContext.Context.SetHaxeFeatures(); ASContext.Context.CurrentModel.Returns(new FileModel {haXe = true, Context = ASContext.Context}); ASContext.Context.CurrentMember.Returns(currentMember); Sci.Text = sourceText; Sci.ConfigurationLanguage = "haxe"; SnippetHelper.PostProcessSnippets(Sci, 0); var command = new ExtractLocalVariableCommand(false, newName); command.Execute(); ((CompletionListItem) command.CompletionList[contextualGeneratorItem]).PerformClick(); return Sci.Text; }
/// <summary> /// Invoked when the user selects the "Extract Local Variable" command /// </summary> private void ExtractLocalVariableClicked(Object sender, EventArgs e) { try { var command = new ExtractLocalVariableCommand(); command.Execute(); } catch (Exception ex) { ErrorManager.ShowError(ex); } }