PythonCodeCompletionDataCore
Concrete type that gets returned and converted to an Avalonedit type implementing
ICompletionData when used from WPF ScriptEditorContorl.
using Autodesk.DesignScript.Interfaces;
namespace Dynamo.PythonServices
{
internal class PythonCodeCompletionDataCore : IExternalCodeCompletionData
{
private readonly IExternalCodeCompletionProviderCore provider;
private string description;
public string Text { get; set; }
public string Stub { get; set; }
public bool IsInstance { get; set; }
public object Content => Text;
public string Description {
get {
if (description == null)
description = provider.GetDescription(Stub, Text, IsInstance).TrimEnd('\r', '\n');
return description;
}
}
public double Priority => 0;
public ExternalCodeCompletionType CompletionType { get; set; }
public PythonCodeCompletionDataCore(string text, string stub, bool isInstance, ExternalCodeCompletionType completionType, IExternalCodeCompletionProviderCore providerCore)
{
Text = text;
Stub = stub;
IsInstance = isInstance;
provider = providerCore;
CompletionType = completionType;
}
}
}