|
|
|
|
|
|
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using ICSharpCode.AvalonEdit.CodeCompletion; |
|
|
using ICSharpCode.AvalonEdit.Document; |
|
|
using ICSharpCode.AvalonEdit.Editing; |
|
|
using Microsoft.Scripting.Hosting.Shell; |
|
|
using Microsoft.Scripting; |
|
|
|
|
|
namespace PythonConsoleControl |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
public class PythonCompletionData : ICompletionData |
|
|
{ |
|
|
CommandLine commandLine; |
|
|
|
|
|
public PythonCompletionData(string text, string stub, CommandLine commandLine, bool isInstance) |
|
|
{ |
|
|
this.Text = text; |
|
|
this.Stub = stub; |
|
|
this.commandLine = commandLine; |
|
|
this.IsInstance = isInstance; |
|
|
} |
|
|
|
|
|
public System.Windows.Media.ImageSource Image |
|
|
{ |
|
|
get { return null; } |
|
|
} |
|
|
|
|
|
public string Text { get; private set; } |
|
|
|
|
|
public string Stub { get; private set; } |
|
|
|
|
|
public bool IsInstance { get; private set; } |
|
|
|
|
|
|
|
|
public object Content |
|
|
{ |
|
|
get { return this.Text; } |
|
|
} |
|
|
|
|
|
public object Description |
|
|
{ |
|
|
get { |
|
|
|
|
|
return "Not available"; |
|
|
} |
|
|
} |
|
|
|
|
|
public double Priority { get { return 0; } } |
|
|
|
|
|
public void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs) |
|
|
{ |
|
|
textArea.Document.Replace(completionSegment, this.Text); |
|
|
} |
|
|
} |
|
|
} |
|
|
|