#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.2 KiB

// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <author name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Linq;
using ICSharpCode.AvalonEdit.CodeCompletion;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor;
namespace ICSharpCode.AvalonEdit.AddIn
{
/// <summary>
/// Wraps the CodeEditor class to provide the ITextEditor interface.
/// </summary>
public class CodeEditorAdapter : AvalonEditTextEditorAdapter
{
readonly CodeEditor codeEditor;
public CodeEditorAdapter(CodeEditor codeEditor) : base(codeEditor.TextEditor)
{
if (codeEditor == null)
throw new ArgumentNullException("codeEditor");
this.codeEditor = codeEditor;
}
public override string FileName {
get { return codeEditor.FileName; }
}
public override void ShowCompletionWindow(ICompletionItemList data)
{
if (data == null || !data.Items.Any())
return;
CompletionWindow window = new SharpDevelopCompletionWindow(this, codeEditor.TextEditor.TextArea, data);
codeEditor.NotifyCompletionWindowOpened(window);
window.Show();
}
}
}