From fc8a05358a92cc3c77c5f1e30d536807ef0614fd Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 8 Apr 2019 13:49:55 +0300 Subject: were added scripting projects --- .../CodeCompletion/OverloadInsightWindow.cs | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Software/Visual_Studio/Scripting/Tango.Scripting.Editors/CodeCompletion/OverloadInsightWindow.cs (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.Editors/CodeCompletion/OverloadInsightWindow.cs') diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/CodeCompletion/OverloadInsightWindow.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/CodeCompletion/OverloadInsightWindow.cs new file mode 100644 index 000000000..5ed165aad --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/CodeCompletion/OverloadInsightWindow.cs @@ -0,0 +1,58 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Windows; +using System.Windows.Input; + +using Tango.Scripting.Editors.Editing; + +namespace Tango.Scripting.Editors.CodeCompletion +{ + /// + /// Insight window that shows an OverloadViewer. + /// + public class OverloadInsightWindow : InsightWindow + { + OverloadViewer overloadViewer = new OverloadViewer(); + + /// + /// Creates a new OverloadInsightWindow. + /// + public OverloadInsightWindow(TextArea textArea) : base(textArea) + { + overloadViewer.Margin = new Thickness(2,0,0,0); + this.Content = overloadViewer; + } + + /// + /// Gets/Sets the item provider. + /// + public IOverloadProvider Provider { + get { return overloadViewer.Provider; } + set { overloadViewer.Provider = value; } + } + + /// + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + if (!e.Handled && this.Provider.Count > 1) { + switch (e.Key) { + case Key.Up: + e.Handled = true; + overloadViewer.ChangeIndex(-1); + break; + case Key.Down: + e.Handled = true; + overloadViewer.ChangeIndex(+1); + break; + } + if (e.Handled) { + UpdateLayout(); + UpdatePosition(); + } + } + } + } +} -- cgit v1.3.1