diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-04-23 22:25:54 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-04-23 22:25:54 +0300 |
| commit | ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb (patch) | |
| tree | 293aee8b1751ce7fce542645722c0f1a96b73097 /Software/Visual_Studio/TEMP/Tango.Scripting | |
| parent | 52967e858bd52621208f6360e84f4c47ec435816 (diff) | |
| parent | 636ad730569dfef1a4ee04c8d716d510bcc47ee1 (diff) | |
| download | Tango-ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb.tar.gz Tango-ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb.zip | |
merge alarm handling from remote
Diffstat (limited to 'Software/Visual_Studio/TEMP/Tango.Scripting')
175 files changed, 9105 insertions, 539 deletions
diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionListBoxItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionListBoxItem.cs index bb6acf69e..55d752bfd 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionListBoxItem.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionListBoxItem.cs @@ -42,11 +42,15 @@ namespace Tango.Scripting.Editors.CodeCompletion protected override void OnSelected(RoutedEventArgs e) { - base.OnSelected(e); - toolTip.Content = DataContext; - toolTip.ContentTemplate = ToolTipContentTemplate; - toolTip.StaysOpen = true; - toolTip.IsOpen = true; + try + { + base.OnSelected(e); + toolTip.Content = DataContext; + toolTip.ContentTemplate = ToolTipContentTemplate; + toolTip.StaysOpen = true; + toolTip.IsOpen = true; + } + catch { } } protected override void OnUnselected(RoutedEventArgs e) diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindow.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindow.cs index 0e8cd781d..33759e351 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindow.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindow.cs @@ -84,6 +84,8 @@ namespace Tango.Scripting.Editors.CodeCompletion { InsertionRequest?.Invoke(item); } + + completionList.SelectedItem = null; } void AttachEvents() diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindowBase.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindowBase.cs index b5bab3f97..7766d323a 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindowBase.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/CompletionWindowBase.cs @@ -79,6 +79,7 @@ namespace Tango.Scripting.Editors.CodeCompletion public virtual void HideCompletion() { + Debug.WriteLine("Hide Completion..."); DetachEvents(); Hide(); } @@ -148,7 +149,7 @@ namespace Tango.Scripting.Editors.CodeCompletion public override void Detach() { base.Detach(); - window.HideCompletion(); + //window.HideCompletion(); } const Key KeyDeadCharProcessed = (Key)0xac; // Key.DeadCharProcessed; // new in .NET 4 @@ -289,7 +290,7 @@ namespace Tango.Scripting.Editors.CodeCompletion //sourceIsInitialized = true; } - private void SetPosition() + public void SetPosition() { if (document != null && this.StartOffset != this.TextArea.Caret.Offset) { @@ -300,6 +301,16 @@ namespace Tango.Scripting.Editors.CodeCompletion SetPosition(this.TextArea.Caret.Position); } } + + public void UpdatePositionFix() + { + SetPosition(this.TextArea.Caret.Position); + } + + //public void UpdatePosition() + //{ + // SetPosition(this.TextArea.Caret.Position); + //} /// <inheritdoc/> protected override void OnClosed(EventArgs e) @@ -336,7 +347,7 @@ namespace Tango.Scripting.Editors.CodeCompletion /// Updates the position of the CompletionWindow based on the parent TextView position and the screen working area. /// It ensures that the CompletionWindow is completely visible on the screen. /// </summary> - protected void UpdatePosition() + public void UpdatePosition() { TextView textView = this.TextArea.TextView; // PointToScreen returns device dependent units (physical pixels) @@ -367,6 +378,8 @@ namespace Tango.Scripting.Editors.CodeCompletion bounds = bounds.TransformFromDevice(textView); this.Left = bounds.X; this.Top = bounds.Y; + + Debug.WriteLine($"Position: {Left}x{Top}"); } /// <inheritdoc/> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/ICompletionData.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/ICompletionData.cs index b0e9eeccb..9f16876b3 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/ICompletionData.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/CodeCompletion/ICompletionData.cs @@ -3,6 +3,7 @@ using System; using System.Windows.Media; +using System.Windows.Media.Imaging; using Tango.Scripting.Editors.Document; using Tango.Scripting.Editors.Editing; @@ -13,32 +14,26 @@ namespace Tango.Scripting.Editors.CodeCompletion /// </summary> public interface ICompletionData { - /// <summary> - /// Gets the image. - /// </summary> - ImageSource Image { get; } - - /// <summary> - /// Gets the text. This property is used to filter the list of visible elements. - /// </summary> - string Text { get; } - - /// <summary> - /// The displayed content. This can be the same as 'Text', or a WPF UIElement if - /// you want to display rich content. - /// </summary> - object Content { get; } + /// <summary> + /// Gets the image. + /// </summary> + BitmapSource Image { get; } + + /// <summary> + /// Gets the text. This property is used to filter the list of visible elements. + /// </summary> + string Text { get; } /// <summary> /// Gets the description. /// </summary> - object Description { get; } + object Description { get; set; } /// <summary> /// Gets the priority. This property is used in the selection logic. You can use it to prefer selecting those items /// which the user is accessing most frequently. /// </summary> - double Priority { get; } + double Priority { get; set; } /// <summary> /// Perform the completion. @@ -49,6 +44,6 @@ namespace Tango.Scripting.Editors.CodeCompletion /// <param name="insertionRequestEventArgs">The EventArgs used for the insertion request. /// These can be TextCompositionEventArgs, KeyEventArgs, MouseEventArgs, depending on how /// the insertion was triggered.</param> - void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs); + void Complete(ScriptEditor editor); } } diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Converters/BooleanToVisibilityConverter.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Converters/BooleanToVisibilityConverter.cs new file mode 100644 index 000000000..7412e4a67 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Converters/BooleanToVisibilityConverter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.Scripting.Editors.Converters +{ + public class BooleanToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return (bool)value ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Converters/BooleanToVisibilityInversedConverter.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Converters/BooleanToVisibilityInversedConverter.cs new file mode 100644 index 000000000..c91aa45fd --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Converters/BooleanToVisibilityInversedConverter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.Scripting.Editors.Converters +{ + public class BooleanToVisibilityInversedConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return (bool)value ? Visibility.Collapsed : Visibility.Visible; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Editing/Caret.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Editing/Caret.cs index 23542cd21..fb21448e5 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Editing/Caret.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Editing/Caret.cs @@ -267,7 +267,7 @@ namespace Tango.Scripting.Editors.Editing if (!visualColumnValid) { TextDocument document = textArea.Document; if (document != null) { - Debug.WriteLine("Explicit validation of caret column"); + //Debug.WriteLine("Explicit validation of caret column"); var documentLine = document.GetLineByNumber(position.Line); RevalidateVisualColumn(textView.GetOrConstructVisualLine(documentLine)); } diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/ExtensionMethods.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/ExtensionMethods.cs new file mode 100644 index 000000000..1605ff281 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/ExtensionMethods.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace Tango.Scripting.Editors +{ + internal static class ExtensionMethodsNoName + { + public static String Remove(this String str, String pattern) + { + return Regex.Replace(str, pattern, ""); + } + + public static String GetFriendlyName(this Type type) + { + String name = type.Name; + + if (type.IsGenericType) + { + List<String> args = new List<string>(); + + foreach (var lGenericArgument in type.GetGenericTypeDefinition().GetGenericArguments()) + { + args.Add(lGenericArgument.Name); + } + + String gArgs = String.Join(",", args); + + name = $"{new String(type.Name.TakeWhile(x => x != '`').ToArray())}<{gArgs}>"; + } + + return name; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Highlighting/Resources/CSharp-Mode.xshd b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Highlighting/Resources/CSharp-Mode.xshd index a8ca62be2..40f362e08 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Highlighting/Resources/CSharp-Mode.xshd +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Highlighting/Resources/CSharp-Mode.xshd @@ -184,6 +184,8 @@ <Word>dynamic</Word> <Word>await</Word> <Word>void</Word> + <Word>interface</Word> + <Word>this</Word> </Keywords> <Keywords color="ExceptionKeywords"> @@ -220,6 +222,7 @@ <Word>uint</Word> <Word>ushort</Word> <Word>ulong</Word> + <Word>null</Word> </Keywords> <Keywords color="ReferenceTypes"> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/class.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/class.png Binary files differnew file mode 100644 index 000000000..3e40469f5 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/class.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/enum.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/enum.png Binary files differnew file mode 100644 index 000000000..b79aa844f --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/enum.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/field.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/field.png Binary files differnew file mode 100644 index 000000000..763eadffb --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/field.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/interface.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/interface.png Binary files differnew file mode 100644 index 000000000..fb00f0cc7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/interface.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/method.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/method.png Binary files differnew file mode 100644 index 000000000..249689941 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/method.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/namespace.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/namespace.png Binary files differnew file mode 100644 index 000000000..6520448ce --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/namespace.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/property.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/property.png Binary files differnew file mode 100644 index 000000000..d2f90f569 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/property.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubclass.gif b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubclass.gif Binary files differdeleted file mode 100644 index 28abc36a7..000000000 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubclass.gif +++ /dev/null diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubevent.gif b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubevent.gif Binary files differdeleted file mode 100644 index 7c2466f0e..000000000 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubevent.gif +++ /dev/null diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubmethod.gif b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubmethod.gif Binary files differdeleted file mode 100644 index 040280d15..000000000 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubmethod.gif +++ /dev/null diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubproperty.gif b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubproperty.gif Binary files differdeleted file mode 100644 index 49d5042b9..000000000 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/pubproperty.gif +++ /dev/null diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/struct.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/struct.png Binary files differnew file mode 100644 index 000000000..02fbdbde7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Images/struct.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ClassCompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ClassCompletionItem.cs new file mode 100644 index 000000000..a1734ba30 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ClassCompletionItem.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class ClassCompletionItem : CompletionItem + { + private static BitmapSource image = GetImage("class.png"); + + public override BitmapSource Image => image; + public override string Text => Name; + + public String Name { get; set; } + public String Namespace { get; set; } + public override CompletionItemPopupControl PopupControl => new ClassCompletionItemPopup(); + + public override void Complete(ScriptEditor editor) + { + base.Complete(editor); + + if (Text.Contains("<T>")) + { + editor.CaretOffset -= 2; + editor.Select(editor.CaretOffset, 1); + } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ClassCompletionItemPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ClassCompletionItemPopup.cs new file mode 100644 index 000000000..d575ba9db --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ClassCompletionItemPopup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class ClassCompletionItemPopup : CompletionItemPopupControl + { + static ClassCompletionItemPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(ClassCompletionItemPopup), new FrameworkPropertyMetadata(typeof(ClassCompletionItemPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/CompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/CompletionItem.cs new file mode 100644 index 000000000..c8beebd28 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/CompletionItem.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.Scripting.Editors.Document; +using Tango.Scripting.Editors.Editing; + +namespace Tango.Scripting.Editors.Intellisense +{ + public abstract class CompletionItem : DependencyObject, ICompletionItem + { + public abstract string Text { get; } + public object Description { get; set; } + public double Priority { get; set; } + public abstract CompletionItemPopupControl PopupControl { get; } + + public bool IsSelected + { + get { return (bool)GetValue(IsSelectedProperty); } + set { SetValue(IsSelectedProperty, value); } + } + public static readonly DependencyProperty IsSelectedProperty = + DependencyProperty.Register("IsSelected", typeof(bool), typeof(CompletionItem), new PropertyMetadata(false)); + + public virtual void Complete(ScriptEditor editor) + { + var word = editor.GetCurrentWord(); + int index = editor.GetCurrentWordStartIndex(); + int max = editor.GetCurrentLine().EndOffset; + + editor.Document.Replace(index, word.Length,Text); + } + + public abstract BitmapSource Image { get; } + + protected static BitmapSource GetImage(String name) + { + return new BitmapImage(new Uri($"pack://application:,,,/Tango.Scripting.Editors;component/Images/{name}", UriKind.Absolute)); + } + + public override string ToString() + { + return Text; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/CompletionItemPopupControl.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/CompletionItemPopupControl.cs new file mode 100644 index 000000000..14e5b6681 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/CompletionItemPopupControl.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; + +namespace Tango.Scripting.Editors.Intellisense +{ + public abstract class CompletionItemPopupControl : Control + { + + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/EnumCompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/EnumCompletionItem.cs new file mode 100644 index 000000000..c8f34347e --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/EnumCompletionItem.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class EnumCompletionItem : CompletionItem + { + private static BitmapSource image = GetImage("enum.png"); + + public override BitmapSource Image => image; + public override string Text => Name; + public override CompletionItemPopupControl PopupControl => new EnumCompletionItemPopup(); + + public String Name { get; set; } + public String Namespace { get; set; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/EnumCompletionItemPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/EnumCompletionItemPopup.cs new file mode 100644 index 000000000..0ef29c338 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/EnumCompletionItemPopup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class EnumCompletionItemPopup : CompletionItemPopupControl + { + static EnumCompletionItemPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(EnumCompletionItemPopup), new FrameworkPropertyMetadata(typeof(EnumCompletionItemPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/FieldCompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/FieldCompletionItem.cs new file mode 100644 index 000000000..3b1996174 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/FieldCompletionItem.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class FieldCompletionItem : CompletionItem + { + public override string Text => Name; + public override CompletionItemPopupControl PopupControl => new FieldCompletionItemPopup(); + public override BitmapSource Image => GetImage("field.png"); + + public String Name { get; set; } + public String Class { get; set; } + public String Type { get; set; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/FieldCompletionItemPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/FieldCompletionItemPopup.cs new file mode 100644 index 000000000..e1ea3ce55 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/FieldCompletionItemPopup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class FieldCompletionItemPopup : CompletionItemPopupControl + { + static FieldCompletionItemPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(FieldCompletionItemPopup), new FrameworkPropertyMetadata(typeof(FieldCompletionItemPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ICompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ICompletionItem.cs new file mode 100644 index 000000000..83e304e8b --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ICompletionItem.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Scripting.Editors.CodeCompletion; + +namespace Tango.Scripting.Editors.Intellisense +{ + public interface ICompletionItem : ICompletionData + { + CompletionItemPopupControl PopupControl { get; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/DetectedType.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ICompletionProvider.cs index d388e6798..bc48ce401 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/DetectedType.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/ICompletionProvider.cs @@ -4,10 +4,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Tango.Scripting.Parsing +namespace Tango.Scripting.Editors.Intellisense { - public class DetectedType + public interface ICompletionProvider { - public Type Type { get; set; } + } } diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/InterfaceCompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/InterfaceCompletionItem.cs new file mode 100644 index 000000000..56f6db7af --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/InterfaceCompletionItem.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class InterfaceCompletionItem : CompletionItem + { + private static BitmapSource image = GetImage("interface.png"); + + public override string Text => Name; + public override CompletionItemPopupControl PopupControl => new InterfaceCompletionItemPopup(); + public override BitmapSource Image => image; + + public String Name { get; set; } + public String Namespace { get; set; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/InterfaceCompletionItemPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/InterfaceCompletionItemPopup.cs new file mode 100644 index 000000000..126a81c4c --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/InterfaceCompletionItemPopup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class InterfaceCompletionItemPopup : CompletionItemPopupControl + { + static InterfaceCompletionItemPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(InterfaceCompletionItemPopup), new FrameworkPropertyMetadata(typeof(InterfaceCompletionItemPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownType.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownType.cs new file mode 100644 index 000000000..28f9ccb9a --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownType.cs @@ -0,0 +1,222 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using Tango.Core; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class KnownType + { + private bool _initialized; + private bool _documentationLoaded; + + public Type Type { get; private set; } + public String Name { get; private set; } + public String TypeDefinition { get; private set; } + public String FriendlyName { get; private set; } + public String Summary { get; set; } + public List<KnownTypeConstructor> Constructors { get; set; } + public List<KnownTypeMethod> Methods { get; set; } + public List<KnownTypeProperty> Properties { get; set; } + public List<KnownTypeMember> Members + { + get + { + List<KnownTypeMember> members = new List<KnownTypeMember>(); + + members.AddRange(Properties); + members.AddRange(Methods); + + return members.OrderBy(x => x.Name).ToList(); + } + } + public List<KnownTypeField> Fields { get; set; } + + public KnownType(Type type) + { + Summary = "Loading documentation..."; + Constructors = new List<KnownTypeConstructor>(); + Methods = new List<KnownTypeMethod>(); + Properties = new List<KnownTypeProperty>(); + Fields = new List<KnownTypeField>(); + Type = type; + Name = type.Name; + + Init(); + } + + public override string ToString() + { + return Type.ToString(); + } + + private void Init() + { + InitTypeDefinition(); + InitFriendlyName(); + InitType(); + } + + private void InitFriendlyName() + { + FriendlyName = Type.GetFriendlyName(); + } + + private void InitTypeDefinition() + { + if (Type.IsClass) TypeDefinition = "class"; + else if (Type.IsEnum) TypeDefinition = "enum"; + else if (Type.IsInterface) TypeDefinition = "interface"; + else if (Type.IsValueType) TypeDefinition = "struct"; + } + + private void InitType() + { + if (!_initialized) + { + _initialized = true; + + //Load Constructors... + { + var constructors = Type.GetConstructors().Where(x => x.IsPublic).ToList(); + + for (int i = 0; i < constructors.Count; i++) + { + var constructor = constructors[i]; + + KnownTypeConstructor c = new KnownTypeConstructor(this); + + var parameters = constructor.GetParameters().ToList(); + + for (int j = 0; j < parameters.Count; j++) + { + var parameter = parameters[j]; + + KnownTypeMethodParameter p = new KnownTypeMethodParameter(); + p.Type = parameter.ParameterType.GetFriendlyName(); + p.Name = parameter.Name; + + if (j == parameters.Count - 1) + { + p.IsLast = true; + } + + c.Parameters.Add(p); + } + + Constructors.Add(c); + } + } + + //Load Methods... + { + var methods = Type.GetRuntimeMethods().Where(x => x.IsPublic && !x.IsSpecialName).ToList(); + + //TODO: Separate extension methods! + methods.AddRange(Type.GetExtensionMethods(Type.Assembly).ToList()); + + if (typeof(IEnumerable).IsAssignableFrom(Type)) + { + var linqMethods = typeof(System.Linq.Enumerable).GetMethods(BindingFlags.Static | BindingFlags.Public).ToList(); + methods.AddRange(linqMethods); + } + + for (int i = 0; i < methods.Count; i++) + { + var method = methods[i]; + + KnownTypeMethod m = new KnownTypeMethod(this); + m.Name = method.Name; + m.ReturnType = method.ReturnType; + m.ReturnTypeFriendlyName = method.ReturnType.GetFriendlyName(); + + if (method.IsGenericMethod) + { + foreach (var lGenericArgument in method.GetGenericMethodDefinition().GetGenericArguments()) + { + m.TypeArguments.Add(lGenericArgument.Name); + } + } + + var parameters = method.GetParameters().ToList(); + + bool isLinq = method.DeclaringType == typeof(Enumerable); + + for (int j = 0; j < parameters.Count; j++) + { + var parameter = parameters[j]; + + KnownTypeMethodParameter p = new KnownTypeMethodParameter(); + p.Type = parameter.ParameterType.GetFriendlyName(); + p.Name = parameter.Name; + + if (j == parameters.Count - 1) + { + p.IsLast = true; + } + + if (j == 0 && isLinq) continue; + m.Parameters.Add(p); + } + + Methods.Add(m); + } + } + + //Load Properties + { + var properties = Type.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPublic).ToList(); + + for (int i = 0; i < properties.Count; i++) + { + var property = properties[i]; + + KnownTypeProperty p = new KnownTypeProperty(this); + p.Name = property.Name; + p.ReturnType = property.PropertyType; + p.ReturnTypeFriendlyName = property.PropertyType.GetFriendlyName(); + + Properties.Add(p); + } + } + + //Load Enum Values + { + if (Type.IsEnum) + { + var values = Enum.GetNames(Type).ToList(); + + for (int i = 0; i < values.Count; i++) + { + var value = values[i]; + + KnownTypeField f = new KnownTypeField(this); + f.Name = value; + f.ReturnType = typeof(Int32); + f.ReturnTypeFriendlyName = typeof(Int32).Name; + Fields.Add(f); + } + } + } + + _initialized = true; + } + } + + public void LoadDocumentation() + { + if (!_documentationLoaded) + { + _documentationLoaded = true; + + Utils.LoadKnownTypeDocs(this); + } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeConstructor.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeConstructor.cs new file mode 100644 index 000000000..83dc3f750 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeConstructor.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class KnownTypeConstructor + { + public KnownType Type { get; set; } + + public String Summary { get; set; } + + public List<KnownTypeMethodParameter> Parameters { get; set; } + + public KnownTypeConstructor() + { + Summary = "Loading documentation..."; + Parameters = new List<KnownTypeMethodParameter>(); + } + + public KnownTypeConstructor(KnownType knownType) : this() + { + Type = knownType; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeField.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeField.cs new file mode 100644 index 000000000..cd1349744 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeField.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class KnownTypeField : KnownTypeMember + { + public KnownTypeField() + { + Summary = "Loading documentation..."; + } + + public KnownTypeField(KnownType knownType) : this() + { + Type = knownType; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeMember.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeMember.cs new file mode 100644 index 000000000..bae4edf41 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeMember.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Editors.Intellisense +{ + public abstract class KnownTypeMember + { + public Type ReturnType { get; set; } + + public String ReturnTypeFriendlyName { get; set; } + + public KnownType Type { get; set; } + + public String Summary { get; set; } + + public String Name { get; set; } + + public KnownTypeMember() + { + Summary = "Loading documentation..."; + } + + public KnownTypeMember(KnownType knownType) : this() + { + Type = knownType; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeMethod.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeMethod.cs new file mode 100644 index 000000000..f84e26fe5 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeMethod.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class KnownTypeMethod : KnownTypeMember + { + public List<KnownTypeMethodParameter> Parameters { get; set; } + + public List<String> TypeArguments { get; set; } + + public String NameWithTypeArguments + { + get + { + if (TypeArguments.Count == 0) + { + return Name; + } + else + { + return Name + $"<{String.Join(",", TypeArguments)}>"; + } + } + } + + public KnownTypeMethod() + { + Summary = "Loading documentation..."; + Parameters = new List<KnownTypeMethodParameter>(); + TypeArguments = new List<string>(); + } + + public KnownTypeMethod(KnownType knownType) : this() + { + Type = knownType; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptVariable.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeMethodParameter.cs index c843e07c6..59f6db4fd 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptVariable.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeMethodParameter.cs @@ -4,16 +4,13 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Tango.Scripting.Parsing +namespace Tango.Scripting.Editors.Intellisense { - public class ScriptVariable + public class KnownTypeMethodParameter { - public String Name { get; set; } public String Type { get; set; } - - public override string ToString() - { - return String.Format("{0} : {1}", Type, Name); - } + public String Name { get; set; } + public String Description { get; set; } + public bool IsLast { get; set; } } } diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeProperty.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeProperty.cs new file mode 100644 index 000000000..52717579a --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/KnownTypeProperty.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class KnownTypeProperty : KnownTypeMember + { + public KnownTypeProperty() + { + Summary = "Loading documentation..."; + } + + public KnownTypeProperty(KnownType knownType) : this() + { + Type = knownType; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/MethodCompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/MethodCompletionItem.cs new file mode 100644 index 000000000..d2ee40920 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/MethodCompletionItem.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class MethodCompletionItem : CompletionItem + { + private static BitmapSource image = GetImage("method.png"); + + public override string Text => Name; + public override CompletionItemPopupControl PopupControl => new MethodCompletionItemPopup(); + public override BitmapSource Image => image; + + public String Class { get; set; } + public String Name { get; set; } + public String ReturnType { get; set; } + + public int Overloads { get; set; } + + public bool HasOverloads + { + get { return Overloads > 0; } + } + + public List<KnownTypeMethodParameter> Parameters { get; set; } + + public override void Complete(ScriptEditor editor) + { + base.Complete(editor); + + if (Text.Contains("<T>")) + { + editor.CaretOffset -= 2; + editor.Select(editor.CaretOffset, 1); + } + } + + public MethodCompletionItem() + { + Parameters = new List<KnownTypeMethodParameter>(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/MethodCompletionItemPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/MethodCompletionItemPopup.cs new file mode 100644 index 000000000..1b9717307 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/MethodCompletionItemPopup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class MethodCompletionItemPopup : CompletionItemPopupControl + { + static MethodCompletionItemPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(MethodCompletionItemPopup), new FrameworkPropertyMetadata(typeof(MethodCompletionItemPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/NamespaceCompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/NamespaceCompletionItem.cs new file mode 100644 index 000000000..d5c8db38a --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/NamespaceCompletionItem.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class NamespaceCompletionItem : CompletionItem + { + private static BitmapSource image = GetImage("namespace.png"); + + public override string Text => Name; + public override CompletionItemPopupControl PopupControl => new NamespaceCompletionItemPopup(); + public override BitmapSource Image => image; + + public String Name { get; set; } + public String Assembly { get; set; } + + public override void Complete(ScriptEditor editor) + { + var line = editor.GetCurrentLine(); + editor.Document.Replace(line, "using " + Name); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/NamespaceCompletionItemPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/NamespaceCompletionItemPopup.cs new file mode 100644 index 000000000..7adc82fd8 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/NamespaceCompletionItemPopup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class NamespaceCompletionItemPopup : CompletionItemPopupControl + { + static NamespaceCompletionItemPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(NamespaceCompletionItemPopup), new FrameworkPropertyMetadata(typeof(NamespaceCompletionItemPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/PropertyCompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/PropertyCompletionItem.cs new file mode 100644 index 000000000..c301e8ede --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/PropertyCompletionItem.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class PropertyCompletionItem : CompletionItem + { + private static BitmapSource image = GetImage("property.png"); + + public override string Text => Name; + public override CompletionItemPopupControl PopupControl => new PropertyCompletionItemPopup(); + public override BitmapSource Image => image; + + public String Name { get; set; } + public String Class { get; set; } + public String Type { get; set; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/PropertyCompletionItemPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/PropertyCompletionItemPopup.cs new file mode 100644 index 000000000..7790d6c43 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/PropertyCompletionItemPopup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class PropertyCompletionItemPopup : CompletionItemPopupControl + { + static PropertyCompletionItemPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(PropertyCompletionItemPopup), new FrameworkPropertyMetadata(typeof(PropertyCompletionItemPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/StructCompletionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/StructCompletionItem.cs new file mode 100644 index 000000000..b89a7cee2 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/StructCompletionItem.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class StructCompletionItem : CompletionItem + { + private static BitmapSource image = GetImage("struct.png"); + + public override string Text => Name; + public override CompletionItemPopupControl PopupControl => new StructCompletionItemPopup(); + public override BitmapSource Image => image; + + public String Name { get; set; } + public String Namespace { get; set; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/StructCompletionItemPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/StructCompletionItemPopup.cs new file mode 100644 index 000000000..09512f405 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/StructCompletionItemPopup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Intellisense +{ + public class StructCompletionItemPopup : CompletionItemPopupControl + { + static StructCompletionItemPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(StructCompletionItemPopup), new FrameworkPropertyMetadata(typeof(StructCompletionItemPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/Utils.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/Utils.cs new file mode 100644 index 000000000..f8cc7072d --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/Utils.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Xml; + +namespace Tango.Scripting.Editors.Intellisense +{ + public static class Utils + { + private static String dotNetXmlFolder = @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.X"; + private static Dictionary<Assembly, XmlDocument> _assemblies_docs_cache; + + static Utils() + { + _assemblies_docs_cache = new Dictionary<Assembly, XmlDocument>(); + } + + public static void LoadKnownTypeDocs(KnownType knownType) + { + XmlDocument xmlDoc = null; + + if (_assemblies_docs_cache.ContainsKey(knownType.Type.Assembly)) + { + xmlDoc = _assemblies_docs_cache[knownType.Type.Assembly]; + } + + if (xmlDoc == null) + { + String dllPath = knownType.Type.Assembly.Location; + + string docuPath = dllPath.Substring(0, dllPath.LastIndexOf(".")) + ".XML"; + + if (File.Exists(docuPath)) + { + xmlDoc = new XmlDocument(); + xmlDoc.Load(docuPath); + } + else if (File.Exists(System.IO.Path.Combine(dotNetXmlFolder, System.IO.Path.GetFileName(docuPath)))) + { + xmlDoc = new XmlDocument(); + xmlDoc.Load(System.IO.Path.Combine(dotNetXmlFolder, System.IO.Path.GetFileName(docuPath))); + } + + if (xmlDoc != null) + { + _assemblies_docs_cache.Add(knownType.Type.Assembly, xmlDoc); + } + } + + if (xmlDoc == null) + { + xmlDoc = new XmlDocument(); + } + + //Load Type Summary + { + string path = "T:" + knownType.Type.FullName; + XmlNode xmlDocuOfType = xmlDoc.SelectSingleNode("//member[starts-with(@name, '" + path + "')]"); + + if (xmlDocuOfType != null) + { + XmlNode summaryNode = xmlDocuOfType.SelectSingleNode("summary"); + knownType.Summary = summaryNode.InnerText; + } + } + + //Load Constructors... + { + string path = "M:" + knownType.Type.FullName + ".#ctor"; + + var docNodes = xmlDoc.SelectNodes("//member[starts-with(@name, '" + path + "')]").OfType<XmlNode>().ToList(); + + for (int i = 0; i < knownType.Constructors.Count; i++) + { + var constructor = knownType.Constructors[i]; + XmlNode cDoc = null; + + if (i < docNodes.Count) + { + cDoc = docNodes[i]; + } + + constructor.Summary = cDoc != null ? cDoc.SelectSingleNode("summary").InnerXml : $"Initializes a new instance of {knownType.FriendlyName}."; + + var parameters = constructor.Parameters.ToList(); + var parametersNodes = cDoc != null ? cDoc.SelectNodes("param").OfType<XmlNode>().ToList() : new List<XmlNode>(); + + for (int j = 0; j < parameters.Count; j++) + { + var parameter = parameters[j]; + XmlNode pNode = null; + + if (j < parametersNodes.Count) + { + pNode = parametersNodes[j]; + } + + parameter.Description = pNode != null ? pNode.InnerText : null; + } + } + } + + //Load Methods... + { + string path = "M:" + knownType.Type.FullName; + + var docNodes = xmlDoc.SelectNodes("//member[starts-with(@name, '" + path + "')]").OfType<XmlNode>().ToList(); + + for (int i = 0; i < knownType.Methods.Count; i++) + { + var method = knownType.Methods[i]; + XmlNode mDoc = null; + + mDoc = docNodes.FirstOrDefault(x => x.Attributes["name"].InnerText.Contains(knownType.Type.Name + "." + method.Name)); + method.Summary = mDoc != null ? mDoc.SelectSingleNode("summary").InnerXml.Remove("(<see cref=\".:)|(\" \\/>)") : "No documentation"; + + var parameters = method.Parameters.ToList(); + var parametersNodes = mDoc != null ? mDoc.SelectNodes("param").OfType<XmlNode>().ToList() : new List<XmlNode>(); + + bool isLinq = knownType.Type == typeof(Enumerable); + + for (int j = 0; j < parameters.Count; j++) + { + var parameter = parameters[j]; + + XmlNode pNode = null; + + if (j < parametersNodes.Count) + { + pNode = parametersNodes[j]; + } + + parameter.Description = pNode != null ? pNode.InnerText.Remove("(<see cref=\".:)|(\" \\/>)") : null; + } + } + } + + //Load Properties + { + string path = "P:" + knownType.Type.FullName; + + var docNodes = xmlDoc.SelectNodes("//member[starts-with(@name, '" + path + "')]").OfType<XmlNode>().ToList(); + + for (int i = 0; i < knownType.Properties.Count; i++) + { + var property = knownType.Properties[i]; + var pDoc = docNodes.FirstOrDefault(x => x.Attributes["name"].InnerText.Contains(knownType.Type.Name + "." + property.Name)); + + property.Summary = pDoc != null ? pDoc.SelectSingleNode("summary").InnerXml : "No documentation"; + } + } + + //Load Enum Values + { + if (knownType.Type.IsEnum) + { + for (int i = 0; i < knownType.Fields.Count; i++) + { + var field = knownType.Fields[i]; + var pDoc = xmlDoc.SelectSingleNode("//member[starts-with(@name, '" + $"F:{knownType.Type.FullName}.{field.Name}" + "')]"); + field.Summary = pDoc != null ? pDoc.SelectSingleNode("summary").InnerXml : "No documentation"; + } + } + } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/MethodDescription.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/MethodDescription.cs new file mode 100644 index 000000000..70e0d028d --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/MethodDescription.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Editors.Popups +{ + public class MethodDescription + { + public String Description { get; set; } + public String ReturnType { get; set; } + public List<ParameterDescription> Parameters { get; set; } + public String Class { get; set; } + public String Name { get; set; } + + public MethodDescription() + { + Parameters = new List<ParameterDescription>(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/MethodPopup.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/MethodPopup.cs new file mode 100644 index 000000000..7c431f9b4 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/MethodPopup.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.Editors.Popups +{ + public class MethodPopup : Control + { + public List<MethodDescription> Methods { get; set; } + + public int CurrentMethodIndex + { + get { return (int)GetValue(CurrentMethodIndexProperty); } + set { SetValue(CurrentMethodIndexProperty, value); } + } + public static readonly DependencyProperty CurrentMethodIndexProperty = + DependencyProperty.Register("CurrentMethodIndex", typeof(int), typeof(MethodPopup), new PropertyMetadata(1)); + + public MethodDescription CurrentMethod + { + get { return (MethodDescription)GetValue(CurrentMethodProperty); } + set { SetValue(CurrentMethodProperty, value); } + } + public static readonly DependencyProperty CurrentMethodProperty = + DependencyProperty.Register("CurrentMethod", typeof(MethodDescription), typeof(MethodPopup), new PropertyMetadata(null)); + + public void IncrementMethod() + { + if (Methods.Count > 0) + { + if (CurrentMethodIndex < Methods.Count) + { + CurrentMethodIndex++; + CurrentMethod = Methods[CurrentMethodIndex - 1]; + } + else + { + CurrentMethodIndex = 1; + CurrentMethod = Methods[0]; + } + } + } + + public void DecrementMethod() + { + if (Methods.Count > 0) + { + if (CurrentMethodIndex > 1) + { + CurrentMethodIndex--; + CurrentMethod = Methods[CurrentMethodIndex - 1]; + } + else + { + CurrentMethodIndex = Methods.Count; + CurrentMethod = Methods[Methods.Count - 1]; + } + } + } + + public MethodPopup() + { + Methods = new List<MethodDescription>(); + } + + static MethodPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(MethodPopup), new FrameworkPropertyMetadata(typeof(MethodPopup))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/ParameterDescription.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/ParameterDescription.cs new file mode 100644 index 000000000..6650f76ec --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Popups/ParameterDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Editors.Popups +{ + public class ParameterDescription + { + public ParameterDescription(MethodDescription method) + { + Method = method; + } + + public MethodDescription Method { get; set; } + public String Type { get; set; } + public String Name { get; set; } + public String Description { get; set; } + + public bool IsLast + { + get { return Method.Parameters.Last() == this; } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Rendering/TextView.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Rendering/TextView.cs index 6bbf13618..3dabb6b7a 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Rendering/TextView.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Rendering/TextView.cs @@ -800,9 +800,14 @@ namespace Tango.Scripting.Editors.Rendering [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")] public ReadOnlyCollection<VisualLine> VisualLines { get { - if (visibleVisualLines == null) - throw new VisualLinesInvalidException(); - return visibleVisualLines; + if (visibleVisualLines == null) + { + return new ReadOnlyCollection<VisualLine>(new List<VisualLine>()); + } + else + { + return visibleVisualLines; + } } } @@ -848,11 +853,12 @@ namespace Tango.Scripting.Editors.Rendering // Sometimes we still have invalid lines after UpdateLayout - work around the problem // by calling MeasureOverride directly. if (!VisualLinesValid) { - Debug.WriteLine("UpdateLayout() failed in EnsureVisualLines"); - MeasureOverride(lastAvailableSize); - } - if (!VisualLinesValid) - throw new VisualLinesInvalidException("Internal error: visual lines invalid after EnsureVisualLines call"); + //Debug.WriteLine("UpdateLayout() failed in EnsureVisualLines"); + //MeasureOverride(lastAvailableSize); + // UpdateLayout(); + } + //if (!VisualLinesValid) + //throw new VisualLinesInvalidException("Internal error: visual lines invalid after EnsureVisualLines call"); } #endregion diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/ScriptEditor.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/ScriptEditor.cs index 316b95ed7..efa1b087a 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/ScriptEditor.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/ScriptEditor.cs @@ -1,4 +1,5 @@ using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -8,9 +9,11 @@ using System.Linq; using System.Reflection; using System.Text; using System.Text.RegularExpressions; +using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; +using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; @@ -27,26 +30,28 @@ using Tango.Scripting.Editors.Editing; using Tango.Scripting.Editors.Folding; using Tango.Scripting.Editors.Highlighting; using Tango.Scripting.Editors.Highlighting.Xshd; +using Tango.Scripting.Editors.Intellisense; +using Tango.Scripting.Editors.Popups; +using Tango.Scripting.Editors.Rendering; using Tango.Scripting.Parsing; namespace Tango.Scripting.Editors { public class ScriptEditor : TextEditor { - private char[] word_separators = { ' ', '\t', '\n', '.', '(', ',', '-', '*', '/', '+', '$', '=' }; + private char[] word_separators = { ' ', '\t', '\n', '.', '(', ',', '-', '*', '/', '+', '$', '=', '<', '>' }; private string[] _blocking_type_words = { "class", "void" }; - private String dotNetXmlFolder = @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.X"; private DispatcherTimer _update_timer; + private Popup _popup; private FoldingManager foldingManager; private BraceFoldingStrategy foldingStrategy; private CompletionWindow completionWindow; private ScriptParser _parser; private List<String> _current_usings; - private List<Type> _knownTypes; - private List<INamedTypeSymbol> _declaredTypes; - private Dictionary<Type, String> _known_types_docs_cache; - private Dictionary<Assembly, XmlDocument> _assemblies_docs_cache; + private List<KnownType> _knownTypes; + private List<ScriptType> _declaredTypes; + private bool _isLoadingTypes; #region Mini Classes @@ -56,112 +61,24 @@ namespace Tango.Scripting.Editors public int Index { get; set; } } - #endregion - - #region Completion - - /// <summary> - /// Represents an auto complete item. - /// </summary> - /// <seealso cref="ICSharpCode.AvalonEdit.CodeCompletion.ICompletionData" /> - internal class CompletionData : DependencyObject, ICompletionData + private class ConstructionSession { - private String _description; - - /// <summary> - /// Gets or sets the icon source. - /// </summary> - public BitmapSource Source { get; set; } - - /// <summary> - /// Initializes a new instance of the <see cref="CompletionData"/> class. - /// </summary> - /// <param name="name">The text.</param> - /// <param name="description">The description.</param> - public CompletionData(String type, string name, String ns, String description) - { - Type = type; - this.Text = name; - Namespace = ns; - _description = description; - } - - /// <summary> - /// Gets the image. - /// </summary> - public System.Windows.Media.ImageSource Image - { - get { return Source; } - } - - /// <summary> - /// Gets the text. This property is used to filter the list of visible elements. - /// </summary> - public string Text { get; private set; } - - // Use this property if you want to show a fancy UIElement in the drop down list. - public object Content - { - get { return this.Text; } - } - - /// <summary> - /// Gets the description. - /// </summary> - public object Description - { - get { return _description; } - } - - public String Type { get; set; } - - public String Namespace { get; set; } - - /// <summary> - /// Gets the priority. This property is used in the selection logic. You can use it to prefer selecting those items - /// which the user is accessing most frequently. - /// </summary> - public double Priority { get { return 0; } } - - /// <summary> - /// Perform the completion. - /// </summary> - /// <param name="textArea">The text area on which completion is performed.</param> - /// <param name="completionSegment">The text segment that was used by the completion window if - /// the user types (segment between CompletionWindow.StartOffset and CompletionWindow.EndOffset).</param> - /// <param name="insertionRequestEventArgs">The EventArgs used for the insertion request. - /// These can be TextCompositionEventArgs, KeyEventArgs, MouseEventArgs, depending on how - /// the insertion was triggered.</param> - public void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs) - { - textArea.Document.Replace(completionSegment, this.Text); - } - - public bool IsSelected - { - get { return (bool)GetValue(IsSelectedProperty); } - set { SetValue(IsSelectedProperty, value); } - } - public static readonly DependencyProperty IsSelectedProperty = - DependencyProperty.Register("IsSelected", typeof(bool), typeof(CompletionData), new PropertyMetadata(false, IsSelectedChanged)); - - private static void IsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - Debug.WriteLine("Selected"); - } - + public KnownType Type { get; set; } + public int ParameterIndex { get; set; } + public List<String> TypeArguments { get; set; } + } + private class MethodSession + { + public KnownType Type { get; set; } + public String MethodName { get; set; } + public int ParameterIndex { get; set; } + } - /// <summary> - /// Returns a <see cref="System.String" /> that represents this instance. - /// </summary> - /// <returns> - /// A <see cref="System.String" /> that represents this instance. - /// </returns> - public override string ToString() - { - return Text; - } + private class DeclaredMethodSession + { + public ScriptType Type { get; set; } + public ScriptSymbol Method { get; set; } } #endregion @@ -201,6 +118,15 @@ namespace Tango.Scripting.Editors public static readonly DependencyProperty ReferenceAssembliesProperty = DependencyProperty.Register("ReferenceAssemblies", typeof(ObservableCollection<ReferenceAssembly>), typeof(ScriptEditor), new PropertyMetadata(null)); + public Object CurrentPopupContent + { + get { return (Object)GetValue(CurrentPopupContentProperty); } + set { SetValue(CurrentPopupContentProperty, value); } + } + public static readonly DependencyProperty CurrentPopupContentProperty = + DependencyProperty.Register("CurrentPopupContent", typeof(Object), typeof(ScriptEditor), new PropertyMetadata(null)); + + #endregion #region Constructors @@ -218,9 +144,7 @@ namespace Tango.Scripting.Editors /// </summary> public ScriptEditor() { - _known_types_docs_cache = new Dictionary<Type, string>(); - _assemblies_docs_cache = new Dictionary<Assembly, XmlDocument>(); - _declaredTypes = new List<INamedTypeSymbol>(); + _declaredTypes = new List<ScriptType>(); _current_usings = new List<string>(); @@ -229,8 +153,9 @@ namespace Tango.Scripting.Editors //Add basic assemblies... ReferenceAssemblies.Add(new ReferenceAssembly(typeof(String))); //mscorelib ReferenceAssemblies.Add(new ReferenceAssembly(typeof(Enumerable))); //System.Core + ReferenceAssemblies.Add(new ReferenceAssembly(typeof(Tango.Core.CoreSettings))); //System.Core - _knownTypes = new List<Type>(); + _knownTypes = new List<KnownType>(); _parser = new ScriptParser(); TextArea.IndentationStrategy = new Indentation.CSharp.CSharpIndentationStrategy(Options); @@ -286,221 +211,1044 @@ namespace Tango.Scripting.Editors #endregion - #region Public Methods + #region Override Methods /// <summary> - /// Invalidates all using statements in the script. + /// Invoked when an unhandled <see cref="E:System.Windows.Input.Keyboard.PreviewKeyDown" /> attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// </summary> - public void InvalidateUsings() + /// <param name="e">The <see cref="T:System.Windows.Input.KeyEventArgs" /> that contains the event data.</param> + protected override void OnPreviewKeyDown(KeyEventArgs e) { - var oldUsings = _current_usings.ToList(); - _current_usings = _parser.GetUsings(Text); - - if (_current_usings.Exists(x => !oldUsings.Exists(y => y == x)) || oldUsings.Exists(x => !_current_usings.Exists(y => y == x))) + if (CurrentPopupContent is MethodPopup && (e.Key == Key.Down || e.Key == Key.Up)) { - InvalidateHighlighting(); + e.Handled = true; + + if (e.Key == Key.Down) + { + (CurrentPopupContent as MethodPopup).IncrementMethod(); + } + else if (e.Key == Key.Up) + { + (CurrentPopupContent as MethodPopup).DecrementMethod(); + } + + return; } + + base.OnPreviewKeyDown(e); + HidePopup(); + HandleKeyCombinations(e); } + #endregion + + #region Apply Template + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + _popup = GetTemplateChild("PART_popup") as Popup; + } + + #endregion + + #region Key Combination Handling + /// <summary> - /// Invalidates the script folding if enabled. + /// Handles the key combinations. /// </summary> - public void InvalidateFolding() + /// <param name="e">The <see cref="KeyEventArgs"/> instance containing the event data.</param> + private void HandleKeyCombinations(KeyEventArgs e) { - if (EnableFolding) + if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.K) && Keyboard.IsKeyDown(Key.D)) { - if (foldingManager == null) + try { - foldingManager = FoldingManager.Install(TextArea); + int index = CaretOffset; + Document.BeginUpdate(); + IndentCode(); + Document.EndUpdate(); + e.Handled = true; + CaretOffset = index; + } + catch + { + Debug.WriteLine("Error indenting code."); } + } + else if (e.Key == Key.Oem2) + { + int offset = CaretOffset; + var line = Document.GetLineByOffset(offset); - foldingStrategy.UpdateFoldings(foldingManager, Document); + String text = GetCurrentLineText(); + if (text.TrimStart('\t', ' ').StartsWith("//")) + { + Document.BeginUpdate(); + Document.Replace(line, "/// <summary>\n/// \n/// </summary>"); + Document.EndUpdate(); + e.Handled = true; + CaretOffset = Document.GetLineByNumber(line.LineNumber + 1).EndOffset; + } + } + else if (e.Key == Key.End || e.Key == Key.Home) + { + HideCompletionWindow(); } } - /// <summary> - /// Indents the code. - /// </summary> - public void IndentCode() + #endregion + + #region Text Entered + + private void TextArea_TextEntered(object sender, TextCompositionEventArgs e) { - Text = Indentation.CSharp.CSharpIndentationHelper.IndentCSharpCode(Text); + List<Object> items = new List<object>(); + + HidePopup(); + + var lineText = GetCurrentLineText(); + var previousWords = GetPreviousWords(); + var previousWordsLast = previousWords.LastOrDefault(); + String currentWord = previousWordsLast != null ? previousWordsLast.Replace("\t", "") : String.Empty; + String currentWordIncludingParenthesis = currentWord.Split('(').LastOrDefault(); + + if (previousWords.Count > 0 && previousWords.First().Trim().StartsWith("//")) return; + + if (e.Text == " " && previousWords.Count > 2 && previousWords[previousWords.Count - 2] == "=") + { + var expression = previousWords.First(); + var knownType = GetKnownTypeFromExpression(expression + "."); + + if (knownType != null && knownType.Type.IsEnum) + { + completionWindow.HideCompletion(); + IList<ICompletionData> data = new List<ICompletionData>(); + + foreach (var field in knownType.Fields) + { + data.Add(new FieldCompletionItem() + { + Class = knownType.FriendlyName, + Name = knownType.FriendlyName + "." + field.Name, + Type = field.ReturnTypeFriendlyName, + Description = field.Summary, + }); + } + + ShowCompletionWindow(data.OrderBy(x => x.Text).ToList(), GetCurrentWord()); + } + + } + else if (e.Text == " " && GetPreviousWord() == "new") + { + var s = _parser.GetExpressionFirst<FieldDeclarationSyntax>(GetCurrentLineText()); + + if (s != null) + { + String type = s.Declaration.Type.ToString(); + + IList<ICompletionData> data = new List<ICompletionData>(); + + data.Add(new ClassCompletionItem() + { + Name = type, + Description = "Auto generate assignment...", + }); + + ShowCompletionWindow(data, type); + } + } + else if (e.Text == ";" || e.Text == " ") + { + HideCompletionWindow(); + } + else if (e.Text == ".") + { + var knownType = GetCurrentKnownType(); + + if (knownType != null) + { + completionWindow.HideCompletion(); + IList<ICompletionData> data = new List<ICompletionData>(); + + if (!knownType.Type.IsEnum) + { + var typeMembers = knownType.Members.ToList(); + + foreach (var methodGroup in typeMembers.OfType<KnownTypeMethod>().GroupBy(x => x.NameWithTypeArguments)) + { + var method = methodGroup.First(); + + data.Add(new MethodCompletionItem() + { + Class = knownType.FriendlyName, + Name = method.NameWithTypeArguments, + ReturnType = method.ReturnTypeFriendlyName, + Description = method.Summary, + Parameters = method.Parameters, + Overloads = methodGroup.Count() - 1, + }); + } + + foreach (var methodGroup in typeMembers.Where(x => x.GetType() != typeof(KnownTypeMethod)).GroupBy(x => x.Name)) + { + var member = methodGroup.First(); + + data.Add(new PropertyCompletionItem() + { + Class = knownType.FriendlyName, + Name = member.Name, + Type = member.ReturnTypeFriendlyName, + Description = member.Summary, + }); + + } + } + else + { + foreach (var field in knownType.Fields) + { + data.Add(new FieldCompletionItem() + { + Class = knownType.FriendlyName, + Name = field.Name, + Type = field.ReturnTypeFriendlyName, + Description = field.Summary, + }); + + } + } + + ShowCompletionWindow(data.OrderBy(x => x.Text).ToList(), GetCurrentWord()); + } + else + { + var declaredType = GetCurrentDeclaredType(); + + if (declaredType != null) + { + completionWindow.HideCompletion(); + IList<ICompletionData> data = new List<ICompletionData>(); + + var typeMembers = declaredType.Symbols.ToList(); + + foreach (var methodGroup in typeMembers.GroupBy(x => x.Name)) + { + var member = methodGroup.First(); + + if (member.Kind == SymbolKind.Method) + { + var methodCompletion = new MethodCompletionItem() + { + Class = declaredType.Name, + Name = member.Name, + ReturnType = member.Type, + Description = member.Summary, + Overloads = methodGroup.Count() - 1, + }; + + + for (int i = 0; i < member.Parameters.Count; i++) + { + var pair = member.Parameters[i]; + + methodCompletion.Parameters.Add(new KnownTypeMethodParameter() + { + Type = pair.Key, + Name = pair.Value, + IsLast = (i == member.Parameters.Count - 1) + }); + } + + data.Add(methodCompletion); + + } + else if (member.Kind == SymbolKind.Property) + { + data.Add(new PropertyCompletionItem() + { + Class = declaredType.Name, + Name = member.Name, + Type = member.Type, + Description = member.Summary, + }); + } + else if (member.Kind == SymbolKind.Field) + { + data.Add(new FieldCompletionItem() + { + Class = declaredType.Name, + Name = member.Name, + Type = member.Type, + Description = member.Summary, + }); + } + } + + ShowCompletionWindow(data, GetCurrentWord()); + } + } + } + else if (e.Text == "(" || e.Text == ",") + { + completionWindow.HideCompletion(); + + try + { + var session = GetConstructionSession(); + + if (session != null) + { + var content = CreateConstructionSessionPopupContent(session); + if (content.Methods.Count > 0) + { + ShowPopup(content); + return; + } + } + + var methodSession = GetMethodSession(); + + if (methodSession != null) + { + var content = CreateMethodSessionPopupContent(methodSession); + if (content.Methods.Count > 0) + { + ShowPopup(content); + return; + } + } + + var declaredMethodSession = GetDeclaredMethodSession(); + + if (declaredMethodSession != null) + { + var content = CreateDeclaredMethodSessionPopupContent(declaredMethodSession); + if (content.Methods.Count > 0) + { + ShowPopup(content); + return; + } + } + } + catch (Exception ex) + { + Debug.WriteLine(ex); + } + } + else if (lineText.StartsWith("using")) + { + if (completionWindow.IsVisible) + { + completionWindow.UpdatePositionFix(); + return; + } + + IList<ICompletionData> data = new List<ICompletionData>(); + + foreach (var asm in ReferenceAssemblies) + { + foreach (var ns in asm.Assembly.GetTypes().Select(x => x.Namespace).Distinct().Where(x => x != null)) + { + data.Add(new NamespaceCompletionItem() + { + Name = ns, + Assembly = asm.Assembly.GetName().Name, + }); + } + } + + data = data.DistinctBy(x => x.Text).ToList(); + + ShowCompletionWindow(data, GetCurrentWord()); + } + else if (e.Text == "{") + { + int parentesisCount = lineText.TakeWhile(x => x != '{').Count(x => x == '\"'); + + if (parentesisCount % 2 == 0) + { + Document.Insert(CaretOffset, "}"); + CaretOffset--; + } + } + else if (e.Text == "}") + { + if (Document.GetText(CaretOffset - 2, 1) == "{" && Document.GetText(CaretOffset, 1) == "}") + { + Document.Replace(CaretOffset, 1, ""); + } + } + else if (e.Text == "\n") + { + if (Document.GetText(CaretOffset - 3, 1) == "{" && Document.GetText(CaretOffset, 1) == "}") + { + CaretOffset--; + Document.Insert(CaretOffset, "\n\t"); + } + } + else if (!currentWordIncludingParenthesis.Contains(".") || currentWord[currentWord.Length - 2] == '<') + { + if (completionWindow.IsVisible) + { + completionWindow.UpdatePositionFix(); + return; + } + + var previous_word = GetPreviousWord(); + var word = GetCurrentWord(); + + if (word.Contains("<")) + { + word = word.Last(x => x != '<').ToString(); + } + + if (previous_word != word) + { + if (_knownTypes.Exists(x => x.Name == previous_word)) + { + return; + } + + if (_blocking_type_words.Contains(previous_word)) + { + return; + } + } + + if (!String.IsNullOrWhiteSpace(word)) + { + IList<ICompletionData> data = new List<ICompletionData>(); + + foreach (var type in _declaredTypes.Where(x => x.Name.StartsWith(word))) + { + if (type.Kind == TypeKind.Struct) + { + data.Add(new StructCompletionItem() + { + Name = type.Name, + Description = type.Summary, + Namespace = type.ContainingNamespace, + Priority = 1, + }); + } + else if (type.Kind == TypeKind.Enum) + { + data.Add(new EnumCompletionItem() + { + Name = type.Name, + Description = type.Summary, + Namespace = type.ContainingNamespace, + Priority = 1, + }); + } + else if (type.Kind == TypeKind.Interface) + { + data.Add(new InterfaceCompletionItem() + { + Name = type.Name, + Description = type.Summary, + Namespace = type.ContainingNamespace, + Priority = 1, + }); + } + else if (type.Kind == TypeKind.Class) + { + data.Add(new ClassCompletionItem() + { + Name = type.Name, + Description = type.Summary, + Namespace = type.ContainingNamespace, + Priority = 1, + }); + } + else + { + throw new NotImplementedException("Implement generic item here!"); + } + } + + foreach (var type in _knownTypes.ToList().Where(x => x.Name.StartsWith(word))) + { + if (type.Type.IsEnum) + { + data.Add(new EnumCompletionItem() + { + Namespace = type.Type.Namespace, + Description = type.Summary, + Name = type.FriendlyName, + Priority = 0, + }); + } + else if (type.Type.IsInterface) + { + data.Add(new InterfaceCompletionItem() + { + Name = type.FriendlyName, + Description = type.Summary, + Namespace = type.Type.Namespace, + Priority = 0, + }); + } + else if (type.Type.IsValueType) + { + data.Add(new StructCompletionItem() + { + Name = type.FriendlyName, + Description = type.Summary, + Namespace = type.Type.Namespace, + Priority = 0, + }); + } + else if (type.Type.IsClass) + { + data.Add(new ClassCompletionItem() + { + Name = type.FriendlyName, + Description = type.Summary, + Namespace = type.Type.Namespace, + Priority = 0, + }); + } + else + { + throw new NotImplementedException("Implement generic item here."); + } + } + + foreach (var symbol in _parser.GetContextSymbols(Document.Text, CaretOffset).Where(x => x.Name.StartsWith(GetCurrentWord()))) + { + if (symbol.Kind == SymbolKind.Property) + { + data.Add(new PropertyCompletionItem() + { + Class = symbol.Class, + Description = symbol.Summary, + Name = symbol.Name, + Type = symbol.Type, + Priority = 2, + }); + } + else if (symbol.Kind == SymbolKind.Field || symbol.Kind == SymbolKind.Local || symbol.Kind == SymbolKind.Parameter) + { + data.Add(new FieldCompletionItem() + { + Class = symbol.Class, + Description = symbol.Summary, + Name = symbol.Name, + Type = symbol.Type, + Priority = 2, + }); + } + else if (symbol.Kind == SymbolKind.Method) + { + var methodCompletion = new MethodCompletionItem() + { + Class = symbol.Class, + Description = symbol.Summary, + Name = symbol.Name, + ReturnType = symbol.Type, + Priority = 2, + }; + + for (int i = 0; i < symbol.Parameters.Count; i++) + { + var pair = symbol.Parameters[i]; + + methodCompletion.Parameters.Add(new KnownTypeMethodParameter() + { + Type = pair.Key, + Name = pair.Value, + IsLast = (i == symbol.Parameters.Count - 1) + }); + } + + data.Add(methodCompletion); + } + } + + ShowCompletionWindow(data, word); + } + } } - /// <summary> - /// Gets the current line. - /// </summary> - /// <returns></returns> - public DocumentLine GetCurrentLine() + #endregion + + #region Completion Window Insertion + + private void CompletionWindow_InsertionRequest(ICompletionData item) { - int offset = CaretOffset; - var line = Document.GetLineByOffset(offset); - return line; + item.Complete(this); } - /// <summary> - /// Gets the current line text. - /// </summary> - /// <returns></returns> - public String GetCurrentLineText() + #endregion + + #region Private/Internal Methods + + private void ShowCompletionWindow(IList<ICompletionData> suggestions, String filter) { - var text = Document.GetText(GetCurrentLine()); - return text; + IList<ICompletionData> data = completionWindow.CompletionList.CompletionData; + data.Clear(); + + foreach (var item in suggestions) + { + data.Add(item); + } + + if (data.Count > 0) + { + completionWindow.ShowCompletion(); + + if (completionWindow.CompletionList.ListBox != null) + { + completionWindow.CompletionList.SelectItemFiltering(filter); + } + } + else + { + completionWindow.HideCompletion(); + } } - /// <summary> - /// Gets the current word. - /// </summary> - /// <returns></returns> - public String GetCurrentWord() + private void HideCompletionWindow() { - return GetWordByEndIndex(CaretOffset); + completionWindow.HideCompletion(); } - public String GetWordByEndIndex(int index) + private List<String> GetScriptClassNames() { - String word = String.Empty; - var line = GetCurrentLine(); + List<String> list = new List<String>(); - int position = index; + Regex r = new Regex(@"(class\s+)(\w+)"); + var matches = r.Matches(Text); - for (int i = position - 1; i >= line.Offset; i--) + foreach (var m in matches.OfType<Match>()) { - char c = Document.GetText(i, 1).First(); + var g = m.Groups.OfType<Group>().Last(); + list.Add(g.Value); + } - if (word_separators.Contains(c)) - { - break; - } + return list.Distinct().ToList(); + } - word += c; - } + private List<String> GetScriptInterfaceOfEnumNames() + { + List<String> list = new List<String>(); - word = new string(word.Reverse().ToArray()); + Regex r = new Regex(@"((enum|interface)\s+)(\w+)"); + var matches = r.Matches(Text); - if (word.Length > 0) + foreach (var m in matches.OfType<Match>()) { - word = word.Replace(".", ""); + var g = m.Groups.OfType<Group>().Last(); + list.Add(g.Value); } - return word; + return list.Distinct().ToList(); } - public int GetCurrentWordStartIndex() + private List<String> GetScriptEnumsAndInterfaces() { - var line = GetCurrentLine(); + List<String> list = new List<string>(); - int position = CaretOffset; + Regex r = new Regex(@"((public|private|internal)\s+(enum|interface)\s+\w+)"); + var matches = r.Matches(Text); - for (int i = position - 1; i >= line.Offset; i--) + foreach (var m in matches) { - char c = Document.GetText(i, 1).First(); - if (word_separators.Contains(c)) - { - return i + 1; - } } - return line.Offset; + return list; } - public String GetPreviousWord() + private KnownType GetCurrentKnownType() { - int index = GetCurrentWordStartIndex() - 1; - return GetWordByEndIndex(index); + var expression = GetPreviousWords().LastOrDefault(); + return GetKnownTypeFromExpression(expression); } - #endregion + private KnownType GetKnownTypeFromExpression(String expression) + { + if (expression != null) + { + var tree = expression.Split('.').Select(x => x.Remove(@"\n|\t|\r|\(.*\)|\[.*\]|\s")).ToList(); + var variableName = tree.FirstOrDefault(); - #region Highlighting + if (variableName != null) + { + //Search for enum type first + var enumType = _knownTypes.FirstOrDefault(x => x.Name == variableName && x.Type.IsEnum); - private async void InvalidateHighlighting() - { - _parser.GetDeclaredTypes(Text); + if (enumType != null) + { + return enumType; + } + + tree.RemoveAt(0); + var variables = _parser.GetContextSymbols(Document.Text, CaretOffset); + var variable = variables.FirstOrDefault(x => x.Name == variableName); - _knownTypes.Clear(); + if (variable != null) + { + var knownType = _knownTypes.FirstOrDefault(x => x.FriendlyName == Regex.Replace(variable.Type, "<.+>", "<T>")); + + if (knownType != null) + { + while (tree.Count > 1) + { + var memberName = tree.First(); + tree.RemoveAt(0); + var member = knownType.Members.FirstOrDefault(x => x.Name == memberName); + + if (member == null) + { + return null; + } - var assemblies = ReferenceAssemblies.ToList(); - var usings = _current_usings.ToList(); + knownType = _knownTypes.FirstOrDefault(x => x.Type.Namespace + "." + x.Type.Name == member.ReturnType.Namespace + "." + member.ReturnType.Name); + } - foreach (var asm in assemblies.Select(x => x.Assembly)) + return knownType; + } + } + } + } + + return null; + } + + private ScriptType GetCurrentDeclaredType() + { + var expression = GetPreviousWords().LastOrDefault(); + + if (expression != null) { - Parallel.ForEach(asm.GetTypes().Where(x => x.IsVisible && x.IsPublic && !x.IsPrimitive), (type) => + var tree = expression.Split('.').Select(x => x.Remove(@"\n|\t|\r|\(.*\)|\[.*\]|\s")).ToList(); + var variableName = tree.FirstOrDefault(); + + if (variableName != null) { - if (usings.Exists(x => type.Namespace == x)) + tree.RemoveAt(0); + var variables = _parser.GetContextSymbols(Document.Text, CaretOffset); + var variable = variables.FirstOrDefault(x => x.Name == variableName); + + if (variable != null) { - lock (_knownTypes) + var declaredType = _declaredTypes.FirstOrDefault(x => x.Name == Regex.Replace(variable.Type, "<.+>", "<T>")); + + if (declaredType != null) { - _knownTypes.Add(type); + while (tree.Count > 1) + { + var memberName = tree.First(); + tree.RemoveAt(0); + var member = declaredType.Symbols.FirstOrDefault(x => x.Name == memberName); + + if (member == null) + { + return null; + } + + declaredType = _declaredTypes.FirstOrDefault(x => x.ContainingNamespace + "." + x.Name == member.ContainingNamespace + "." + member.Type); + } + + return declaredType; } } - }); + } + } + + return null; + } + + private void ShowPopup(Object content) + { + var position = TextArea.Caret.Position; + var textView = TextArea.TextView; + + var visualLocation = textView.GetVisualPosition(position, VisualYPosition.LineBottom); + var visualLocationTop = textView.GetVisualPosition(position, VisualYPosition.LineTop); + + Point location = textView.PointToScreen(visualLocation - textView.ScrollOffset); + Point locationTop = textView.PointToScreen(visualLocationTop - textView.ScrollOffset); + + _popup.Placement = PlacementMode.Absolute; + _popup.PlacementRectangle = new Rect(location, new Size(200, 100)); + + CurrentPopupContent = content; + + _popup.IsOpen = true; + } + + private void HidePopup() + { + _popup.IsOpen = false; + CurrentPopupContent = null; + } + + private MethodPopup CreateConstructionSessionPopupContent(ConstructionSession session) + { + MethodPopup popup = new MethodPopup(); + + foreach (var c in session.Type.Constructors) + { + MethodDescription method = new MethodDescription(); + method.ReturnType = session.Type.Name; + method.Description = c.Summary; + + if (session.Type.Type.IsGenericType && session.TypeArguments != null) + { + method.ReturnType = new String(session.Type.Name.TakeWhile(x => x != '`').ToArray()) + $"<{String.Join(",", session.TypeArguments)}>"; + } + + var parameters = c.Parameters; + + foreach (var p in parameters) + { + ParameterDescription pDescription = new ParameterDescription(method); + pDescription.Name = p.Name; + pDescription.Type = p.Type; + pDescription.Description = p.Description; + method.Parameters.Add(pDescription); + } + + popup.Methods.Add(method); } - if (_knownTypes.Count > 0 || _declaredTypes.Count > 0) + if (session.ParameterIndex > 0) { - String text = String.Empty; + popup.CurrentMethod = popup.Methods.FirstOrDefault(x => x.Parameters.Count == session.ParameterIndex + 1); - await Task.Factory.StartNew(() => + if (popup.CurrentMethod == null) { - Stream xshd_stream = typeof(ScriptEditor).Assembly.GetManifestResourceStream("Tango.Scripting.Editors.Highlighting.Resources.CSharp-Mode.xshd"); + popup.CurrentMethod = popup.Methods.FirstOrDefault(); + } + } + else + { + popup.CurrentMethod = popup.Methods.FirstOrDefault(); + } + + if (popup.CurrentMethod != null) + { + popup.CurrentMethodIndex = popup.Methods.IndexOf(popup.CurrentMethod) + 1; + } + + return popup; + } + + private MethodPopup CreateMethodSessionPopupContent(MethodSession session) + { + MethodPopup popup = new MethodPopup(); + + foreach (var m in session.Type.Methods.Where(x => x.Name == session.MethodName)) + { + MethodDescription method = new MethodDescription(); + method.ReturnType = session.Type.Name; + method.Description = m.Summary; + method.Name = m.NameWithTypeArguments; + method.Class = session.Type.FriendlyName; + + //if (session.Type.Type.IsGenericType && session.TypeArguments != null) + //{ + // method.ReturnType = new String(session.Type.Name.TakeWhile(x => x != '`').ToArray()) + $"<{String.Join(",", session.TypeArguments)}>"; + //} - using (StreamReader reader = new StreamReader(xshd_stream)) + var parameters = m.Parameters; + + foreach (var p in parameters) + { + ParameterDescription pDescription = new ParameterDescription(method); + pDescription.Name = p.Name; + pDescription.Type = p.Type; + pDescription.Description = p.Description; + method.Parameters.Add(pDescription); + } + + popup.Methods.Add(method); + } + + if (session.ParameterIndex > 0) + { + popup.CurrentMethod = popup.Methods.FirstOrDefault(x => x.Parameters.Count == session.ParameterIndex + 1); + + if (popup.CurrentMethod == null) + { + popup.CurrentMethod = popup.Methods.FirstOrDefault(); + } + } + else + { + popup.CurrentMethod = popup.Methods.FirstOrDefault(); + } + + if (popup.CurrentMethod != null) + { + popup.CurrentMethodIndex = popup.Methods.IndexOf(popup.CurrentMethod) + 1; + } + + return popup; + } + + private MethodPopup CreateDeclaredMethodSessionPopupContent(DeclaredMethodSession session) + { + MethodPopup popup = new MethodPopup(); + + MethodDescription method = new MethodDescription(); + method.ReturnType = session.Method.Type; + method.Description = session.Method.Summary; + method.Name = session.Method.Name; + method.Class = session.Method.Class; + + //if (session.Type.Type.IsGenericType && session.TypeArguments != null) + //{ + // method.ReturnType = new String(session.Type.Name.TakeWhile(x => x != '`').ToArray()) + $"<{String.Join(",", session.TypeArguments)}>"; + //} + + foreach (var p in session.Method.Parameters) + { + ParameterDescription pDescription = new ParameterDescription(method); + pDescription.Type = p.Key; + pDescription.Name = p.Value; + method.Parameters.Add(pDescription); + } + + popup.Methods.Add(method); + + //if (false) + //{ + // popup.CurrentMethod = popup.Methods.FirstOrDefault(x => x.Parameters.Count == session.ParameterIndex + 1); + + // if (popup.CurrentMethod == null) + // { + // popup.CurrentMethod = popup.Methods.FirstOrDefault(); + // } + //} + //else + //{ + popup.CurrentMethod = popup.Methods.FirstOrDefault(); + //} + + if (popup.CurrentMethod != null) + { + popup.CurrentMethodIndex = popup.Methods.IndexOf(popup.CurrentMethod) + 1; + } + + return popup; + } + + private void InvalidateHighlighting() + { + if (!_isLoadingTypes) + { + _isLoadingTypes = true; + _knownTypes.Clear(); + + var assemblies = ReferenceAssemblies.ToList(); + var usings = _current_usings.ToList(); + + Thread t = new Thread(() => + { + foreach (var asm in assemblies.Select(x => x.Assembly)) { - text = reader.ReadToEnd(); + Parallel.ForEach(asm.GetTypes().Where(x => x.IsVisible && x.IsPublic && !x.IsPrimitive), (type) => + { + if (usings.Exists(x => type.Namespace == x)) + { + lock (_knownTypes) + { + if (!_knownTypes.Exists(x => x.Type.FullName == type.FullName)) + { + _knownTypes.Add(new KnownType(type)); + } + } + } + }); } - List<String> referenceTypes = new List<string>(); - List<String> interfaceTypes = new List<string>(); - - foreach (var type in _knownTypes) + if (_knownTypes.Count > 0 || _declaredTypes.Count > 0) { - String name = type.Name; + String text = String.Empty; - if (type.ContainsGenericParameters) + Stream xshd_stream = typeof(ScriptEditor).Assembly.GetManifestResourceStream("Tango.Scripting.Editors.Highlighting.Resources.CSharp-Mode.xshd"); + + using (StreamReader reader = new StreamReader(xshd_stream)) { - name = new String(name.TakeWhile(x => x != '`').ToArray()); + text = reader.ReadToEnd(); } - if (type.IsClass || (type.IsValueType && !type.IsPrimitive)) + List<String> referenceTypes = new List<string>(); + List<String> interfaceTypes = new List<string>(); + + lock (_knownTypes) { - referenceTypes.Add(String.Format("<Word>{0}</Word>", name)); + foreach (var type in _knownTypes.ToList().Where(x => x != null)) + { + String name = type.Name; + + if (type.Type.ContainsGenericParameters) + { + name = new String(name.TakeWhile(x => x != '`').ToArray()); + } + + if (type.Type.IsInterface || type.Type.IsEnum) + { + interfaceTypes.Add(String.Format("<Word>{0}</Word>", name)); + } + else if (type.Type.IsClass || (type.Type.IsValueType)) + { + referenceTypes.Add(String.Format("<Word>{0}</Word>", name)); + } + } } - else if (type.IsInterface || type.IsEnum) + + foreach (var type in _declaredTypes) { - interfaceTypes.Add(String.Format("<Word>{0}</Word>", name)); + if (type.Kind == TypeKind.Interface || type.Kind == TypeKind.Enum) + { + interfaceTypes.Add(String.Format("<Word>{0}</Word>", type.Name)); + } + else if (type.Kind == TypeKind.Class) + { + referenceTypes.Add(String.Format("<Word>{0}</Word>", type.Name)); + } } - } - foreach (var type in _declaredTypes) - { - if (type.TypeKind == TypeKind.Interface || type.TypeKind == TypeKind.Enum) + if (referenceTypes.Count > 0) { - interfaceTypes.Add(String.Format("<Word>{0}</Word>", type.Name)); + text = text.Replace("<Word>@ReferenceTypes@</Word>", String.Join(Environment.NewLine, referenceTypes.Distinct())); } - else if (type.TypeKind == TypeKind.Class) + + if (interfaceTypes.Count > 0) { - referenceTypes.Add(String.Format("<Word>{0}</Word>", type.Name)); + text = text.Replace("<Word>@InterfaceTypes@</Word>", String.Join(Environment.NewLine, interfaceTypes.Distinct())); } - } - if (referenceTypes.Count > 0) - { - text = text.Replace("<Word>@ReferenceTypes@</Word>", String.Join(Environment.NewLine, referenceTypes.Distinct())); - } + MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(text)); - if (interfaceTypes.Count > 0) - { - text = text.Replace("<Word>@InterfaceTypes@</Word>", String.Join(Environment.NewLine, interfaceTypes.Distinct())); + XmlTextReader xshd_reader = new XmlTextReader(ms); + + Dispatcher.BeginInvoke(new Action(() => + { + SyntaxHighlighting = HighlightingLoader.Load(xshd_reader, HighlightingManager.Instance); + xshd_reader.Close(); + ms.Dispose(); + })); + + + foreach (var knownType in _knownTypes) + { + knownType.LoadDocumentation(); + } } - }); - using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(text))) - { - XmlTextReader xshd_reader = new XmlTextReader(ms); - SyntaxHighlighting = HighlightingLoader.Load(xshd_reader, HighlightingManager.Instance); - xshd_reader.Close(); - } + _isLoadingTypes = false; + }); + t.IsBackground = true; + t.Start(); } } @@ -514,6 +1262,8 @@ namespace Tango.Scripting.Editors InvalidateHighlighting(); } + _declaredTypes = declaredTypes; + //for (int i = 0; i < TextArea.TextView.LineTransformers.Count; i++) //{ // if (TextArea.TextView.LineTransformers[i] is OffsetColorizer) @@ -535,244 +1285,309 @@ namespace Tango.Scripting.Editors //} } - #endregion + private void InvalidateUsings() + { + var oldUsings = _current_usings.ToList(); + _current_usings = _parser.GetUsings(Text); - #region Override Methods + if (_current_usings.Exists(x => !oldUsings.Exists(y => y == x)) || oldUsings.Exists(x => !_current_usings.Exists(y => y == x))) + { + InvalidateHighlighting(); + } + } - /// <summary> - /// Invoked when an unhandled <see cref="E:System.Windows.Input.Keyboard.PreviewKeyDown" /> attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. - /// </summary> - /// <param name="e">The <see cref="T:System.Windows.Input.KeyEventArgs" /> that contains the event data.</param> - protected override void OnPreviewKeyDown(KeyEventArgs e) + private void InvalidateFolding() { - base.OnPreviewKeyDown(e); - HandleKeyCombinations(e); + if (EnableFolding) + { + if (foldingManager == null) + { + foldingManager = FoldingManager.Install(TextArea); + } + + foldingStrategy.UpdateFoldings(foldingManager, Document); + } } - #endregion + private void IndentCode() + { + Text = Indentation.CSharp.CSharpIndentationHelper.IndentCSharpCode(Text); + //Text = _parser.IndentCSharpCode(Text); + } - #region Key Combination Handling + internal DocumentLine GetCurrentLine() + { + int offset = CaretOffset; + var line = Document.GetLineByOffset(offset); + return line; + } - /// <summary> - /// Handles the key combinations. - /// </summary> - /// <param name="e">The <see cref="KeyEventArgs"/> instance containing the event data.</param> - private void HandleKeyCombinations(KeyEventArgs e) + private String GetCurrentLineText() { - if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.K) && Keyboard.IsKeyDown(Key.D)) + var text = Document.GetText(GetCurrentLine()); + return text; + } + + internal String GetCurrentWord() + { + return GetWordByEndIndex(CaretOffset); + } + + private String GetWordByEndIndex(int index) + { + String word = String.Empty; + var line = GetCurrentLine(); + + int position = index; + + for (int i = position - 1; i >= line.Offset; i--) { - try - { - int index = CaretOffset; - Document.BeginUpdate(); - IndentCode(); - Document.EndUpdate(); - e.Handled = true; - CaretOffset = index; - } - catch + char c = Document.GetText(i, 1).First(); + + if (word_separators.Contains(c)) { - Debug.WriteLine("Error indenting code."); + break; } + + word += c; } - else if (e.Key == Key.Oem2) + + word = new string(word.Reverse().ToArray()); + + if (word.Length > 0) { - int offset = CaretOffset; - var line = Document.GetLineByOffset(offset); + word = word.Replace(".", ""); + } - String text = GetCurrentLineText(); - if (text.TrimStart('\t', ' ').StartsWith("//")) + return word; + } + + internal int GetCurrentWordStartIndex() + { + var line = GetCurrentLine(); + + int position = CaretOffset; + + for (int i = position - 1; i >= line.Offset; i--) + { + char c = Document.GetText(i, 1).First(); + + if (word_separators.Contains(c)) { - Document.BeginUpdate(); - Document.Replace(line, "/// <summary>\n/// \n/// </summary>"); - Document.EndUpdate(); - e.Handled = true; - CaretOffset = Document.GetLineByNumber(line.LineNumber + 1).EndOffset; + return i + 1; } } - } - #endregion + return line.Offset; + } - #region Intellisense + private String GetPreviousWord() + { + int index = GetCurrentWordStartIndex() - 1; + return GetWordByEndIndex(index); + } - /// <summary> - /// Handles the TextEntered event of the TextArea control. - /// </summary> - /// <param name="sender">The source of the event.</param> - /// <param name="e">The <see cref="TextCompositionEventArgs"/> instance containing the event data.</param> - private void TextArea_TextEntered(object sender, TextCompositionEventArgs e) + private ConstructionSession GetConstructionSession() { - List<Object> items = new List<object>(); + var expression = _parser.GetCurrentConstructionExpression(GetCurrentLineText()); - if (e.Text == ".") - { - var word = GetCurrentWord(); - } - else + if (expression != null) { - var previous_word = GetPreviousWord(); - var word = GetCurrentWord(); + ConstructionSession session = new ConstructionSession(); - if (previous_word != word) + var line = GetCurrentLine(); + int parameterIndex = 0; + for (int i = CaretOffset; i > line.Offset; i--) { - if (_knownTypes.Exists(x => x.Name == previous_word)) - { - return; - } + String c = Document.GetText(i, 1); - if (_blocking_type_words.Contains(previous_word)) + if (c == "(") { - return; - } - } + var typeDeclaration = expression.Type as GenericNameSyntax; - if (!String.IsNullOrWhiteSpace(word)) - { - if (char.IsUpper(word.First())) - { - IList<ICompletionData> data = completionWindow.CompletionList.CompletionData; - data.Clear(); + KnownType type = null; - foreach (var type in _declaredTypes.Where(x => x.Name.StartsWith(word))) + if (typeDeclaration != null) { - data.Add(new CompletionData(type.TypeKind.ToString().ToLower(), type.Name, type.ContainingNamespace?.Name, "Declared inside the current script...")); - } + var typeName = typeDeclaration.Identifier.ToString(); + var argumentsCount = typeDeclaration.TypeArgumentList.Arguments.Count; + session.TypeArguments = typeDeclaration.TypeArgumentList.Arguments.Select(x => x.ToString()).ToList(); - foreach (var type in _knownTypes.Where(x => x.Name.StartsWith(word))) + if (argumentsCount == 0) + { + type = _knownTypes.FirstOrDefault(x => x.Type.Name == expression.Type.ToString()); + } + else + { + type = _knownTypes.FirstOrDefault(x => x.Type.Name == typeName + "`" + argumentsCount); + } + } + else { - String doc = GetKnownTypeDocumentation(type); - data.Add(new CompletionData(GetTypeOfType(type), type.Name, type.Namespace, doc)); + type = _knownTypes.FirstOrDefault(x => x.Name == expression.Type.ToString()); } - if (data.Count > 0) + if (type != null) { - completionWindow.ShowCompletion(); - - if (completionWindow.CompletionList.ListBox != null) - { - completionWindow.CompletionList.SelectItemFiltering(word); - } + session.Type = type; + session.ParameterIndex = parameterIndex; + return session; } else { - completionWindow.HideCompletion(); + return null; } } + else if (c == ",") + { + parameterIndex++; + } + } } - } - private void CompletionWindow_InsertionRequest(ICompletionData item) - { - int index = GetCurrentWordStartIndex(); - int max = GetCurrentLine().EndOffset; - - Document.Replace(index, Math.Min(max - index, item.Text.Length), item.Text); + return null; } - private String GetKnownTypeDocumentation(Type type) + private MethodSession GetMethodSession() { - if (_known_types_docs_cache.ContainsKey(type)) - { - return _known_types_docs_cache[type]; - } - - XmlDocument _docuDoc = null; + var words = GetCurrentLineText().Split(' '); - if (_assemblies_docs_cache.ContainsKey(type.Assembly)) + if (words.Count() > 0 && (words.First() == "private" || words.First() == "public" || words.First() == "void")) { - _docuDoc = _assemblies_docs_cache[type.Assembly]; + return null; } - if (_docuDoc == null) + var expression = words.LastOrDefault(); + + if (expression != null) { - String dllPath = type.Assembly.Location; + int parameterIndex = expression.Count(x => x == ','); + expression = new string(expression.TakeWhile(x => x != '(').ToArray()); - string docuPath = dllPath.Substring(0, dllPath.LastIndexOf(".")) + ".XML"; + var tree = expression.Split('.').Select(x => x.Remove(@"\n|\r|\s|\t|\(|\)|\[|\]|<.*>")).ToList(); + var variableName = tree.FirstOrDefault(); - if (File.Exists(docuPath)) + if (variableName != null && tree.Count > 1) { - _docuDoc = new XmlDocument(); - _docuDoc.Load(docuPath); - } - else if (File.Exists(System.IO.Path.Combine(dotNetXmlFolder, System.IO.Path.GetFileName(docuPath)))) - { - _docuDoc = new XmlDocument(); - _docuDoc.Load(System.IO.Path.Combine(dotNetXmlFolder, System.IO.Path.GetFileName(docuPath))); - } + tree.RemoveAt(0); + var variables = _parser.GetContextSymbols(Document.Text, CaretOffset); + var variable = variables.FirstOrDefault(x => x.Name == variableName); - _assemblies_docs_cache.Add(type.Assembly, _docuDoc); - } + if (variable != null) + { + var knownType = _knownTypes.FirstOrDefault(x => x.FriendlyName == Regex.Replace(variable.Type, "<.+>", "<T>")); - if (_docuDoc != null) - { - string path = "T:" + type.FullName; - XmlNode xmlDocuOfType = _docuDoc.SelectSingleNode("//member[starts-with(@name, '" + path + "')]"); + if (knownType != null) + { + while (tree.Count > 1) + { + var memberName = tree.First(); + tree.RemoveAt(0); + var member = knownType.Members.FirstOrDefault(x => x.Name == memberName); + + if (member == null) + { + return null; + } - _known_types_docs_cache.Add(type, xmlDocuOfType.InnerText); + knownType = _knownTypes.FirstOrDefault(x => x.Type.Namespace + "." + x.Type.Name == member.ReturnType.Namespace + "." + member.ReturnType.Name); + } - return xmlDocuOfType.InnerText; + return new MethodSession() + { + Type = knownType, + MethodName = tree.Last(), + ParameterIndex = parameterIndex, + }; + } + } + } } - return String.Empty; + return null; } - private String GetTypeOfType(Type type) + private DeclaredMethodSession GetDeclaredMethodSession() { - if (type.IsClass) return "class"; - if (type.IsEnum) return "enum"; - if (type.IsInterface) return "interface"; - if (type.IsValueType) return "struct"; - - return ""; - } + var words = GetCurrentLineText().Split(' '); - private List<String> GetScriptClassNames() - { - List<String> list = new List<String>(); + if (words.Count() > 0 && (words.First() == "private" || words.First() == "public" || words.First() == "void")) + { + return null; + } - Regex r = new Regex(@"(class\s+)(\w+)"); - var matches = r.Matches(Text); + var expression = GetPreviousWords().LastOrDefault(); - foreach (var m in matches.OfType<Match>()) + if (expression != null) { - var g = m.Groups.OfType<Group>().Last(); - list.Add(g.Value); - } + var tree = expression.Split('.').Select(x => x.Replace("\n", "").Replace("\r", "").Replace(" ", "").Replace("\t", "").Replace("(", "").Replace(")", "").Replace("[", "").Replace("]", "")).ToList(); + var variableName = tree.FirstOrDefault(); - return list.Distinct().ToList(); - } + if (variableName != null && tree.Count > 0) + { + tree.RemoveAt(0); + var variables = _parser.GetContextSymbols(Document.Text, CaretOffset); + var variable = variables.FirstOrDefault(x => x.Name == variableName); - private List<String> GetScriptInterfaceOfEnumNames() - { - List<String> list = new List<String>(); + if (variable != null) + { + var declaredType = _declaredTypes.FirstOrDefault(x => x.Name == Regex.Replace(variable.Class, "<.+>", "<T>")); - Regex r = new Regex(@"((enum|interface)\s+)(\w+)"); - var matches = r.Matches(Text); + if (declaredType != null) + { + while (tree.Count > 1) + { + var memberName = tree.First(); + tree.RemoveAt(0); + var member = declaredType.Symbols.FirstOrDefault(x => x.Name == memberName); - foreach (var m in matches.OfType<Match>()) - { - var g = m.Groups.OfType<Group>().Last(); - list.Add(g.Value); - } + if (member == null) + { + return null; + } - return list.Distinct().ToList(); - } + declaredType = _declaredTypes.FirstOrDefault(x => x.ContainingNamespace + "." + x.Name == member.ContainingNamespace + "." + member.Type); + } - private List<String> GetScriptEnumsAndInterfaces() - { - List<String> list = new List<string>(); + var methodName = tree.Count > 0 ? tree.Last() : variableName; - Regex r = new Regex(@"((public|private|internal)\s+(enum|interface)\s+\w+)"); - var matches = r.Matches(Text); + var method = declaredType.Symbols.FirstOrDefault(x => x.Kind == SymbolKind.Method && x.Name == methodName); - foreach (var m in matches) - { + if (method != null) + { + return new DeclaredMethodSession() + { + Type = declaredType, + Method = method, + }; + } + } + else if (tree.Count == 0) + { + var method = variable; + if (method != null) + { + return new DeclaredMethodSession() + { + Type = declaredType, + Method = method, + }; + } + } + } + } } - return list; + return null; + } + + private List<String> GetPreviousWords() + { + var currentLine = GetCurrentLine(); + var currentText = Document.GetText(currentLine.Offset, CaretOffset - currentLine.Offset); + return currentText.Split(' ', ',').ToList(); } #endregion diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Tango.Scripting.Editors.csproj b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Tango.Scripting.Editors.csproj index 18ed1ff70..2a21f0264 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Tango.Scripting.Editors.csproj +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Tango.Scripting.Editors.csproj @@ -189,6 +189,21 @@ <Compile Include="CodeCompletion\IOverloadProvider.cs" /> <Compile Include="CodeCompletion\OverloadInsightWindow.cs" /> <Compile Include="CodeCompletion\OverloadViewer.cs" /> + <Compile Include="Converters\BooleanToVisibilityConverter.cs" /> + <Compile Include="Converters\BooleanToVisibilityInversedConverter.cs" /> + <Compile Include="ExtensionMethods.cs" /> + <Compile Include="Intellisense\ClassCompletionItemPopup.cs" /> + <Compile Include="Intellisense\CompletionItem.cs" /> + <Compile Include="Intellisense\CompletionItemPopupControl.cs" /> + <Compile Include="Intellisense\EnumCompletionItem.cs" /> + <Compile Include="Intellisense\EnumCompletionItemPopup.cs" /> + <Compile Include="Intellisense\FieldCompletionItem.cs" /> + <Compile Include="Intellisense\FieldCompletionItemPopup.cs" /> + <Compile Include="Intellisense\ICompletionItem.cs" /> + <Compile Include="Intellisense\ICompletionProvider.cs" /> + <Compile Include="Intellisense\InterfaceCompletionItem.cs" /> + <Compile Include="Intellisense\InterfaceCompletionItemPopup.cs" /> + <Compile Include="Intellisense\KnownType.cs" /> <Compile Include="Document\ChangeTrackingCheckpoint.cs" /> <Compile Include="Document\DocumentChangeOperation.cs"> <DependentUpon>UndoStack.cs</DependentUpon> @@ -320,6 +335,25 @@ <Compile Include="Indentation\CSharp\DocumentAccessor.cs" /> <Compile Include="Indentation\DefaultIndentationStrategy.cs" /> <Compile Include="Indentation\IIndentationStrategy.cs" /> + <Compile Include="Intellisense\KnownTypeConstructor.cs" /> + <Compile Include="Intellisense\KnownTypeField.cs" /> + <Compile Include="Intellisense\KnownTypeMember.cs" /> + <Compile Include="Intellisense\KnownTypeMethodParameter.cs" /> + <Compile Include="Intellisense\KnownTypeMethod.cs" /> + <Compile Include="Intellisense\KnownTypeProperty.cs" /> + <Compile Include="Intellisense\ClassCompletionItem.cs" /> + <Compile Include="Intellisense\MethodCompletionItem.cs" /> + <Compile Include="Intellisense\MethodCompletionItemPopup.cs" /> + <Compile Include="Intellisense\NamespaceCompletionItem.cs" /> + <Compile Include="Intellisense\NamespaceCompletionItemPopup.cs" /> + <Compile Include="Intellisense\PropertyCompletionItem.cs" /> + <Compile Include="Intellisense\PropertyCompletionItemPopup.cs" /> + <Compile Include="Intellisense\StructCompletionItem.cs" /> + <Compile Include="Intellisense\StructCompletionItemPopup.cs" /> + <Compile Include="Intellisense\Utils.cs" /> + <Compile Include="Popups\MethodDescription.cs" /> + <Compile Include="Popups\MethodPopup.cs" /> + <Compile Include="Popups\ParameterDescription.cs" /> <Compile Include="Rendering\BackgroundGeometryBuilder.cs"> <DependentUpon>IBackgroundRenderer.cs</DependentUpon> </Compile> @@ -561,18 +595,37 @@ <None Include="packages.config" /> </ItemGroup> <ItemGroup> - <Resource Include="Images\pubclass.gif" /> - <Resource Include="Images\pubevent.gif" /> - <Resource Include="Images\pubmethod.gif" /> - <Resource Include="Images\pubproperty.gif" /> - </ItemGroup> - <ItemGroup> <Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" /> <Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\method.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\class.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\enum.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\field.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\interface.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\namespace.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\property.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\struct.png" /> + </ItemGroup> + <ItemGroup /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UseGlobalSettings="True" /> + <UserProperties BuildVersion_UseGlobalSettings="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Themes/Generic.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Themes/Generic.xaml index d113ca2a2..ce5cb39e1 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Themes/Generic.xaml +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Themes/Generic.xaml @@ -1,9 +1,12 @@ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Tango.Scripting.Editors" + xmlns:popups="clr-namespace:Tango.Scripting.Editors.Popups" xmlns:fa="http://schemas.fontawesome.io/icons/" xmlns:editing="clr-namespace:Tango.Scripting.Editors.Editing" xmlns:folding="clr-namespace:Tango.Scripting.Editors.Folding" + xmlns:intellisense="clr-namespace:Tango.Scripting.Editors.Intellisense" + xmlns:converters="clr-namespace:Tango.Scripting.Editors.Converters" xmlns:completion="clr-namespace:Tango.Scripting.Editors.CodeCompletion"> <ResourceDictionary.MergedDictionaries> @@ -21,6 +24,9 @@ <Color x:Key="ScriptForeground">#E6E6E6</Color> <Color x:Key="ScriptFoldingForeground">#A0A0A0</Color> <Color x:Key="ScriptLineNumberForeground">#2B91AF</Color> + <Color x:Key="ScriptReferenceTypesColor">#4EC9B0</Color> + <Color x:Key="ScriptKeywordColor">#3F8FD6</Color> + <Color x:Key="ScriptInterfaceColor">#B5CE8A</Color> <!--Brushes--> <SolidColorBrush x:Key="ScriptBackgroundBrush" Color="{StaticResource ScriptBackground}"></SolidColorBrush> @@ -29,6 +35,22 @@ <SolidColorBrush x:Key="ScriptLineNumberForegroundBrush" Color="{StaticResource ScriptLineNumberForeground}"></SolidColorBrush> <SolidColorBrush x:Key="CompletionBackgroundBrush" Color="{StaticResource CompletionBackground}"></SolidColorBrush> <SolidColorBrush x:Key="CompletionToolTipBackgroundBrush" Color="{StaticResource CompletionToolTipBackground}"></SolidColorBrush> + <SolidColorBrush x:Key="ScriptReferenceTypesBrush" Color="{StaticResource ScriptReferenceTypesColor}"></SolidColorBrush> + <SolidColorBrush x:Key="ScriptKeywordBrush" Color="{StaticResource ScriptKeywordColor}"></SolidColorBrush> + <SolidColorBrush x:Key="ScriptInterfaceBrush" Color="{StaticResource ScriptInterfaceColor}"></SolidColorBrush> + + <!--Images--> + <BitmapImage x:Key="interface" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/interface.png" /> + <BitmapImage x:Key="class" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/class.png" /> + <BitmapImage x:Key="enum" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/enum.png" /> + <BitmapImage x:Key="struct" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/struct.png" /> + <BitmapImage x:Key="namespace" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/namespace.png" /> + <BitmapImage x:Key="method" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/method.png" /> + <BitmapImage x:Key="property" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/property.png" /> + + <!--Converters--> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + <converters:BooleanToVisibilityInversedConverter x:Key="BooleanToVisibilityInversedConverter" /> <Style TargetType="{x:Type completion:CompletionList}"> <Setter Property="Background" Value="{StaticResource CompletionBackgroundBrush}"></Setter> @@ -61,12 +83,96 @@ <Setter.Value> <DataTemplate> <Border Background="{StaticResource CompletionToolTipBackgroundBrush}" CornerRadius="3" BorderThickness="0.5" BorderBrush="#434343" Padding="10 5" TextElement.Foreground="{StaticResource ScriptForegroundBrush}" TextElement.FontSize="12"> - <TextBlock TextWrapping="Wrap"> - <Run Text="{Binding Type,Mode=OneWay}" Foreground="#3F8FD6"></Run> - <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Text,Mode=OneWay}" Foreground="#4EC9B0"></Run> - <LineBreak/> - <Run Text="{Binding Description,Mode=OneWay}"></Run> - </TextBlock> + <!--<ContentControl Content="{Binding}"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <ContentPresenter Content="{Binding PopupControl}" /> + </DataTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Type}" Value="method"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <StackPanel> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding ReturnType}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock>.</TextBlock> + <TextBlock Text="{Binding Text}"></TextBlock> + <TextBlock>(</TextBlock> + <ItemsControl ItemsSource="{Binding Parameters}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding Type.Name}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock> + <TextBlock Margin="0 0 5 0" Text="," Visibility="{Binding IsLast,Converter={StaticResource BooleanToVisibilityInversedConverter}}"></TextBlock> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <TextBlock>)</TextBlock> + + <StackPanel Margin="5 0 0 0" Orientation="Horizontal" Visibility="{Binding HasOverloads,Converter={StaticResource BooleanToVisibilityConverter}}"> + <TextBlock>(+</TextBlock> + <TextBlock Margin="2 0" Text="{Binding Overloads}"></TextBlock> + <TextBlock>overloads)</TextBlock> + </StackPanel> + </StackPanel> + + <TextBlock Text="{Binding Description}"></TextBlock> + </StackPanel> + </DataTemplate> + </Setter.Value> + </Setter> + </DataTrigger> + + <DataTrigger Binding="{Binding Type}" Value="property"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <StackPanel> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding ReturnType}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock>.</TextBlock> + <TextBlock Text="{Binding Text}"></TextBlock> + <TextBlock Margin="5 0 0 0"> + <Run>{</Run> + <Run Foreground="{StaticResource ScriptKeywordBrush}">get</Run><Run>;</Run> + <Run Foreground="{StaticResource ScriptKeywordBrush}">set</Run><Run>;</Run> + <Run>}</Run> + </TextBlock> + </StackPanel> + + <TextBlock Text="{Binding Description}"></TextBlock> + </StackPanel> + </DataTemplate> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + + <ContentControl.ContentTemplate> + <DataTemplate> + <ContentPresenter Content="{Binding PopupControl}" /> + </DataTemplate> + </ContentControl.ContentTemplate> + </ContentControl>--> + + <ContentPresenter DataContext="{Binding}" Content="{Binding PopupControl}" /> </Border> </DataTemplate> </Setter.Value> @@ -90,8 +196,8 @@ <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> - <Image Source="{Binding Image}" Width="16" Height="16" Margin="0,0,4,0"/> - <ContentControl Content="{Binding Content}" /> + <Image Width="16" Height="16" Margin="0,0,4,0" Source="{Binding Image}"></Image> + <ContentControl Content="{Binding}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> @@ -160,17 +266,302 @@ BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> - <ScrollViewer - Focusable="False" - Name="PART_ScrollViewer" - CanContentScroll="True" - VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}" - HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}" - Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TextArea}" - VerticalContentAlignment="Top" - HorizontalContentAlignment="Left" - Background="{TemplateBinding Background}" - Padding="{TemplateBinding Padding}"/> + <Grid> + <ScrollViewer + Focusable="False" + Name="PART_ScrollViewer" + CanContentScroll="True" + VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}" + HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}" + Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TextArea}" + VerticalContentAlignment="Top" + HorizontalContentAlignment="Left" + Background="{TemplateBinding Background}" + Padding="{TemplateBinding Padding}"/> + + <Popup x:Name="PART_popup" IsOpen="False" AllowsTransparency="True"> + <Border Background="{StaticResource CompletionToolTipBackgroundBrush}" CornerRadius="3" BorderThickness="0.5" BorderBrush="#434343" Padding="10 5" TextElement.Foreground="{StaticResource ScriptForegroundBrush}" TextElement.FontSize="12"> + <ContentControl Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CurrentPopupContent}" /> + </Border> + </Popup> + </Grid> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type popups:MethodPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type popups:MethodPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <DockPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Top"> + <fa:ImageAwesome VerticalAlignment="Center" Icon="ChevronUp" Width="10" Height="10" Foreground="{StaticResource ScriptForegroundBrush}" /> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethodIndex}"></TextBlock> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0">of</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=Methods.Count}"></TextBlock> + <fa:ImageAwesome VerticalAlignment="Center" Margin="5 0 0 0" Icon="ChevronDown" Width="10" Height="10" Foreground="{StaticResource ScriptForegroundBrush}" /> + </StackPanel> + + <StackPanel Margin="10 0 0 0"> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.ReturnType}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock>.</TextBlock> + <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Name}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock>(</TextBlock> + <ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Parameters}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type popups:ParameterDescription}"> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding Type}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock> + <TextBlock Margin="0 0 5 0" Visibility="{Binding IsLast,Converter={StaticResource BooleanToVisibilityInversedConverter}}">,</TextBlock> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <TextBlock>)</TextBlock> + </StackPanel> + + <TextBlock Margin="0 5 0 0" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Description}" TextWrapping="Wrap"></TextBlock> + + <ItemsControl Margin="0 10 0 0" ItemsSource="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Parameters}"> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type popups:ParameterDescription}"> + <StackPanel Orientation="Horizontal"> + <StackPanel.Style> + <Style TargetType="StackPanel"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Description}" Value="{x:Null}"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </StackPanel.Style> + <TextBlock Text="{Binding Name}"></TextBlock> + <TextBlock>:</TextBlock> + <TextBlock Opacity="0.7" Margin="5 0 0 0" Text="{Binding Description}"></TextBlock> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </DockPanel> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <!--Completion Items--> + + <Style TargetType="{x:Type intellisense:ClassCompletionItemPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type intellisense:ClassCompletionItemPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + <TextBlock TextWrapping="Wrap"> + <Run Text="class" Foreground="{StaticResource ScriptKeywordBrush}"></Run> + <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Name,Mode=OneWay}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></Run> + <LineBreak/> + <Run Text="{Binding Description,Mode=OneWay}"></Run> + </TextBlock> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type intellisense:EnumCompletionItemPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type intellisense:EnumCompletionItemPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + <TextBlock TextWrapping="Wrap"> + <Run Text="enum" Foreground="{StaticResource ScriptKeywordBrush}"></Run> + <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Text,Mode=OneWay}" Foreground="{StaticResource ScriptInterfaceBrush}"></Run> + <LineBreak/> + <Run Text="{Binding Description,Mode=OneWay}"></Run> + </TextBlock> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type intellisense:MethodCompletionItemPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type intellisense:MethodCompletionItemPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <StackPanel> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding ReturnType}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock>.</TextBlock> + <TextBlock Text="{Binding Name}"></TextBlock> + <TextBlock>(</TextBlock> + <ItemsControl ItemsSource="{Binding Parameters}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding Type}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock> + <TextBlock Margin="0 0 5 0" Text="," Visibility="{Binding IsLast,Converter={StaticResource BooleanToVisibilityInversedConverter}}"></TextBlock> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <TextBlock>)</TextBlock> + + <StackPanel Margin="5 0 0 0" Orientation="Horizontal" Visibility="{Binding HasOverloads,Converter={StaticResource BooleanToVisibilityConverter}}"> + <TextBlock>(+</TextBlock> + <TextBlock Margin="2 0" Text="{Binding Overloads}"></TextBlock> + <TextBlock>overloads)</TextBlock> + </StackPanel> + </StackPanel> + + <TextBlock Text="{Binding Description}"></TextBlock> + </StackPanel> + + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type intellisense:InterfaceCompletionItemPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type intellisense:InterfaceCompletionItemPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <TextBlock TextWrapping="Wrap"> + <Run Text="interface" Foreground="#3F8FD6"></Run> + <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Name,Mode=OneWay}" Foreground="{StaticResource ScriptInterfaceBrush}"></Run> + <LineBreak/> + <Run Text="{Binding Description,Mode=OneWay}"></Run> + </TextBlock> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type intellisense:NamespaceCompletionItemPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type intellisense:NamespaceCompletionItemPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <TextBlock TextWrapping="Wrap"> + <Run Text="namespace" Foreground="{StaticResource ScriptKeywordBrush}"></Run> + <Run Text="{Binding Name,Mode=OneWay}"></Run> + </TextBlock> + + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type intellisense:PropertyCompletionItemPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type intellisense:PropertyCompletionItemPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <StackPanel> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding Type}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock>.</TextBlock> + <TextBlock Text="{Binding Text}"></TextBlock> + <TextBlock Margin="5 0 0 0"> + <Run>{</Run> + <Run Foreground="{StaticResource ScriptKeywordBrush}">get</Run><Run>;</Run> + <Run Foreground="{StaticResource ScriptKeywordBrush}">set</Run><Run>;</Run> + <Run>}</Run> + </TextBlock> + </StackPanel> + + <TextBlock Text="{Binding Description}"></TextBlock> + </StackPanel> + + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type intellisense:StructCompletionItemPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type intellisense:StructCompletionItemPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <TextBlock TextWrapping="Wrap"> + <Run Text="struct" Foreground="#3F8FD6"></Run> + <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Name,Mode=OneWay}" Foreground="{StaticResource ScriptInterfaceBrush}"></Run> + <LineBreak/> + <Run Text="{Binding Description,Mode=OneWay}"></Run> + </TextBlock> + + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type intellisense:FieldCompletionItemPopup}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type intellisense:FieldCompletionItemPopup}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <StackPanel> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding Type}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Text}"></TextBlock> + </StackPanel> + + <TextBlock Text="{Binding Description}"></TextBlock> + </StackPanel> + </Border> </ControlTemplate> </Setter.Value> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.config b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.config new file mode 100644 index 000000000..3c6b718b3 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.config @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> + </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.xaml new file mode 100644 index 000000000..be9fdd055 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.xaml @@ -0,0 +1,27 @@ +<Application x:Class="Tango.Scripting.IDE.UI.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.UI" + StartupUri="MainWindow.xaml"> + <Application.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! --> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> + + <!-- Accent and AppTheme setting --> + + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" /> + + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Colors.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Styles.xaml" /> + + <ResourceDictionary Source="pack://application:,,,/Tango.Scripting.IDE;component/Resources.xaml" /> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </Application.Resources> +</Application> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.xaml.cs new file mode 100644 index 000000000..273731b71 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace Tango.Scripting.IDE.UI +{ + /// <summary> + /// Interaction logic for App.xaml + /// </summary> + public partial class App : Application + { + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindow.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindow.xaml new file mode 100644 index 000000000..032d38c81 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindow.xaml @@ -0,0 +1,14 @@ +<controls:MetroWindow x:Class="Tango.Scripting.IDE.UI.MainWindow" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:local="clr-namespace:Tango.Scripting.IDE.UI" + xmlns:ide="clr-namespace:Tango.Scripting.IDE;assembly=Tango.Scripting.IDE" + mc:Ignorable="d" + Title="MainWindow" Height="720" Width="1280" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}" TitlebarHeight="40" TitleCaps="False" BorderBrush="Gray" BorderThickness="1" WindowStartupLocation="CenterScreen"> + <Grid> + <ide:ScriptIDEView2 DataContext="{Binding IdeVM}" /> + </Grid> +</controls:MetroWindow> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindow.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindow.xaml.cs new file mode 100644 index 000000000..13f2bf7a9 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindow.xaml.cs @@ -0,0 +1,30 @@ +using MahApps.Metro.Controls; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE.UI +{ + /// <summary> + /// Interaction logic for MainWindow.xaml + /// </summary> + public partial class MainWindow : MetroWindow + { + public MainWindow() + { + InitializeComponent(); + DataContext = new MainWindowVM(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindowVM.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindowVM.cs new file mode 100644 index 000000000..2ced386b3 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/MainWindowVM.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.Scripting.IDE.UI +{ + public class MainWindowVM : ViewModel + { + public ScriptIDEViewVM IdeVM { get; set; } + + public MainWindowVM() + { + IdeVM = new ScriptIDEViewVM(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..56c3e1308 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango.Scripting.IDE.UI")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.Scripting.IDE.UI")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file +//inside a <PropertyGroup>. For example, if you are using US english +//in your source files, set the <UICulture> to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Resources.Designer.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Resources.Designer.cs new file mode 100644 index 000000000..45fc62ce0 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.Scripting.IDE.UI.Properties +{ + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.Scripting.IDE.UI.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Resources.resx b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Settings.Designer.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Settings.Designer.cs new file mode 100644 index 000000000..fb153fa4c --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.Scripting.IDE.UI.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Settings.settings b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Tango.Scripting.IDE.UI.csproj b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Tango.Scripting.IDE.UI.csproj new file mode 100644 index 000000000..01f93cc44 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/Tango.Scripting.IDE.UI.csproj @@ -0,0 +1,203 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{B0EFE7A0-7039-4DC4-8B39-465E521299F6}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>Tango.Scripting.IDE.UI</RootNamespace> + <AssemblyName>Tango.Scripting.IDE.UI</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL"> + <HintPath>..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath> + </Reference> + <Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> + <HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.CodeAnalysis.Common.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis.CSharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll</HintPath> + </Reference> + <Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath> + </Reference> + <Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath> + </Reference> + <Reference Include="System.ComponentModel.Composition" /> + <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Diagnostics.FileVersionInfo, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll</HintPath> + </Reference> + <Reference Include="System.Diagnostics.StackTrace, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Diagnostics.StackTrace.4.3.0\lib\net46\System.Diagnostics.StackTrace.dll</HintPath> + </Reference> + <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath> + </Reference> + <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath> + </Reference> + <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath> + </Reference> + <Reference Include="System.Numerics" /> + <Reference Include="System.Reflection.Metadata, Version=1.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath> + </Reference> + <Reference Include="System.Text.Encoding.CodePages, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Text.Encoding.CodePages.4.3.0\lib\net46\System.Text.Encoding.CodePages.dll</HintPath> + </Reference> + <Reference Include="System.Threading.Thread, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll</HintPath> + </Reference> + <Reference Include="System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath> + </Reference> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + </Reference> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> + <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath> + </Reference> + <Reference Include="System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll</HintPath> + </Reference> + <Reference Include="System.Xml.XPath, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Xml.XPath.4.3.0\lib\net46\System.Xml.XPath.dll</HintPath> + </Reference> + <Reference Include="System.Xml.XPath.XDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll</HintPath> + </Reference> + <Reference Include="Tango.Core"> + <HintPath>..\..\..\Build\Core\Debug\Tango.Core.dll</HintPath> + </Reference> + <Reference Include="Tango.SharedUI"> + <HintPath>..\..\..\Build\Core\Debug\Tango.SharedUI.dll</HintPath> + </Reference> + <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> + </ItemGroup> + <ItemGroup> + <ApplicationDefinition Include="App.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + <Page Include="MainWindow.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Compile Include="App.xaml.cs"> + <DependentUpon>App.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + <Compile Include="MainWindow.xaml.cs"> + <DependentUpon>MainWindow.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + </ItemGroup> + <ItemGroup> + <Compile Include="MainWindowVM.cs" /> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <None Include="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Tango.Scripting.Editors\Tango.Scripting.Editors.csproj"> + <Project>{6c55b776-26d4-4db3-a6ab-87e783b2f3d1}</Project> + <Name>Tango.Scripting.Editors</Name> + </ProjectReference> + <ProjectReference Include="..\Tango.Scripting.IDE\Tango.Scripting.IDE.csproj"> + <Project>{c9f60285-91fb-4293-bcf5-164d76755cdd}</Project> + <Name>Tango.Scripting.IDE</Name> + </ProjectReference> + <ProjectReference Include="..\Tango.Scripting\Tango.Scripting.csproj"> + <Project>{1e938fd2-c669-4738-98c9-77f96ce4d451}</Project> + <Name>Tango.Scripting</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" /> + <Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/packages.config b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/packages.config new file mode 100644 index 000000000..5fa98b5e2 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE.UI/packages.config @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net461" /> + <package id="MahApps.Metro" version="1.5.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.Common" version="2.4.0" targetFramework="net461" /> + <package id="Microsoft.CodeAnalysis.CSharp" version="2.4.0" targetFramework="net461" /> + <package id="System.AppContext" version="4.3.0" targetFramework="net461" /> + <package id="System.Collections" version="4.3.0" targetFramework="net461" /> + <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" /> + <package id="System.Collections.Immutable" version="1.3.1" targetFramework="net461" /> + <package id="System.Console" version="4.3.0" targetFramework="net461" /> + <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" /> + <package id="System.Diagnostics.FileVersionInfo" version="4.3.0" targetFramework="net461" /> + <package id="System.Diagnostics.StackTrace" version="4.3.0" targetFramework="net461" /> + <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" /> + <package id="System.Dynamic.Runtime" version="4.3.0" targetFramework="net461" /> + <package id="System.Globalization" version="4.3.0" targetFramework="net461" /> + <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" /> + <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" /> + <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" /> + <package id="System.Linq" version="4.3.0" targetFramework="net461" /> + <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" /> + <package id="System.Reflection" version="4.3.0" targetFramework="net461" /> + <package id="System.Reflection.Metadata" version="1.4.2" targetFramework="net461" /> + <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" /> + <package id="System.Runtime" version="4.3.0" targetFramework="net461" /> + <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" /> + <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" /> + <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" /> + <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" /> + <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" /> + <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" /> + <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" /> + <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" /> + <package id="System.Text.Encoding.CodePages" version="4.3.0" targetFramework="net461" /> + <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" /> + <package id="System.Threading" version="4.3.0" targetFramework="net461" /> + <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" /> + <package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net461" /> + <package id="System.Threading.Thread" version="4.3.0" targetFramework="net461" /> + <package id="System.ValueTuple" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.XPath" version="4.3.0" targetFramework="net461" /> + <package id="System.Xml.XPath.XDocument" version="4.3.0" targetFramework="net461" /> + <package id="WindowsAPICodePack-Core" version="1.1.2" targetFramework="net461" /> +</packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/ErrorData.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/ErrorData.cs new file mode 100644 index 000000000..2dc07ba3f --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/ErrorData.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.Scripting.IDE.Controls +{ + public class ErrorData: ExtendedObject + { + private string _severity; + private string _error; + private string _project; + private string _code; + + public string Description + { + get { return _error; } + set + { + _error = value; + RaisePropertyChangedAuto(); + } + } + public string Severity + { + get { return _severity; } + set + { + _severity = value; + RaisePropertyChangedAuto(); + } + } + public string Project + { + get { return _project; } + set + { + _project = value; + RaisePropertyChangedAuto(); + } + } + public string Code + { + get { return _code; } + set { _code = value; } + } + + public string File { get; set; } + public string Line { get; set; } + public string SuppressionState { get; set; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SharedResourceDictionary.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SharedResourceDictionary.cs new file mode 100644 index 000000000..a163355c4 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SharedResourceDictionary.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; + +namespace Tango.Scripting.IDE.Controls +{ + + /// <summary> + /// The shared resource dictionary is a specialized resource dictionary + /// that loads it content only once. If a second instance with the same source + /// is created, it only merges the resources from the cache. + /// </summary> + public class SharedResourceDictionary : ResourceDictionary + { + /// <summary> + /// Internal cache of loaded dictionaries + /// </summary> + public static Dictionary<Uri, ResourceDictionary> _sharedDictionaries = + new Dictionary<Uri, ResourceDictionary>(); + + /// <summary> + /// Local member of the source uri + /// </summary> + private Uri _sourceUri; + + /// <summary> + /// Gets or sets the uniform resource identifier (URI) to load resources from. + /// </summary> + public new Uri Source + { + get { return _sourceUri; } + set + { + _sourceUri = value; + + if (!_sharedDictionaries.ContainsKey(value)) + { + // If the dictionary is not yet loaded, load it by setting + // the source of the base class + base.Source = value; + + // add it to the cache + _sharedDictionaries.Add(value, this); + } + else + { + // If the dictionary is already loaded, get it from the cache + MergedDictionaries.Add(_sharedDictionaries[value]); + } + } + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs new file mode 100644 index 000000000..ad6c65f22 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE.Controls +{ + public class SolutionItemControl : Control + { + public ISolutionItem SolutionItem + { + get { return (ISolutionItem)GetValue(SolutionItemProperty); } + set { SetValue(SolutionItemProperty, value); } + } + public static readonly DependencyProperty SolutionItemProperty = + DependencyProperty.Register("SolutionItem", typeof(ISolutionItem), typeof(SolutionItemControl), new PropertyMetadata(null)); + + public ICommand OpenCommand + { + get { return (ICommand)GetValue(OpenCommandProperty); } + set { SetValue(OpenCommandProperty, value); } + } + public static readonly DependencyProperty OpenCommandProperty = + DependencyProperty.Register("OpenCommand", typeof(ICommand), typeof(SolutionItemControl), new PropertyMetadata(null)); + + static SolutionItemControl() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(SolutionItemControl), new FrameworkPropertyMetadata(typeof(SolutionItemControl))); + } + + public SolutionItemControl() + { + PreviewMouseDoubleClick += (_, __) => + { + if (SolutionItem.CanOpen) + { + OpenCommand?.Execute(SolutionItem); + } + }; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/TabConrolClose.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/TabConrolClose.cs new file mode 100644 index 000000000..7130733e5 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/TabConrolClose.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE.Controls +{ + + public class TabConrolClose : TabControl + { + static TabConrolClose() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(TabConrolClose), new FrameworkPropertyMetadata(typeof(TabConrolClose))); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Converters/LeftMarginMultiplierConverter.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Converters/LeftMarginMultiplierConverter.cs new file mode 100644 index 000000000..2acefc09c --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Converters/LeftMarginMultiplierConverter.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Media; + +namespace Tango.Scripting.IDE.Converters +{ + public static class TreeViewItemExtensions + { + public static int GetDepth(this TreeViewItem item) + { + TreeViewItem parent; + while ((parent = GetParent(item)) != null) + { + return GetDepth(parent) + 1; + } + return 0; + } + + private static TreeViewItem GetParent(TreeViewItem item) + { + var parent = VisualTreeHelper.GetParent(item); + while (!(parent is TreeViewItem || parent is TreeView)) + { + parent = VisualTreeHelper.GetParent(parent); + } + return parent as TreeViewItem; + } + } + public class LeftMarginMultiplierConverter : IValueConverter + { + public double Length { get; set; } + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + var item = value as TreeViewItem; + if (item == null) + return new Thickness(0); + + return new Thickness(Length * item.GetDepth(), 0, 0, 0); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new System.NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectView.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectView.xaml new file mode 100644 index 000000000..3046857db --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectView.xaml @@ -0,0 +1,131 @@ +<UserControl x:Class="Tango.Scripting.IDE.Dialogs.AddProjectView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Dialogs" + mc:Ignorable="d" + xmlns:global="clr-namespace:Tango.Scripting.IDE" + Width="800" Height="600" + MinWidth="800" MinHeight="600" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:NewProjectViewVM, IsDesignTimeCreatable=False}"> + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="/Tango.Scripting.IDE;component/Themes/DarkThemesColors.xaml"/> + <ResourceDictionary Source="/Tango.Scripting.IDE;component/Themes/Shared.xaml"/> + </ResourceDictionary.MergedDictionaries> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}" /> + </Style> + <Style TargetType="TextBox"> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}" /> + <Setter Property="Background" Value="{DynamicResource ListBorder}" /> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="BorderBrush" Value="{DynamicResource ListBorder}"/> + </Style> + + <Style TargetType="Label"> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}" /> + </Style> + <BooleanToVisibilityConverter x:Key="BoolToVis" /> + </ResourceDictionary> + </UserControl.Resources> + <Grid x:Name="Main_NewProject_grid" Background="{DynamicResource Window.Background}" > + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="240"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + <RowDefinition Height="40"/> + </Grid.RowDefinitions> + <Border Background="{DynamicResource Background.Static}" BorderThickness="0" Grid.Column="0" Grid.Row="0" > + <Border BorderThickness="0" Margin="5" Background="{DynamicResource Window.Background}"> + <ListView x:Name="ProjectTypes" ItemsSource="{Binding ProjectTypes}" Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectedItem="{Binding SelectedProjectType,Mode=TwoWay}" BorderBrush="Transparent" IsSynchronizedWithCurrentItem="True"> + <ListView.ItemTemplate> + <DataTemplate> + <Border Padding="2"> + <WrapPanel> + <Image Stretch="Fill" Height="30" Source="{Binding Path=SmallImage}"/> + <TextBlock Text="{Binding Name}" Margin="20,5,0,0" Foreground="{DynamicResource ControlTextBrush}"/> + </WrapPanel> + </Border> + </DataTemplate> + </ListView.ItemTemplate> + <ListView.Resources> + <Style TargetType="{x:Type ListViewItem}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListViewItem}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> + </Border> + <ControlTemplate.Triggers> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="Selector.IsSelectionActive" Value="False" /> + <Condition Property="IsSelected" Value="True" /> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBrushColorKey}" /> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="Selector.IsSelectionActive" Value="True" /> + <Condition Property="IsSelected" Value="True" /> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBrushColorKey}" /> + </MultiTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </ListView.Resources> + </ListView> + </Border> + </Border> + <Grid x:Name="ProjectImage" Grid.Column="1" Grid.Row="0" Background="{DynamicResource Background.Static}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" MinHeight="40"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + <TextBlock Grid.Row="0" Text="{Binding SelectedDescription}" Margin="10" TextWrapping="Wrap"/> + <Border Grid.Row="1" BorderThickness="0"> + <Border Width="126" Height="126" VerticalAlignment="Center" HorizontalAlignment="Center"> + <Image Stretch="Uniform" Source="{Binding Path=LargeImage}" + VerticalAlignment="Center" + HorizontalAlignment="Center" /> + </Border> + </Border> + </Grid> + + <Border Grid.Row="1" Grid.ColumnSpan="2" Margin="10" > + <Grid x:Name="ProjectNameGrid" Grid.Row="1" Grid.ColumnSpan="2"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="110"/> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="240"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="24"/> + <RowDefinition Height="5"/> + <RowDefinition Height="24"/> + <RowDefinition Height="5"/> + <RowDefinition Height="24"/> + </Grid.RowDefinitions> + + <TextBlock Grid.Column="0" Grid.Row="0">Name:</TextBlock> + <TextBox Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" Text="{Binding ProjectName}"/> + + </Grid> + </Border> + <Border Grid.Row="2" Grid.ColumnSpan="2"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" > + <Button Style="{DynamicResource TangoButtonStyle}" IsDefault="True" Width="80" Height="24" Command="{Binding OKCommand}">OK</Button> + <Button Margin="8,0,15,0" Style="{DynamicResource TangoButtonStyle}" Width="80" Height="24" Command="{Binding CloseCommand}">Cancel</Button> + </StackPanel> + </Border> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectView.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectView.xaml.cs new file mode 100644 index 000000000..83856f4e7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE.Dialogs +{ + /// <summary> + /// Interaction logic for AddProjectControl.xaml + /// </summary> + public partial class AddProjectView : UserControl + { + public AddProjectView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectViewVM.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectViewVM.cs new file mode 100644 index 000000000..2d636a6d5 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/AddProjectViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.Scripting.IDE.Dialogs +{ + public class AddProjectViewVM : BaseProjectDialogVM + { + public AddProjectViewVM() : base() + { + Title = "Add Project"; + //ProjectName + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs new file mode 100644 index 000000000..5f2ebcb15 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.Core.Commands; +using Tango.Scripting.IDE.ProjectTypes; +using Tango.SharedUI; + +namespace Tango.Scripting.IDE.Dialogs +{ + public class BaseProjectDialogVM : IDEDialogViewModel + { + #region properties + public ObservableCollection<IProjectType> ProjectTypes { get; set; } + + private IProjectType _selectedProjectType = null; + public IProjectType SelectedProjectType + { + get { return _selectedProjectType; } + set + { + _selectedProjectType = value; + RaisePropertyChangedAuto(); + RaisePropertyChanged("LargeImage"); + RaisePropertyChanged("SelectedDescription"); + } + } + private BitmapSource _defaultLargeImage = ProjectType.GetImage("Images/test.png"); + public BitmapSource LargeImage + { + get + { + if (SelectedProjectType != null) + return SelectedProjectType.LargeImage; + else return _defaultLargeImage; + } + } + public string SelectedDescription + { + get + { + if (SelectedProjectType != null) + return SelectedProjectType.Description; + return ""; + } + } + private String _projectName = "App1"; + public String ProjectName + { + get { return _projectName; } + set { _projectName = value; RaisePropertyChangedAuto(); } + } + private String _projectLocation; + public String ProjectLocation + { + get { return _projectLocation; } + set { _projectLocation = value; RaisePropertyChangedAuto(); } + } + #endregion + #region constructor + public BaseProjectDialogVM() : base() + { + ProjectTypes = new ObservableCollection<IProjectType>(); + RegisterProjectType(new StubProjectType()); + RegisterProjectType(new UnitTestProjectType()); + + _selectedProjectType = ProjectTypes.FirstOrDefault(); + + string workingDirectory = Environment.CurrentDirectory; + ProjectLocation = Directory.GetParent(workingDirectory).Parent.Parent.FullName; + + CanClose = true; + CloseCommand = new RelayCommand(Cancel, (x) => CanClose); + OKCommand = new RelayCommand(Accept, (x) => CanClose); + } + #endregion + #region commands + + #endregion + #region register_project_types + public void RegisterProjectType(IProjectType projectType) + { + ProjectTypes.Add(projectType); + } + + public void UnRegisterProjectItemHandler(IProjectType projectType) + { + ProjectTypes.Remove(projectType); + } + #endregion + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectView.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectView.xaml new file mode 100644 index 000000000..20a334f3b --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectView.xaml @@ -0,0 +1,139 @@ +<UserControl x:Class="Tango.Scripting.IDE.Dialogs.NewProjectView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Dialogs" + mc:Ignorable="d" + xmlns:global="clr-namespace:Tango.Scripting.IDE" + d:DesignHeight="450" d:DesignWidth="800" + Width="800" Height="600" + > + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="/Tango.Scripting.IDE;component/Themes/DarkThemesColors.xaml"/> + <ResourceDictionary Source="/Tango.Scripting.IDE;component/Themes/Shared.xaml"/> + </ResourceDictionary.MergedDictionaries> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}" /> + </Style> + <Style TargetType="TextBox"> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}" /> + <Setter Property="Background" Value="{DynamicResource ListBorder}" /> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="BorderBrush" Value="{DynamicResource ListBorder}"/> + </Style> + + <Style TargetType="Label"> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}" /> + </Style> + <BooleanToVisibilityConverter x:Key="BoolToVis" /> + </ResourceDictionary> + </UserControl.Resources> + <Grid Background="{DynamicResource Window.Background}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="240"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + <RowDefinition Height="40"/> + </Grid.RowDefinitions> + <Border Background="{DynamicResource Background.Static}" BorderThickness="0" Grid.Column="0" Grid.Row="0" > + <Border BorderThickness="0" Margin="5" Background="{DynamicResource Window.Background}"> + <ListView x:Name="ProjectTypes" ItemsSource="{Binding ProjectTypes}" Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectedItem="{Binding SelectedProjectType,Mode=TwoWay}" BorderBrush="Transparent" IsSynchronizedWithCurrentItem="True"> + <ListView.ItemTemplate> + <DataTemplate> + <Border Padding="2"> + <WrapPanel> + <Image Stretch="Fill" Height="30" Source="{Binding Path=SmallImage}"/> + <TextBlock Text="{Binding Name}" Margin="20,5,0,0" Foreground="{DynamicResource ControlTextBrush}"/> + </WrapPanel> + </Border> + </DataTemplate> + </ListView.ItemTemplate> + <ListView.Resources> + <Style TargetType="{x:Type ListViewItem}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListViewItem}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> + </Border> + <ControlTemplate.Triggers> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="Selector.IsSelectionActive" Value="False" /> + <Condition Property="IsSelected" Value="True" /> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBrushColorKey}" /> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="Selector.IsSelectionActive" Value="True" /> + <Condition Property="IsSelected" Value="True" /> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBrushColorKey}" /> + </MultiTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </ListView.Resources> + </ListView> + </Border> + </Border> + <Grid x:Name="ProjectImage" Grid.Column="1" Grid.Row="0" Background="{DynamicResource Background.Static}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" MinHeight="40"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + <TextBlock Grid.Row="0" Text="{Binding SelectedDescription}" Margin="10" TextWrapping="Wrap"/> + <Border Grid.Row="1" BorderThickness="0"> + <Border Width="126" Height="126" VerticalAlignment="Center" HorizontalAlignment="Center"> + <Image Stretch="Uniform" Source="{Binding Path=LargeImage}" + VerticalAlignment="Center" + HorizontalAlignment="Center" /> + </Border> + </Border> + </Grid> + + <Border Grid.Row="1" Grid.ColumnSpan="2" Margin="10" > + <Grid x:Name="ProjectNameGrid" Grid.Row="1" Grid.ColumnSpan="2"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="110"/> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="240"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="24"/> + <RowDefinition Height="5"/> + <RowDefinition Height="24"/> + <RowDefinition Height="5"/> + <RowDefinition Height="24"/> + </Grid.RowDefinitions> + + <TextBlock Grid.Column="0" Grid.Row="0">Name:</TextBlock> + <TextBox Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" Text="{Binding ProjectName}"/> + + <TextBlock Grid.Column="0" Grid.Row="2" Text="Location"/> + <Border Background="{DynamicResource ListBorder}" Grid.Column="1" Grid.Row="2" Margin="0,2,0,2" BorderBrush="{DynamicResource Button.Static.Border}" > + <ComboBox Style="{DynamicResource TangoComboboxStyle}" VerticalAlignment="Stretch" SelectedItem="{Binding ProjectLocation}" ItemsSource="{Binding Locations}" HorizontalAlignment="Stretch" BorderBrush="Transparent"/> + </Border> + <Button Style="{DynamicResource TangoButtonStyle}" Grid.Column="2" Grid.Row="2" Width="80" HorizontalAlignment="Left" Margin="20,0,0,0" Content="Browse..." Command="{Binding BrowseFileCommand}"/> + <TextBlock Grid.Column="0" Grid.Row="4" Text="Solution name:"/> + <TextBox Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" Text="{Binding SolutionName}" /> + + </Grid> + </Border> + <Border Grid.Row="2" Grid.ColumnSpan="2"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" > + <Button Style="{DynamicResource TangoButtonStyle}" IsDefault="True" Width="80" Height="24" Command="{Binding OKCommand}">OK</Button> + <Button Margin="8,0,15,0" Style="{DynamicResource TangoButtonStyle}" Width="80" Height="24" Command="{Binding CloseCommand}">Cancel</Button> + </StackPanel> + </Border> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectView.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectView.xaml.cs new file mode 100644 index 000000000..5221146d8 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectView.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE.Dialogs +{ + /// <summary> + /// Interaction logic for AddNewControl.xaml + /// </summary> + public partial class NewProjectView : UserControl + { + public NewProjectView() + { + InitializeComponent(); + } + + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectViewVM.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectViewVM.cs new file mode 100644 index 000000000..4b656c98c --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/NewProjectViewVM.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.Core.Commands; +using Tango.Scripting.IDE.ProjectTypes; +using Tango.SharedUI; +using Microsoft.WindowsAPICodePack.Dialogs; +using Microsoft.Win32; + +namespace Tango.Scripting.IDE.Dialogs +{ + public class NewProjectViewVM : BaseProjectDialogVM + { + + static public ObservableCollection<String> Locations { get; set; } = new ObservableCollection<string>(); + + private String _solutionName = "App1"; + public String SolutionName + { + get { return _solutionName; } + set { _solutionName = value; RaisePropertyChangedAuto(); } + } + #region Commands + public RelayCommand BrowseFileCommand { get; set; } + #endregion + public NewProjectViewVM() : base() + { + Title = "New Project"; + + if(Locations.IndexOf(ProjectLocation) < 0) + { + Locations.Add(ProjectLocation); + } + BrowseFileCommand = new RelayCommand(BrowseFile); + } + private void BrowseFile() + { + CommonOpenFileDialog dialog = new CommonOpenFileDialog(); + dialog.InitialDirectory = Locations.LastOrDefault<string>(); + dialog.IsFolderPicker = true; + if (dialog.ShowDialog() == CommonFileDialogResult.Ok) + { + if( Directory.Exists(dialog.FileName) == true) + { + if(false == Locations.Contains(dialog.FileName)) + { + Locations.Add(dialog.FileName); + } + ProjectLocation = dialog.FileName; + } + } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDEDialogViewModel.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDEDialogViewModel.cs new file mode 100644 index 000000000..7532581b1 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDEDialogViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.Scripting.IDE +{ + public class IDEDialogViewModel : DialogViewVM + { + public String Title { get; set; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDESettings.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDESettings.cs new file mode 100644 index 000000000..608ca0bdc --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDESettings.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.IDE +{ + public class IDESettings + { + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDEViewModel.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDEViewModel.cs new file mode 100644 index 000000000..ef413f69a --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IDEViewModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.Scripting.IDE.Notifications; +using Tango.SharedUI; + +namespace Tango.Scripting.IDE +{ + public class IDEViewModel : ViewModel + { + public INotificationManager NotificationManager { get; set; } + + public IDEViewModel() + { + TangoIOC.Default.Inject(this); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProject.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProject.cs new file mode 100644 index 000000000..18d95a7d8 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProject.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.IDE +{ + public interface IProject : ISolutionItem + { + String FilePath { get; set; } + + String WorkingFolder { get; } + + ObservableCollection<IProjectItem> Items { get; set; } + + Task Build(); + + Task Run(); + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProjectItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProjectItem.cs new file mode 100644 index 000000000..0d34cf2e6 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProjectItem.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.IDE +{ + public interface IProjectItem : ISolutionItem + { + ObservableCollection<IProjectItem> Items { get; set; } + + FrameworkElement View { get; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProjectType.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProjectType.cs new file mode 100644 index 000000000..19a234db3 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/IProjectType.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.IDE +{ + public interface IProjectType + { + IProject NewProject(String projectPath); + + String Name { get; } + + String Description { get; } + + BitmapSource SmallImage { get; } + BitmapSource LargeImage { get; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ISolutionItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ISolutionItem.cs new file mode 100644 index 000000000..74bdab066 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ISolutionItem.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.IDE +{ + public interface ISolutionItem + { + String Name { get; } + + BitmapSource Image { get; } + + bool CanOpen { get; } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CSharpProject.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CSharpProject.png Binary files differnew file mode 100644 index 000000000..5b0f29960 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CSharpProject.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CSharpScriptItem.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CSharpScriptItem.png Binary files differnew file mode 100644 index 000000000..37e4e1727 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CSharpScriptItem.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CloseDocument_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CloseDocument_16x.png Binary files differnew file mode 100644 index 000000000..5c5691574 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CloseDocument_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CloseSolution_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CloseSolution_16x.png Binary files differnew file mode 100644 index 000000000..41ff45a94 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/CloseSolution_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/FindinFiles_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/FindinFiles_16x.png Binary files differnew file mode 100644 index 000000000..5b47a34ce --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/FindinFiles_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewFileCollection_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewFileCollection_16x.png Binary files differnew file mode 100644 index 000000000..bc5cef828 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewFileCollection_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewRelationship_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewRelationship_16x.png Binary files differnew file mode 100644 index 000000000..0be7b4fbf --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewRelationship_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewWindow_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewWindow_16x.png Binary files differnew file mode 100644 index 000000000..d4d0c0329 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/NewWindow_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/OpenFolder_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/OpenFolder_16x.png Binary files differnew file mode 100644 index 000000000..9ba3e52d2 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/OpenFolder_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Pause_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Pause_16x.png Binary files differnew file mode 100644 index 000000000..10cdfb53c --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Pause_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Redo_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Redo_16x.png Binary files differnew file mode 100644 index 000000000..331e15706 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Redo_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Reference.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Reference.png Binary files differnew file mode 100644 index 000000000..fa5430947 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Reference.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveAll_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveAll_16x.png Binary files differnew file mode 100644 index 000000000..aaffd1174 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveAll_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveClose_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveClose_16x.png Binary files differnew file mode 100644 index 000000000..09941041f --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveClose_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveStatusBar9_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveStatusBar9_16x.png Binary files differnew file mode 100644 index 000000000..ea9c23f2a --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/SaveStatusBar9_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Save_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Save_16x.png Binary files differnew file mode 100644 index 000000000..cbc55c22e --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Save_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/StubProject.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/StubProject.png Binary files differnew file mode 100644 index 000000000..cd0ad20ad --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/StubProject.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Undo_16x.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Undo_16x.png Binary files differnew file mode 100644 index 000000000..3c563e72f --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/Undo_16x.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/algorithm.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/algorithm.png Binary files differnew file mode 100644 index 000000000..ab6b4c30f --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/algorithm.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/checklist_white_32.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/checklist_white_32.png Binary files differnew file mode 100644 index 000000000..e904220a7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/checklist_white_32.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/clipboard.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/clipboard.png Binary files differnew file mode 100644 index 000000000..22a9c8ee4 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/clipboard.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/deletered_16.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/deletered_16.png Binary files differnew file mode 100644 index 000000000..869ae3797 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/deletered_16.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/pp_project.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/pp_project.png Binary files differnew file mode 100644 index 000000000..e5eb56670 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/pp_project.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/redo-arrow-symbol.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/redo-arrow-symbol.png Binary files differnew file mode 100644 index 000000000..16c9b0194 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/redo-arrow-symbol.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/redo-arrow-symbol1.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/redo-arrow-symbol1.png Binary files differnew file mode 100644 index 000000000..ba64d6a89 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/redo-arrow-symbol1.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stop.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stop.png Binary files differnew file mode 100644 index 000000000..33e74f508 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stop.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_126.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_126.png Binary files differnew file mode 100644 index 000000000..a06e8e1c8 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_126.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_32.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_32.png Binary files differnew file mode 100644 index 000000000..4dc3d53e5 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_32.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_whit_32.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_whit_32.png Binary files differnew file mode 100644 index 000000000..875611302 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/stub_project_whit_32.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/test.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/test.png Binary files differnew file mode 100644 index 000000000..1d60a840f --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/test.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/unitTest.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/unitTest.png Binary files differnew file mode 100644 index 000000000..fcc6a4fb7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/unitTest.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/unitTest_126.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/unitTest_126.png Binary files differnew file mode 100644 index 000000000..a49c21379 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/unitTest_126.png diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/DefaultNotificationManager.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/DefaultNotificationManager.cs new file mode 100644 index 000000000..7121e6ce0 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/DefaultNotificationManager.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.Scripting.IDE.Windows; +using Tango.SharedUI; + +namespace Tango.Scripting.IDE.Notifications +{ + public class DefaultNotificationManager : INotificationManager + { + public Task<TViewModel> ShowDialog<TViewModel, TView>(TViewModel viewModel, TView view) + where TViewModel : IDEDialogViewModel + where TView : FrameworkElement + { + TaskCompletionSource<TViewModel> source = new TaskCompletionSource<TViewModel>(); + + Application.Current.Dispatcher.BeginInvoke(new Action(() => + { + DialogWindow window = new DialogWindow(); + window.Title = viewModel.Title; + window.Content = view; + view.DataContext = viewModel; + window.WindowStartupLocation = WindowStartupLocation.CenterOwner; + window.Owner = Application.Current.MainWindow; + viewModel.Accepted += () => + { + window.Close(); + source.SetResult(viewModel); + }; + viewModel.Canceled += () => + { + window.Close(); + source.SetResult(viewModel); + }; + window.ShowDialog(); + })); + + return source.Task; + } + + public Task<TViewModel> ShowDialog<TViewModel>(TViewModel viewModel) where TViewModel : IDEDialogViewModel + { + var modelName = typeof(TViewModel).Name; + var viewName = modelName.Replace("VM", ""); + var viewType = typeof(TViewModel).Assembly.GetType(typeof(TViewModel).Namespace + "." + viewName); + var view = Activator.CreateInstance(viewType) as FrameworkElement; + return ShowDialog(viewModel, view); + } + + public Task<TViewModel> ShowDialog<TViewModel>() where TViewModel : IDEDialogViewModel + { + return ShowDialog(Activator.CreateInstance<TViewModel>()); + } + + public Task ShowError(string title, string message) + { + throw new NotImplementedException(); + } + + public Task ShowInfo(string title, string message) + { + throw new NotImplementedException(); + } + + public ProgressNotificationHandler ShowProgress(string title, string message, bool canCancel = false) + { + throw new NotImplementedException(); + } + + public Task<bool> ShowQuestion(string title, string message) + { + throw new NotImplementedException(); + } + + public Task ShowSuccess(string title, string message) + { + throw new NotImplementedException(); + } + + public Task ShowWarning(string title, string message) + { + throw new NotImplementedException(); + } + + private Task ShowMessageBox(String title, String message, bool hasCancel, BitmapSource icon) + { + return null; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/INotificationManager.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/INotificationManager.cs new file mode 100644 index 000000000..1ed516b28 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/INotificationManager.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using Tango.SharedUI; + +namespace Tango.Scripting.IDE.Notifications +{ + /// <summary> + /// Represents the IDE notification manager. + /// </summary> + public interface INotificationManager + { + /// <summary> + /// Displays the specified TView as a dialog and TViewModel as it's data context. + /// </summary> + /// <typeparam name="TViewModel">The type of the view model.</typeparam> + /// <typeparam name="TView">The type of the view.</typeparam> + /// <param name="viewModel">The view model.</param> + /// <param name="view">The view.</param> + /// <returns></returns> + Task<TViewModel> ShowDialog<TViewModel, TView>(TViewModel viewModel, TView view) where TViewModel : IDEDialogViewModel where TView : FrameworkElement; + + /// <summary> + /// Finds (by convention )the appropriate view by the specified TViewModel name. + /// The search pattern is ViewVM - VM + View. + /// </summary> + /// <typeparam name="TViewModel">The type of the view model.</typeparam> + /// <param name="viewModel">The view model.</param> + /// <returns></returns> + Task<TViewModel> ShowDialog<TViewModel>(TViewModel viewModel) where TViewModel : IDEDialogViewModel; + + /// <summary> + /// Finds (by convention )the appropriate view by the specified TViewModel name. + /// The search pattern is ViewVM - VM + View. + /// The view model instance will be created automatically and must contain a parameterless constructor. + /// </summary> + /// <typeparam name="TViewModel">The type of the view model.</typeparam> + /// <param name="viewModel">The view model.</param> + /// <returns></returns> + Task<TViewModel> ShowDialog<TViewModel>() where TViewModel : IDEDialogViewModel; + + /// <summary> + /// Displays an error message. + /// </summary> + /// <param name="title">The title.</param> + /// <param name="message">The message.</param> + /// <returns></returns> + Task ShowError(String title, String message); + + /// <summary> + /// Displays an error message. + /// </summary> + /// <param name="title">The title.</param> + /// <param name="message">The message.</param> + /// <returns></returns> + Task ShowInfo(String title, String message); + + /// <summary> + /// Displays a warning message. + /// </summary> + /// <param name="title">The title.</param> + /// <param name="message">The message.</param> + /// <returns></returns> + Task ShowWarning(String title, String message); + + /// <summary> + /// Displays a positive message. + /// </summary> + /// <param name="title">The title.</param> + /// <param name="message">The message.</param> + /// <returns></returns> + Task ShowSuccess(String title, String message); + + /// <summary> + /// Displays a question and returns the result. + /// </summary> + /// <param name="title">The title.</param> + /// <param name="message">The message.</param> + /// <returns></returns> + Task<bool> ShowQuestion(String title, String message); + + /// <summary> + /// Displays an intermediate progress dialog and returns an instance of <see cref="ProgressNotificationHandler"/>. + /// Once the progress notification handler will be disposed the dialog will close. + /// </summary> + /// <param name="title">The title.</param> + /// <param name="message">The message.</param> + /// <param name="canCancel">if set to <c>true</c> the dialog will contain a cancel button.</param> + /// <returns></returns> + ProgressNotificationHandler ShowProgress(String title, String message, bool canCancel = false); + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/ProgressNotificationHandler.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/ProgressNotificationHandler.cs new file mode 100644 index 000000000..b36419400 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Notifications/ProgressNotificationHandler.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.IDE.Notifications +{ + public class ProgressNotificationHandler : IDisposable + { + private Action _disposeAction; + + public ProgressNotificationHandler(Action disposeAction) + { + _disposeAction = disposeAction; + } + + public void Dispose() + { + _disposeAction?.Invoke(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs new file mode 100644 index 000000000..5a950d2c7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +namespace Tango.Scripting.IDE +{ + public abstract class Project : IProject + { + private static Dictionary<String, BitmapSource> _imageCache; + + static Project() + { + _imageCache = new Dictionary<string, BitmapSource>(); + } + + public string FilePath { get; set; } + + public string WorkingFolder => Path.GetDirectoryName(FilePath); + + public string Name => Path.GetFileNameWithoutExtension(FilePath); + + public abstract BitmapSource Image { get; } + + public ObservableCollection<IProjectItem> Items { get; set; } + + public Project() + { + Items = new ObservableCollection<IProjectItem>(); + } + + public abstract Task Build(); + public abstract Task Run(); + + protected static BitmapSource GetImage(String name) + { + if (_imageCache.ContainsKey(name)) + { + return _imageCache[name]; + } + else + { + var image = ResourceHelper.GetImageFromResources(name); + _imageCache.Add(name, image); + return image; + } + } + + public bool CanOpen => false; + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs new file mode 100644 index 000000000..8adc26dc7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.Core; +using Tango.SharedUI.Helpers; + +namespace Tango.Scripting.IDE +{ + public abstract class ProjectItem : ExtendedObject, IProjectItem + { + private static Dictionary<String, BitmapSource> _imageCache; + + static ProjectItem() + { + _imageCache = new Dictionary<string, BitmapSource>(); + } + + public string Name { get; set; } + public ObservableCollection<IProjectItem> Items { get; set; } + + public ProjectItem() + { + Items = new ObservableCollection<IProjectItem>(); + } + + public abstract BitmapSource Image { get; } + + public abstract FrameworkElement OnGetView(); + + private FrameworkElement GetView() + { + return OnGetView(); + } + + protected static BitmapSource GetImage(String name) + { + if (_imageCache.ContainsKey(name)) + { + return _imageCache[name]; + } + else + { + var image = ResourceHelper.GetImageFromResources(name); + _imageCache.Add(name, image); + return image; + } + } + + public abstract bool CanOpen { get; } + public FrameworkElement View => GetView(); + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/CSharpScriptItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/CSharpScriptItem.cs new file mode 100644 index 000000000..cf4811047 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/CSharpScriptItem.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.Scripting.IDE.ProjectItemsViews; + +namespace Tango.Scripting.IDE.ProjectItems +{ + public class CSharpScriptItem : ProjectItem + { + public override BitmapSource Image => GetImage("Images/CSharpScriptItem.png"); + + private String _code; + public String Code + { + get { return _code; } + set { _code = value; RaisePropertyChangedAuto(); } + } + + public override bool CanOpen => true; + + public override FrameworkElement OnGetView() + { + return new CSharpScriptItemView(this); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/ReferenceAssembliesItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/ReferenceAssembliesItem.cs new file mode 100644 index 000000000..0e66fd241 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/ReferenceAssembliesItem.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.IDE.ProjectItems +{ + public class ReferenceAssembliesItem : ProjectItem + { + public ReferenceAssembliesItem() + { + Name = "References"; + } + + public override BitmapSource Image => GetImage("Images/Reference.png"); + + public override FrameworkElement OnGetView() + { + return null; + } + + public override bool CanOpen => false; + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/ReferenceAssemblyItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/ReferenceAssemblyItem.cs new file mode 100644 index 000000000..e9cd1e8f2 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItems/ReferenceAssemblyItem.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.IDE.ProjectItems +{ + public class ReferenceAssemblyItem : ProjectItem + { + public String Path { get; set; } + public override BitmapSource Image => GetImage("Images/Reference.png"); + + public override FrameworkElement OnGetView() + { + return null; + } + + public override bool CanOpen => false; + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItemsViews/CSharpScriptItemView.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItemsViews/CSharpScriptItemView.xaml new file mode 100644 index 000000000..682956205 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItemsViews/CSharpScriptItemView.xaml @@ -0,0 +1,13 @@ +<UserControl x:Class="Tango.Scripting.IDE.ProjectItemsViews.CSharpScriptItemView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.Scripting.IDE.ProjectItemsViews" + xmlns:editors="clr-namespace:Tango.Scripting.Editors;assembly=Tango.Scripting.Editors" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid> + <editors:ScriptEditor /> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItemsViews/CSharpScriptItemView.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItemsViews/CSharpScriptItemView.xaml.cs new file mode 100644 index 000000000..34c604b83 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItemsViews/CSharpScriptItemView.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Scripting.IDE.ProjectItems; + +namespace Tango.Scripting.IDE.ProjectItemsViews +{ + /// <summary> + /// Interaction logic for CSharpScriptItemView.xaml + /// </summary> + public partial class CSharpScriptItemView : UserControl + { + public CSharpScriptItemView(CSharpScriptItem scriptItem) + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectType.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectType.cs new file mode 100644 index 000000000..86efc4330 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectType.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +namespace Tango.Scripting.IDE +{ + public abstract class ProjectType : IProjectType + { + private static Dictionary<String, BitmapSource> _imageCache; + + static ProjectType() + { + _imageCache = new Dictionary<string, BitmapSource>(); + } + + public abstract string Name { get; } + public abstract string Description { get; } + public abstract string Extention { get; } + public abstract BitmapSource SmallImage { get; } + public abstract BitmapSource LargeImage { get; } + + public static BitmapSource GetImage(String name) + { + if (_imageCache.ContainsKey(name)) + { + return _imageCache[name]; + } + else + { + var image = ResourceHelper.GetImageFromResources(name); + _imageCache.Add(name, image); + return image; + } + } + + public abstract IProject NewProject(string projectPath); + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectTypes/StubProjectType.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectTypes/StubProjectType.cs new file mode 100644 index 000000000..6fe1316f4 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectTypes/StubProjectType.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.Scripting.IDE.ProjectItems; +using Tango.Scripting.IDE.Projects; + +namespace Tango.Scripting.IDE.ProjectTypes +{ + public class StubProjectType : ProjectType + { + public override IProject NewProject(string projectPath) + { + StubProject project = new StubProject(); + + project.FilePath = projectPath + Extention; ; + + var referenceAssembliesItem = new ReferenceAssembliesItem(); + + referenceAssembliesItem.Items.Add(new ReferenceAssemblyItem() + { + Path = "mscorelib.dll", + Name = "System.dll", + }); + referenceAssembliesItem.Items.Add(new ReferenceAssemblyItem() + { + Path = "System.Core.dll", + Name = "System.Core.dll", + }); + + project.Items.Add(referenceAssembliesItem); + + project.Items.Add(new CSharpScriptItem() { Name = "main.csx" }); + project.Items.Add(new CSharpScriptItem() { Name = "next.csx" }); + + return project; + } + + public override string Name => "Stub Project"; + public override string Description => "Create a stub project template."; + public override string Extention => ".stub"; + public override BitmapSource SmallImage => GetImage("Images/stub_project_32.png"); + public override BitmapSource LargeImage => GetImage("Images/stub_project_126.png"); + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectTypes/UnitTestProjectType.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectTypes/UnitTestProjectType.cs new file mode 100644 index 000000000..42bab7059 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectTypes/UnitTestProjectType.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.Scripting.IDE.ProjectItems; +using Tango.Scripting.IDE.Projects; + +namespace Tango.Scripting.IDE.ProjectTypes +{ + public class UnitTestProjectType : ProjectType + { + public override IProject NewProject(string projectPath) + { + UnitTestProject project = new UnitTestProject(); + + project.FilePath = projectPath + Extention; ; + + var referenceAssembliesItem = new ReferenceAssembliesItem(); + + referenceAssembliesItem.Items.Add(new ReferenceAssemblyItem() + { + Path = "mscorelib.dll", + Name = "System.dll", + }); + referenceAssembliesItem.Items.Add(new ReferenceAssemblyItem() + { + Path = "System.Core.dll", + Name = "System.Core.dll", + }); + + project.Items.Add(referenceAssembliesItem); + + return project; + } + + public override string Name => "Unit Test Project"; + public override string Description => "Create a unit test project template."; + public override string Extention => ".unit"; + public override BitmapSource SmallImage => GetImage("Images/unitTest.png"); + public override BitmapSource LargeImage => GetImage("Images/unitTest_126.png"); + + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/CSharpProject.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/CSharpProject.cs new file mode 100644 index 000000000..62e830d06 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/CSharpProject.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.IDE.Projects +{ + public abstract class CSharpProject : Project + { + + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/StubProject.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/StubProject.cs new file mode 100644 index 000000000..bc915fa77 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/StubProject.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.IDE.Projects +{ + public class StubProject : CSharpProject + { + public override BitmapSource Image => GetImage("Images/StubProject.png"); + + public override Task Build() + { + throw new NotImplementedException(); + } + + public override Task Run() + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/UnitTestProject.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/UnitTestProject.cs new file mode 100644 index 000000000..e5510ad45 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Projects/UnitTestProject.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Scripting.IDE.Projects +{ + public class UnitTestProject : CSharpProject + { + public override BitmapSource Image { get; } + + public override Task Build() + { + throw new NotImplementedException(); + } + + public override Task Run() + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/AssemblyInfo.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..3ac597e08 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango.Scripting.IDE")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.Scripting.IDE")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file +//inside a <PropertyGroup>. For example, if you are using US english +//in your source files, set the <UICulture> to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Resources.Designer.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Resources.Designer.cs new file mode 100644 index 000000000..ec92331cb --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.Scripting.IDE.Properties { + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.Scripting.IDE.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Resources.resx b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Settings.Designer.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Settings.Designer.cs new file mode 100644 index 000000000..2a0fdc6a9 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.Scripting.IDE.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Settings.settings b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Resources.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Resources.xaml new file mode 100644 index 000000000..ef5d1b599 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Resources.xaml @@ -0,0 +1,127 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" + xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:fa="http://schemas.fontawesome.io/icons/" + xmlns:local="clr-namespace:Tango.Scripting.IDE"> + + <Color x:Key="IdeDarkBackgroundColor">#202020</Color> + <Color x:Key="IdeMidBackgroundColor">#252526</Color> + <Color x:Key="IdeLightBackgroundColor">#2D2D30</Color> + <Color x:Key="IdeBorderColor">#676767</Color> + <Color x:Key="IdeAccentColor">#007ACC</Color> + <Color x:Key="IdeLightForegroundColor">#007ACC</Color> + <SolidColorBrush x:Key="IdeDarkBackgroundBrush" Color="{StaticResource IdeDarkBackgroundColor}"></SolidColorBrush> + <SolidColorBrush x:Key="IdeLightBackgroundBrush" Color="{StaticResource IdeLightBackgroundColor}"></SolidColorBrush> + <SolidColorBrush x:Key="IdeMidBackgroundBrush" Color="{StaticResource IdeMidBackgroundColor}"></SolidColorBrush> + <SolidColorBrush x:Key="IdeBorderBrush" Color="{StaticResource IdeBorderColor}"></SolidColorBrush> + <SolidColorBrush x:Key="IdeAccentBrush" Color="{StaticResource IdeAccentColor}"></SolidColorBrush> + <SolidColorBrush x:Key="IdeLightForegroundBrush" Color="{StaticResource IdeLightForegroundColor}"></SolidColorBrush> + + <!-- Background --> + <SolidColorBrush x:Key="Background" Color="#1C1C1C" options:Freeze="True" /> + <SolidColorBrush x:Key="LightBackground" Color="#2D2D30" options:Freeze="True" /> + + <Color x:Key="AccentColor">#2D2D30</Color> + <Color x:Key="BlackColor">#FFFFFFFF</Color> + <Color x:Key="WhiteColor">#2D2D30</Color> + + + + + + + + <!--Override Mahapps Colors--> + + <!-- re-set brushes too --> + <SolidColorBrush x:Key="HighlightBrush" Color="{StaticResource HighlightColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="AccentColorBrush" Color="{StaticResource AccentColor}" /> + <SolidColorBrush x:Key="AccentColorBrush2" Color="{StaticResource IdeAccentColor}" /> + <SolidColorBrush x:Key="AccentColorBrush3" Color="Transparent" /> + <SolidColorBrush x:Key="AccentColorBrush4" Color="{StaticResource IdeAccentColor}" /> + + <SolidColorBrush x:Key="WindowTitleColorBrush" Color="{StaticResource AccentColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="NonActiveWindowTitleColorBrush" Color="#808080" options:Freeze="True" /> + <SolidColorBrush x:Key="NonActiveBorderColorBrush" Color="#808080" options:Freeze="True" /> + + <SolidColorBrush x:Key="BlackBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="TextBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="LabelTextBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="BlackColorBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="TextBoxMouseOverInnerBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="TextBoxFocusBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="ButtonMouseOverBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="ButtonMouseOverInnerBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="ComboBoxMouseOverBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="ComboBoxMouseOverInnerBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" /> + + <SolidColorBrush x:Key="ControlBackgroundBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="WhiteColorBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="DisabledWhiteBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="WindowBackgroundBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" /> + + <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="{StaticResource WhiteColor}" options:Freeze="True" /> + <SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{StaticResource BlackColor}" options:Freeze="True" /> + + <LinearGradientBrush x:Key="CheckBoxBackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1" options:Freeze="True"> + <GradientStop Offset="0" Color="{StaticResource Gray7}" /> + <GradientStop Offset="1" Color="{StaticResource WhiteColor}" /> + </LinearGradientBrush> + + <!-- Foreground --> + <SolidColorBrush x:Key="Foreground" Color="#FFFFFF" options:Freeze="True" /> + <SolidColorBrush x:Key="WindowTitleForeground" Color="#999988" options:Freeze="True" /> + + <!-- General --> + <SolidColorBrush x:Key="BackgroundHighlighted" Color="#54545C" options:Freeze="True" /> + <SolidColorBrush x:Key="BorderBrushHighlighted" Color="#6A6A75" options:Freeze="True" /> + <SolidColorBrush x:Key="BackgroundSelected" Color="#007ACC" options:Freeze="True" /> + <SolidColorBrush x:Key="BorderBrushSelected" Color="#1C97EA" options:Freeze="True" /> + <SolidColorBrush x:Key="BackgroundNormal" Color="#3F3F46" options:Freeze="True" /> + <SolidColorBrush x:Key="BorderBrushNormal" Color="#54545C" options:Freeze="True" /> + <SolidColorBrush x:Key="WindowGlowBrush" Color="#017ACC" options:Freeze="True" /> + + <!-- Text Box --> + <SolidColorBrush x:Key="TextBoxBackground" Color="#333337" options:Freeze="True" /> + <SolidColorBrush x:Key="TextBoxBackgroundSelected" Color="#3F3F46" options:Freeze="True" /> + + <!-- Search Text Box --> + <SolidColorBrush x:Key="SearchTextForeground" Color="#999999" options:Freeze="True" /> + + <!-- Link Button --> + <SolidColorBrush x:Key="LinkButtonForeground" Color="#1297FB" options:Freeze="True" /> + <SolidColorBrush x:Key="LinkButtonForegroundHighlighted" Color="#55AAFF" options:Freeze="True" /> + + <!-- Close Button --> + <SolidColorBrush x:Key="CloseButtonBackgroundHighlighted" Color="#39ADFB" options:Freeze="True" /> + <SolidColorBrush x:Key="CloseButtonBackgroundPressed" Color="#084E7D" options:Freeze="True" /> + <SolidColorBrush x:Key="CloseButtonStroke" Color="#AAFFFFFF" options:Freeze="True" /> + <SolidColorBrush x:Key="CloseButtonStrokeHighlighted" Color="#FFFFFF" options:Freeze="True" /> + + <!-- Menu --> + <SolidColorBrush x:Key="MenuSeparatorBorderBrush" Color="#333337" options:Freeze="True" /> + <SolidColorBrush x:Key="MenuItemHighlightedBackground" Color="#3E3E40" options:Freeze="True" /> + <SolidColorBrush x:Key="SubmenuItemBackground" Color="#1B1B1C" options:Freeze="True" /> + <SolidColorBrush x:Key="SubmenuItemBackgroundHighlighted" Color="#333334" options:Freeze="True" /> + <SolidColorBrush x:Key="MenuDisabledForeground" Color="#656565" options:Freeze="True" /> + + <!-- Scroll Bar --> + <SolidColorBrush x:Key="ScrollBarPageButtonBackgroundHighlighted" Color="#05FFFFFF" options:Freeze="True" /> + + <!-- Notification Button --> + <SolidColorBrush x:Key="NotificationButtonForegroundBrush" Color="#000000" /> + <SolidColorBrush x:Key="NotificationButtonBackgroundBrush" Color="#FFCC00" /> + <SolidColorBrush x:Key="NotificationButtonBackgroundOverBrush" Color="#FFDF66" /> + <SolidColorBrush x:Key="NotificationButtonBackgroundPressedBrush" Color="#C59E00" /> + + <!-- Quick Launch TextBox --> + <SolidColorBrush x:Key="QuickLaunchTextBoxBorderBrush" Color="#3F3F46" /> + <SolidColorBrush x:Key="QuickLaunchTextBoxFocusedBorderBrush" Color="#007ACC" /> + + <SolidColorBrush x:Key="HoverBackgroundBrush" Color="Red" options:Freeze="True" /> + +</ResourceDictionary> +
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView.xaml new file mode 100644 index 000000000..587997450 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView.xaml @@ -0,0 +1,148 @@ +<UserControl x:Class="Tango.Scripting.IDE.ScriptIDEView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" + xmlns:fa="http://schemas.fontawesome.io/icons/" + xmlns:controls="clr-namespace:Tango.Scripting.IDE.Controls" + xmlns:local="clr-namespace:Tango.Scripting.IDE" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:ScriptIDEViewVM, IsDesignTimeCreatable=False}" x:Name="control"> + + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! --> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> + + <!-- Accent and AppTheme setting --> + + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" /> + + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Colors.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Styles.xaml" /> + + <ResourceDictionary Source="Resources.xaml" /> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </UserControl.Resources> + + <Grid Background="{StaticResource IdeLightBackgroundBrush}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="40"/> + <RowDefinition Height="41*"/> + </Grid.RowDefinitions> + + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="20"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Grid> + <Menu> + <MenuItem Header="File"></MenuItem> + <MenuItem Header="Edit"></MenuItem> + <MenuItem Header="View"></MenuItem> + <MenuItem Header="Project"></MenuItem> + <MenuItem Header="Build"></MenuItem> + <MenuItem Header="Debug"></MenuItem> + <MenuItem Header="Tools"></MenuItem> + <MenuItem Header="Theme"></MenuItem> + </Menu> + </Grid> + </Grid> + + <Grid Grid.Row="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*" MinWidth="100" /> + <ColumnDefinition Width="5"/> + <ColumnDefinition Width="300" MinWidth="20" /> + </Grid.ColumnDefinitions> + + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*" MinHeight="100" /> + <RowDefinition Height="5"/> + <RowDefinition Height="100" MinHeight="20" /> + </Grid.RowDefinitions> + + <Grid> + <TabControl ItemsSource="{Binding OpenProjectItems}" SelectedItem="{Binding SelectedProjectItem}"> + <TabControl.ItemContainerStyle> + <Style BasedOn="{StaticResource MetroTabItem}" TargetType="{x:Type TabItem}"> + <Setter Property="Background" Value="{StaticResource IdeLightBackgroundBrush}"></Setter> + <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="12"></Setter> + <Setter Property="HeaderTemplate"> + <Setter.Value> + <DataTemplate> + <Border> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{Binding Name}" Foreground="Gainsboro" VerticalAlignment="Center"></TextBlock> + <Button Command="{Binding ElementName=control,Path=DataContext.CloseProjectItemCommand}" CommandParameter="{Binding}" Margin="5 0 0 0" Cursor="Hand" Width="24" Height="24" VerticalAlignment="Center" Style="{DynamicResource MetroCircleButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0"> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome Width="10" Height="10" Icon="WindowClose" Foreground="Gainsboro"></fa:ImageAwesome> + </StackPanel> + </Button> + </StackPanel> + </Border> + </DataTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}" Value="True"> + <Setter Property="Background" Value="#007ACC"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TabControl.ItemContainerStyle> + + <TabControl.ContentTemplate> + <DataTemplate> + <ContentPresenter Content="{Binding View}" /> + </DataTemplate> + </TabControl.ContentTemplate> + </TabControl> + </Grid> + + <GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="1" Background="{StaticResource IdeLightBackgroundBrush}" /> + + <Grid Grid.Row="2" Background="{StaticResource IdeMidBackgroundBrush}"> + + </Grid> + </Grid> + + <GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="1" Background="{StaticResource IdeLightBackgroundBrush}" /> + + <Grid Grid.Column="2"> + <GroupBox Margin="0" Header="Solution Explorer" BorderThickness="1" BorderBrush="{StaticResource IdeBorderBrush}" mahapps:ControlsHelper.ContentCharacterCasing="Normal"> + <TreeView ItemsSource="{Binding Solution.Projects}" Background="{StaticResource IdeMidBackgroundBrush}" > + <TreeView.ItemContainerStyle> + <Style TargetType="TreeViewItem" BasedOn="{StaticResource {x:Type TreeViewItem}}"> + <Setter Property="Background" Value="Transparent"></Setter> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Background" Value="Transparent"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </TreeView.ItemContainerStyle> + <TreeView.ItemTemplate> + <HierarchicalDataTemplate ItemsSource="{Binding Path=Items}" DataType="{x:Type local:IProject}"> + <controls:SolutionItemControl SolutionItem="{Binding}" OpenCommand="{Binding ElementName=control,Path=DataContext.OpenProjectItemCommand}" /> + </HierarchicalDataTemplate> + </TreeView.ItemTemplate> + </TreeView> + </GroupBox> + </Grid> + </Grid> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView.xaml.cs new file mode 100644 index 000000000..3c816be05 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE +{ + /// <summary> + /// Interaction logic for ScriptIDEControl.xaml + /// </summary> + public partial class ScriptIDEView : UserControl + { + public ScriptIDEView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml new file mode 100644 index 000000000..67a673d3b --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml @@ -0,0 +1,271 @@ +<UserControl x:Class="Tango.Scripting.IDE.ScriptIDEView2" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.Scripting.IDE" + xmlns:fa="http://schemas.fontawesome.io/icons/" + xmlns:controls="clr-namespace:Tango.Scripting.IDE.Controls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:ScriptIDEViewVM, IsDesignTimeCreatable=False}" x:Name="control"> + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Themes/DarkThemesColors.xaml"/> + <ResourceDictionary Source="Themes/Shared.xaml"/> + </ResourceDictionary.MergedDictionaries> + <BooleanToVisibilityConverter x:Key="BoolToVis" /> + </ResourceDictionary> + </UserControl.Resources> + <Grid Background="{DynamicResource Background.Static}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" ></RowDefinition> + <RowDefinition Height="Auto"></RowDefinition> + <RowDefinition Height="*"></RowDefinition> + </Grid.RowDefinitions> + <Menu Grid.Row="0" HorizontalAlignment="Stretch" Margin="2,0,0,0" Style="{DynamicResource TangoMenuStyle}" BorderBrush="Transparent"> + <MenuItem Header="File"> + <MenuItem Header="New"> + <MenuItem Header="New Project..." Command="{Binding NewProjectCommand}"> + <MenuItem.Icon> + <Image Source="/Tango.Scripting.IDE;component/Images/NewFileCollection_16x.png" Height="14"/> + </MenuItem.Icon> + </MenuItem> + <MenuItem Header="File"/> + </MenuItem> + <MenuItem Header="Open"/> + <MenuItem Header="Start page"></MenuItem> + <Separator/> + <MenuItem Header="Add"></MenuItem> + <Separator/> + <MenuItem Header="Close"></MenuItem> + <Separator/> + <MenuItem Header="Save"> + <MenuItem.Icon> + <Image Source="/Tango.Scripting.IDE;component/Images/Save_16x.png" Height="10"/> + </MenuItem.Icon> + </MenuItem> + <MenuItem Header="SaveAll"> + <MenuItem.Icon> + <Image Source="/Tango.Scripting.IDE;component/Images/SaveAll_16x.png" Height="10"/> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem Header="Exit"></MenuItem> + </MenuItem> + <MenuItem Header="Edit"> + <MenuItem Header="Cut"/> + <MenuItem Header="Copy"/> + <MenuItem Header="Paste"/> + </MenuItem> + <MenuItem Header="View"></MenuItem> + <MenuItem Header="Project"></MenuItem> + <MenuItem Header="Build"></MenuItem> + <MenuItem Header="Debug"></MenuItem> + <MenuItem Header="Tools"></MenuItem> + <MenuItem Header="Theme"></MenuItem> + </Menu> + <ToolBarTray Grid.Row="1" Background="{DynamicResource Background.Static}" Width="Auto" Orientation="Horizontal"> + <ToolBar Style="{DynamicResource TangoToolBarStyle}" Background="{DynamicResource Background.Static}" Height="30" HorizontalAlignment="Left" Foreground="{DynamicResource ControlForegroundKey}" Margin="0,0,0,6"> + <ToolBar.Resources> + <Style TargetType="{x:Type Button}"> + <Setter Property="Width" Value="26"/> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="False"> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Opacity" Value="1.0" /> + </Trigger> + <EventTrigger RoutedEvent="MouseLeave"> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.2" To="1"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </EventTrigger> + <EventTrigger RoutedEvent="MouseEnter"> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.2" To="0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </EventTrigger> + </Style.Triggers> + </Style> + </ToolBar.Resources> + + <Button Click="Button_Click" ToolTip="New Project" Style="{DynamicResource TangoToolBarButtonStyle}" > + <Image Source="/Tango.Scripting.IDE;component/Images/NewFileCollection_16x.png" Height="16" Width="16"/> + + </Button> + <Button Click="Button_Click" ToolTip="Open File" Style="{DynamicResource TangoToolBarButtonStyle}"> + <Image Source="/Tango.Scripting.IDE;component/Images/OpenFolder_16x.png" Height="16" Width="16"/> + </Button> + <Button Click="Button_Click" ToolTip="Save File" Style="{DynamicResource TangoToolBarButtonStyle}"> + <Image Source="/Tango.Scripting.IDE;component/Images/Save_16x.png" Height="16" Width="16"/> + </Button> + <Button Click="Button_Click" ToolTip="Save All" Style="{DynamicResource TangoToolBarButtonStyle}"> + <Image Source="/Tango.Scripting.IDE;component/Images/SaveAll_16x.png" Height="16" Width="16"/> + </Button> + <Separator ></Separator> + <Button Click="Button_Click" ToolTip="Undo" Style="{DynamicResource TangoToolBarButtonStyle}"> + <Image Source="/Tango.Scripting.IDE;component/Images/Undo_16x.png" Height="16" Width="16"/> + </Button> + <Button Click="Button_Click" ToolTip="Redo" Style="{DynamicResource TangoToolBarButtonStyle}"> + <Image Source="/Tango.Scripting.IDE;component/Images/Redo_16x.png" Height="16" Width="16"/> + </Button> + <ComboBox Style="{DynamicResource TangoComboboxStyle}" Margin="2" x:Name="cmb2" SelectedIndex="0" HorizontalContentAlignment="Stretch" Width="100" > + <ComboBoxItem IsSelected="True">Debug</ComboBoxItem> + <ComboBoxItem >Release</ComboBoxItem> + <ComboBoxItem>Configuration Manager...</ComboBoxItem> + </ComboBox> + <Separator ></Separator> + <ToggleButton x:Name="Run_Button" Command="{Binding RunProject}" IsChecked="{Binding IsRunProject, Mode=TwoWay}" ToolTip="Start"> + <ToggleButton.Template> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Grid> + <Rectangle x:Name="background" Fill="Transparent" Opacity="1"/> + <StackPanel Orientation="Horizontal" > + <Path x:Name="RunArrow" + HorizontalAlignment="Left" VerticalAlignment="Center" + Width="12" Height="10" Margin="2,0,0,0" + Stretch="Fill" Fill="#FF8DD28A" + RenderTransformOrigin="0.6,0.4" + Data="M0,0 L1,0 0.5,1 z" > + <Path.RenderTransform> + <TransformGroup> + <ScaleTransform/> + <SkewTransform/> + <RotateTransform Angle="270"/> + <TranslateTransform/> + </TransformGroup> + </Path.RenderTransform> + </Path> + <TextBlock x:Name="Run_Text" Margin="8,0,4,0" Text="Start" VerticalAlignment="Center"/> + </StackPanel> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsChecked" Value="True"> + <Setter Property="Foreground" TargetName="Run_Text" Value="{DynamicResource ToggleButton.Checked.Foreground}"/> + <Setter Property="Fill" TargetName="RunArrow" Value="{DynamicResource ToggleButton.Checked.Foreground}"/> + <Setter Property="Text" TargetName="Run_Text" Value="Continue"/> + <Setter Property="ToggleButton.ToolTip" Value="Continue"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsChecked" Value="False" /> + <Condition Property="IsMouseOver" Value="True" /> + </MultiTrigger.Conditions> + <Setter Property="Fill" TargetName="background" Value="{DynamicResource Toolbar.Button.MaouseMove.Background}"/> + </MultiTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </ToggleButton.Template> + </ToggleButton> + <Button Click="Button_Click" ToolTip="Pause" Visibility="{Binding IsChecked, ElementName=Run_Button, Converter={StaticResource BoolToVis}}" Style="{DynamicResource TangoToolBarButtonStyle}"> + <Image Source="/Tango.Scripting.IDE;component/Images/Pause_16x.png" Height="16" Width="16"/> + </Button> + <Button x:Name="StopButton" ToolTip="Stop" Command="{Binding StopProject}" Visibility="{Binding IsChecked, ElementName=Run_Button, Converter={StaticResource BoolToVis}}" Style="{DynamicResource TangoToolBarButtonStyle}"> + <Image Source="/Tango.Scripting.IDE;component/Images/stop.png" Height="16" Width="16"/> + </Button> + </ToolBar> + </ToolBarTray> + <Grid Grid.Row="2"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="15" /> + <ColumnDefinition Width="1*" MinWidth="100" /> + <ColumnDefinition Width="5"/> + <ColumnDefinition Width="300" MinWidth="20" /> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1"> + <Grid.RowDefinitions> + <RowDefinition Height="1*" MinHeight="100" /> + <RowDefinition Height="5"/> + <RowDefinition Height="100" MinHeight="20" /> + </Grid.RowDefinitions> + + <Grid> + <TabControl Foreground="{DynamicResource ControlForegroundKey}" ItemsSource="{Binding OpenProjectItems}" SelectedItem="{Binding SelectedProjectItem}" Style="{DynamicResource TangoTabControlStyle}"> + <TabControl.ItemTemplate> + <DataTemplate> + <TextBlock Text="{Binding Name}" Foreground="Gainsboro" VerticalAlignment="Center"></TextBlock> + </DataTemplate> + </TabControl.ItemTemplate> + <TabControl.ContentTemplate> + <DataTemplate> + <ContentPresenter Content="{Binding View}" /> + </DataTemplate> + </TabControl.ContentTemplate> + </TabControl> + + </Grid> + + <GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="1" Background="{DynamicResource Background.Static}" /> + <Grid Grid.Row="2" Background="{DynamicResource Background.Static}"> + <!--<Border BorderThickness="0" Margin="1,0,0,2">--> + <TabControl TabStripPlacement="Bottom" Style="{DynamicResource TangoTabControlStyle}"> + <TabItem Header="Error list"> + <GroupBox Header="Error List" BorderThickness="1" Style="{DynamicResource TangoGroupBoxStyle}" Margin="-1"> + <DataGrid Background="{DynamicResource TabItem.Content.Static}" Style="{DynamicResource TangoDataGridStyle}" Padding="2,5,2,0" + ColumnHeaderStyle="{DynamicResource TangoDataGridColumnHeaderStyle}" ItemsSource="{Binding ErrorList}" + CanUserSortColumns="True" CanUserResizeColumns="True" IsReadOnly="True"/> + </GroupBox> + </TabItem> + <TabItem Header="Output"> + <GroupBox Header="Output" BorderThickness="1" Style="{DynamicResource TangoGroupBoxStyle}" Margin="-1"> + <TextBox TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" Name="OutputText" Background="{DynamicResource TabItem.Content.Static}" /> + </GroupBox> + </TabItem> + </TabControl> + <!--</Border>--> + </Grid> + </Grid> + + <GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="2" Background="{DynamicResource Background.Static}" /> + + <Grid Grid.Column="3"> + <Grid.RowDefinitions> + <RowDefinition Height="1*" MinHeight="100"/> + <RowDefinition Height="5"/> + <RowDefinition Height="100" MinHeight="20"/> + <RowDefinition Height="4"/> + </Grid.RowDefinitions> + <GroupBox Grid.Row="0" Margin="0,0,5,0" Header="Solution Explorer" BorderThickness="1" Style="{DynamicResource TangoGroupBoxStyle}" > + <TreeView Style="{DynamicResource TangoTreeViewStyle}" x:Name="SolutionTree" ItemsSource="{Binding Solution.Projects}" Background="{DynamicResource TabItem.Content.Static}" Padding="0,8,0,0" SelectedItemChanged="TreeViewControl_SelectedItemChanged" PreviewMouseRightButtonDown="SolutionTree_PreviewMouseRightButtonDown" > + <TreeView.ItemTemplate> + <HierarchicalDataTemplate ItemsSource="{Binding Path=Items}" DataType="{x:Type local:IProject}"> + <controls:SolutionItemControl SolutionItem="{Binding}" OpenCommand="{Binding ElementName=control,Path=DataContext.OpenProjectItemCommand}" /> + </HierarchicalDataTemplate> + </TreeView.ItemTemplate> + <TreeView.Resources> + <ContextMenu x:Key ="SolutionContext" StaysOpen="true" BorderBrush="{DynamicResource Background.Static}" Foreground="{DynamicResource ControlForegroundKey}"> + <MenuItem Header="Add" > + <MenuItem Header="New Project..." Command="{Binding AddProjectCommand}"/> + </MenuItem> + <MenuItem Header="Rename"/> + </ContextMenu> + <ContextMenu x:Key="FolderContext" StaysOpen="true" > + <MenuItem Header="Rename"/> + <MenuItem Header="Remove"/> + <Separator/> + <MenuItem Header="Copy"/> + <MenuItem Header="Cut"/> + <MenuItem Header="Paste"/> + <MenuItem Header="Move"/> + </ContextMenu> + </TreeView.Resources> + + </TreeView> + </GroupBox> + <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource Background.Static}" /> + <GroupBox Grid.Row="2" Margin="0,0,5,2" Header="Properties" BorderThickness="1" Style="{DynamicResource TangoGroupBoxStyle}" > + <!--<Border BorderThickness="0" Margin="1,0,0,2">--> + <DataGrid Background="{DynamicResource TabItem.Content.Static}" Style="{DynamicResource TangoDataGridStyle}" Padding="2,5,2,0" + ColumnHeaderStyle="{DynamicResource TangoDataGridColumnHeaderStyle}" ItemsSource="{Binding ErrorList}" + CanUserSortColumns="True" CanUserResizeColumns="True" IsReadOnly="True"/> + <!--</Border>--> + </GroupBox> + </Grid> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml.cs new file mode 100644 index 000000000..5e4509beb --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE +{ + + /// <summary> + /// Interaction logic for ScriptIDEView2.xaml + /// </summary> + public partial class ScriptIDEView2 : UserControl + { + public enum eSkin { Dark, Light } + public static eSkin Skin { get; set; } + public ScriptIDEView2() + { + InitializeComponent(); + } + public void ChangeSkin(eSkin newSkin) + { + Skin = newSkin; + Resources.Clear(); + Resources.MergedDictionaries.Clear(); + if (Skin == eSkin.Dark) + ApplyResources("Themes/DarkThemesColors.xaml"); + else if (Skin == eSkin.Light) + ApplyResources("Themes/LightThemesColors.xaml"); + ApplyResources("Themes/Shared.xaml"); + } + + private void ApplyResources(string src) + { + var dict = new ResourceDictionary() { Source = new Uri(src, UriKind.Relative) }; + foreach (var mergeDict in dict.MergedDictionaries) + { + Resources.MergedDictionaries.Add(mergeDict); + } + + foreach (var key in dict.Keys) + { + Resources[key] = dict[key]; + } + } + + private void Button_Click(object sender, RoutedEventArgs e) + { + MessageBox.Show("I am here"); + } + private void TreeViewControl_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) + { + + IProject SelectedItem = SolutionTree.SelectedItem as IProject; + if(SelectedItem != null && DataContext is ScriptIDEViewVM && ((ScriptIDEViewVM)DataContext).IsSolutionProject(SelectedItem)) + { + SolutionTree.ContextMenu = SolutionTree.Resources["SolutionContext"] as System.Windows.Controls.ContextMenu; + } + else + { + SolutionTree.ContextMenu = SolutionTree.Resources["FolderContext"] as System.Windows.Controls.ContextMenu; + } + } + + private void SolutionTree_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) + { + TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject); + + if (treeViewItem != null) + { + //treeViewItem.Focus(); + treeViewItem.IsSelected = true; + e.Handled = true; + } + } + static TreeViewItem VisualUpwardSearch(DependencyObject source) + { + while (source != null && !(source is TreeViewItem)) + source = VisualTreeHelper.GetParent(source); + + return source as TreeViewItem; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs new file mode 100644 index 000000000..b156371c5 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media.Imaging; +using Tango.Core.Commands; +using Tango.Scripting.IDE.Controls; +using Tango.Scripting.IDE.Dialogs; +using Tango.Scripting.IDE.Notifications; +using Tango.Scripting.IDE.Projects; +using Tango.Scripting.IDE.ProjectTypes; +using Tango.SharedUI; + +namespace Tango.Scripting.IDE +{ + public class ScriptIDEViewVM : IDEViewModel + { + private List<IProjectType> _projectTypes; + public ObservableCollection<ErrorData> ErrorList { get; set; } + + #region Properties + + private Solution _solution; + public Solution Solution + { + get { return _solution; } + set { _solution = value; RaisePropertyChangedAuto(); } + } + + private IProject _selectedProject; + public IProject SelectedProject + { + get { return _selectedProject; } + set { _selectedProject = value; RaisePropertyChangedAuto(); } + } + + private IProjectItem _selectedProjectItem; + public IProjectItem SelectedProjectItem + { + get { return _selectedProjectItem; } + set { _selectedProjectItem = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection<IProjectItem> _openProjectItems; + public ObservableCollection<IProjectItem> OpenProjectItems + { + get { return _openProjectItems; } + set { _openProjectItems = value; RaisePropertyChangedAuto(); } + } + private bool _isRunProject = false; + public bool IsRunProject + { + get { return _isRunProject; } + set + { + if (_isRunProject != value) + { + _isRunProject = value; RaisePropertyChangedAuto(); + } + } + } + #endregion + + #region Commands + public RelayCommand NewProjectCommand { get; set; } + public RelayCommand AddProjectCommand { get; set; } + public RelayCommand<IProjectItem> OpenProjectItemCommand { get; set; } + + public RelayCommand<IProjectItem> CloseProjectItemCommand { get; set; } + public RelayCommand RunProject { get; set; } + public RelayCommand StopProject { get; set; } + + #endregion + + #region Constructors + + public ScriptIDEViewVM() : base() + { + _projectTypes = new List<IProjectType>(); + OpenProjectItems = new ObservableCollection<IProjectItem>(); + ErrorList = new ObservableCollection<ErrorData>(); + + RegisterProjectType(new StubProjectType()); + RegisterProjectType(new UnitTestProjectType()); + + Solution = new Solution(); + Solution.SolutionLocation = @"C:\Test"; + Solution.Projects.Add(_projectTypes.First().NewProject("Test Project.stub")); + + //Init Commands + NewProjectCommand = new RelayCommand(AddNewProject); + AddProjectCommand = new RelayCommand(AddProject); + OpenProjectItemCommand = new RelayCommand<IProjectItem>(OpenProjectItem); + CloseProjectItemCommand = new RelayCommand<IProjectItem>(CloseProjectItem); + RunProject = new RelayCommand(RunProjectCommand); + StopProject = new RelayCommand(StopRunProjectCommand); + + NotificationManager = new DefaultNotificationManager(); + } + + private void RunProjectCommand(object obj) + { + // MessageBox.Show("You said: RunProjectCommand"); + } + private void StopRunProjectCommand(object obj) + { + IsRunProject = false; + } + + #endregion + + #region Public Methods + + private void OpenProjectItem(IProjectItem projectItem) + { + if (!OpenProjectItems.Contains(projectItem)) + { + OpenProjectItems.Add(projectItem); + } + + SelectedProjectItem = projectItem; + } + + private void CloseProjectItem(IProjectItem projectItem) + { + OpenProjectItems.Remove(projectItem); + + SelectedProjectItem = OpenProjectItems.FirstOrDefault(); + } + + public void RegisterProjectType(IProjectType projectType) + { + _projectTypes.Add(projectType); + } + + public void UnRegisterProjectItemHandler(IProjectType projectType) + { + _projectTypes.Remove(projectType); + } + /// <summary> + /// Open a dialog to create a new project + /// </summary> + private async void AddNewProject() + { + var vm = await NotificationManager.ShowDialog<NewProjectViewVM>(); + + if (vm.DialogResult) + { + Solution newSolution = new Solution(); + newSolution.Name = vm.SolutionName; + newSolution.SolutionLocation = vm.ProjectLocation; + Solution = newSolution; + StringBuilder builder = new StringBuilder(vm.ProjectLocation); + builder.AppendFormat(@"\{0}", vm.ProjectName); + Solution.Projects.Add(vm.SelectedProjectType.NewProject(builder.ToString())); + } + } + private async void AddProject() + { + var vm = await NotificationManager.ShowDialog<AddProjectViewVM>(new AddProjectViewVM() + { + ProjectLocation = Solution.SolutionLocation + //ProjectLocation = Path.GetDirectoryName(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)) + //ProjectLocation = "Current Solution folder..." + }); + + if (vm.DialogResult) + { + StringBuilder builder = new StringBuilder(vm.ProjectLocation); + builder.AppendFormat(@"\{0}", vm.ProjectName); + Solution.Projects.Add(vm.SelectedProjectType.NewProject(builder.ToString())); + } + } + public bool IsSolutionProject(IProject SelectedItem) + { + if (SelectedItem is StubProject) + return true; + return false; + + } + #endregion + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Solution.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Solution.cs new file mode 100644 index 000000000..cd7806698 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Solution.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.IDE +{ + public class Solution + { + public ObservableCollection<IProject> Projects { get; set; } + public string Name{get; set;} + public string SolutionLocation { get; set; } + + public Solution() + { + Projects = new ObservableCollection<IProject>(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Tango.Scripting.IDE.csproj b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Tango.Scripting.IDE.csproj new file mode 100644 index 000000000..803815df4 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Tango.Scripting.IDE.csproj @@ -0,0 +1,297 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{C9F60285-91FB-4293-BCF5-164D76755CDD}</ProjectGuid> + <OutputType>library</OutputType> + <RootNamespace>Tango.Scripting.IDE</RootNamespace> + <AssemblyName>Tango.Scripting.IDE</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL"> + <HintPath>..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath> + </Reference> + <Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> + <HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath> + </Reference> + <Reference Include="Microsoft.WindowsAPICodePack"> + <HintPath>..\..\..\packages\WindowsAPICodePack-Core.1.1.1\lib\Microsoft.WindowsAPICodePack.dll</HintPath> + </Reference> + <Reference Include="Microsoft.WindowsAPICodePack.Shell"> + <HintPath>..\..\..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath> + </Reference> + <Reference Include="PresentationFramework.Aero2" /> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + </Reference> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> + <Reference Include="Tango.Core, Version=2.0.33.1608, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\Build\Core\Debug\Tango.Core.dll</HintPath> + </Reference> + <Reference Include="Tango.SharedUI"> + <HintPath>..\..\..\Build\Core\Debug\Tango.SharedUI.dll</HintPath> + </Reference> + <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Controls\ErrorData.cs" /> + <Compile Include="Controls\SharedResourceDictionary.cs" /> + <Compile Include="Controls\SolutionItemControl.cs" /> + <Compile Include="Controls\TabConrolClose.cs" /> + <Compile Include="Converters\LeftMarginMultiplierConverter.cs" /> + <Compile Include="Dialogs\NewProjectView.xaml.cs"> + <DependentUpon>NewProjectView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\AddProjectView.xaml.cs"> + <DependentUpon>AddProjectView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\AddProjectViewVM.cs" /> + <Compile Include="Dialogs\BaseProjectDialogVM.cs" /> + <Compile Include="Dialogs\NewProjectViewVM.cs" /> + <Compile Include="IDEDialogViewModel.cs" /> + <Compile Include="IDESettings.cs" /> + <Compile Include="IDEViewModel.cs" /> + <Compile Include="IProjectType.cs" /> + <Compile Include="ISolutionItem.cs" /> + <Compile Include="Notifications\DefaultNotificationManager.cs" /> + <Compile Include="Notifications\INotificationManager.cs" /> + <Compile Include="Notifications\ProgressNotificationHandler.cs" /> + <Compile Include="ProjectItem.cs" /> + <Compile Include="ProjectItemsViews\CSharpScriptItemView.xaml.cs"> + <DependentUpon>CSharpScriptItemView.xaml</DependentUpon> + </Compile> + <Compile Include="ProjectItems\CSharpScriptItem.cs" /> + <Compile Include="ProjectItems\ReferenceAssembliesItem.cs" /> + <Compile Include="ProjectItems\ReferenceAssemblyItem.cs" /> + <Compile Include="Projects\CSharpProject.cs" /> + <Compile Include="IProjectItem.cs" /> + <Compile Include="IProject.cs" /> + <Compile Include="Project.cs" /> + <Compile Include="Projects\UnitTestProject.cs" /> + <Compile Include="ProjectType.cs" /> + <Compile Include="ProjectTypes\StubProjectType.cs" /> + <Compile Include="ProjectTypes\UnitTestProjectType.cs" /> + <Compile Include="ScriptIDEView.xaml.cs"> + <DependentUpon>ScriptIDEView.xaml</DependentUpon> + </Compile> + <Compile Include="ScriptIDEView2.xaml.cs"> + <DependentUpon>ScriptIDEView2.xaml</DependentUpon> + </Compile> + <Compile Include="ScriptIDEViewVM.cs" /> + <Compile Include="Solution.cs" /> + <Compile Include="Projects\StubProject.cs" /> + <Compile Include="ViewModelLocator.cs" /> + <Compile Include="Windows\DialogWindow.xaml.cs"> + <DependentUpon>DialogWindow.xaml</DependentUpon> + </Compile> + <Page Include="Dialogs\NewProjectView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Dialogs\AddProjectView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="ProjectItemsViews\CSharpScriptItemView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resources.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="ScriptIDEView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="ScriptIDEView2.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\ButtonStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\ComboboxStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\DarkThemesColors.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\DataGridStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\Generic.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Themes\LightThemesColors.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\MenuDict.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\ScrollViewerStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\Shared.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\TabConrolStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\ToolbarStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Themes\TreeViewItem.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Windows\DialogWindow.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <None Include="app.config" /> + <None Include="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Tango.Scripting.Editors\Tango.Scripting.Editors.csproj"> + <Project>{6c55b776-26d4-4db3-a6ab-87e783b2f3d1}</Project> + <Name>Tango.Scripting.Editors</Name> + </ProjectReference> + <ProjectReference Include="..\Tango.Scripting\Tango.Scripting.csproj"> + <Project>{1e938fd2-c669-4738-98c9-77f96ce4d451}</Project> + <Name>Tango.Scripting</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\CSharpScriptItem.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\Reference.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\CSharpProject.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\StubProject.png" /> + </ItemGroup> + <ItemGroup /> + <ItemGroup> + <Resource Include="Images\Save_16x.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\NewFileCollection_16x.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\OpenFolder_16x.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\checklist_white_32.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\unitTest_126.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\stub_project_whit_32.png" /> + <Resource Include="Images\stub_project_126.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\test.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\SaveAll_16x.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\Redo_16x.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\Undo_16x.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\unitTest.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\stop.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\stub_project_32.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\redo-arrow-symbol1.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\Pause_16x.png" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ButtonStyle.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ButtonStyle.xaml new file mode 100644 index 000000000..f30adc85d --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ButtonStyle.xaml @@ -0,0 +1,81 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + + <Style x:Key="FocusVisual"> + <Setter Property="Control.Template"> + <Setter.Value> + <ControlTemplate> + <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="TangoButtonStyle" TargetType="{x:Type Button}"> + <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> + <Setter Property="Background" Value="{DynamicResource Button.Static.Background}"/> + <Setter Property="BorderBrush" Value="{DynamicResource Button.Static.Border}"/> + <Setter Property="Foreground" Value="{DynamicResource ControlForegroundKey}"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="HorizontalContentAlignment" Value="Center"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Padding" Value="1"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Button}"> + <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsDefaulted" Value="true"> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource Button.MouseOver.Border}"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource Button.MouseOver.Border}"/> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Background" TargetName="border" Value="{DynamicResource Button.Pressed.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource Button.Pressed.Border}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Background" TargetName="border" Value="{DynamicResource Button.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource Button.Disabled.Border}"/> + <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource Button.Disabled.Foreground}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="TangoToolBarButtonStyle" TargetType="{x:Type Button}"> + <Setter Property="Width" Value="26"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Button}"> + <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> + <Grid> + <Rectangle x:Name="background" Fill="Transparent" Opacity="1"/> + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsDefaulted" Value="true"> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Fill" TargetName="background" Value="{DynamicResource Toolbar.Button.MaouseMove.Background}"/> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Fill" TargetName="background" Value="{DynamicResource ControlBrushColorKey}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Background" TargetName="border" Value="{DynamicResource Button.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource Button.Disabled.Border}"/> + <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource Button.Disabled.Foreground}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ComboboxStyle.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ComboboxStyle.xaml new file mode 100644 index 000000000..503f8c20c --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ComboboxStyle.xaml @@ -0,0 +1,200 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + <Style x:Key="ToolBarComboBoxTransparentButtonStyle" TargetType="{x:Type ToggleButton}"> + <Setter Property="MinWidth" Value="0"/> + <Setter Property="MinHeight" Value="0"/> + <Setter Property="Width" Value="Auto"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Focusable" Value="false"/> + <Setter Property="ClickMode" Value="Press"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Grid Background="Transparent"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + <ColumnDefinition SharedSizeGroup="ComboBoxButton" Width="Auto"/> + </Grid.ColumnDefinitions> + <Border x:Name="Chrome" Width="13" SnapsToDevicePixels="true" Grid.Column="1" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"> + <Path x:Name="ArrowDownPath" VerticalAlignment="Center" Fill="{DynamicResource ControlForegroundKey}" Data="M 2.5 0 L 8.5 0 L 5.5 3 Z"/> + </Border> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="BorderBrush" TargetName="Chrome" Value="{x:Null}"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsMouseOver" Value="true"/> + <Condition Property="IsChecked" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Chrome" Value="Transparent"/> + <Setter Property="Fill" TargetName="ArrowDownPath" Value="{DynamicResource ToolBarButtonPressedBorder}"/> + + </MultiTrigger> + <Trigger Property="IsChecked" Value="true"> + <Setter Property="BorderBrush" TargetName="Chrome" Value="{DynamicResource ToolBarButtonPressedBorder}"/> + <Setter Property="Background" TargetName="Chrome" Value="{DynamicResource ToolBarButtonPressedBorder}"/> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Background" TargetName="Chrome" Value="{DynamicResource ToolBarButtonPressed}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Fill" TargetName="ArrowDownPath" Value="{DynamicResource ToolBarDisabledBorder}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}"> + <Setter Property="OverridesDefaultStyle" Value="true"/> + <Setter Property="AllowDrop" Value="true"/> + <Setter Property="MinWidth" Value="0"/> + <Setter Property="MinHeight" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/> + <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type TextBox}"> + <ScrollViewer x:Name="PART_ContentHost" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" Focusable="false" Background="Transparent"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="TangoComboboxStyle" TargetType="{x:Type ComboBox}"> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="Foreground" Value="{DynamicResource ControlForegroundKey}"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderBrush" Value="{DynamicResource Inactive.Selection}"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="Margin" Value="1,0"/> + <Setter Property="Padding" Value="0"/> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> + <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> + <Setter Property="ScrollViewer.PanningMode" Value="Both"/> + <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="VerticalAlignment" Value="Center"/> + <Setter Property="MinHeight" Value="18"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ComboBox}"> + <Grid SnapsToDevicePixels="true"> + <Grid Grid.IsSharedSizeScope="true"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + <ColumnDefinition SharedSizeGroup="ComboBoxButton" Width="Auto"/> + </Grid.ColumnDefinitions> + <Border x:Name="Background" Background="{TemplateBinding Background}"/> + <Border x:Name="SelectedContentBorder" Margin="2,2,1,2"> + <ContentPresenter x:Name="ContentSite" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Content="{TemplateBinding SelectionBoxItem}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/> + </Border> + <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2"/> + <ToggleButton x:Name="DropDownButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ToolBarComboBoxTransparentButtonStyle}"/> + <TextBox x:Name="PART_EditableTextBox" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="1,1,0,1" MinHeight="18" Padding="{TemplateBinding Padding}" Style="{StaticResource ComboBoxEditableTextBox}" Visibility="Collapsed" VerticalAlignment="Center"/> + </Grid> + <Popup x:Name="PART_Popup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom"> + <Border x:Name="DropDownBorder" BorderBrush="{DynamicResource ComboboxDropDownBorder}" BorderThickness="1" Background="{DynamicResource ComboboxDropDownBackground}" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Margin="2,0,0,0"> + <ScrollViewer x:Name="DropDownScrollViewer"> + <Grid RenderOptions.ClearTypeHint="Enabled"> + <Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> + <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/> + </Canvas> + <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained"/> + </Grid> + </ScrollViewer> + </Border> + </Popup> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/> + <Setter Property="Background" TargetName="Background" Value="{DynamicResource ToolBarDisabledFill}"/> + <Setter Property="Grid.ColumnSpan" TargetName="Background" Value="2"/> + <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ToolBarDisabledBorder}"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsKeyboardFocusWithin" Value="true"/> + <Condition Property="IsDropDownOpen" Value="false"/> + <Condition Property="IsEditable" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="SelectedContentBorder" Value="{DynamicResource ListBorder}"/> + <Setter Property="Foreground" Value="{DynamicResource ControlForegroundKey}"/> + </MultiTrigger> + <Trigger Property="IsEditable" Value="true"> + <Setter Property="Background" TargetName="DropDownButton" Value="{x:Null}"/> + <Setter Property="Visibility" TargetName="ContentSite" Value="Collapsed"/> + <Setter Property="Visibility" TargetName="PART_EditableTextBox" Value="Visible"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="BorderBrush" TargetName="DropDownButton" Value="{DynamicResource ToolBarButtonHoverBorder}"/> + <Setter Property="Background" TargetName="DropDownButton" Value="{DynamicResource DropDownButtonHover}"/> + <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ToolBarButtonHoverBorder}"/> + </Trigger> + <Trigger Property="IsKeyboardFocusWithin" Value="true"> + <Setter Property="BorderBrush" TargetName="DropDownButton" Value="{DynamicResource ToolBarButtonHoverBorder}"/> + <Setter Property="Background" TargetName="DropDownButton" Value="{DynamicResource DropDownButtonHover}"/> + <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ToolBarButtonHoverBorder}"/> + </Trigger> + <Trigger Property="HasItems" Value="false"> + <Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsGrouping" Value="true"/> + <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsKeyboardFocusWithin" Value="true"/> + <Condition Property="IsDropDownOpen" Value="false"/> + <Condition Property="IsEditable" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Foreground" Value="{DynamicResource ControlForegroundKey}"/> + </MultiTrigger> + <Trigger Property="IsEditable" Value="true"> + <Setter Property="Padding" Value="2"/> + <Setter Property="IsTabStop" Value="false"/> + </Trigger> + <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false"> + <Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/> + <Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Resources> + <Style TargetType="{x:Type ComboBoxItem}"> + <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" /> + <Setter Property="Control.Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ComboBoxItem}"> + <Border x:Name="ItemBorder" Background="{DynamicResource ComboboxItemBackground}" BorderBrush="Transparent" BorderThickness="1"> + <ContentPresenter /> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Background" TargetName="ItemBorder" Value="{DynamicResource ComboboxItemMouseOverBackground}"/> + </Trigger> + + <Trigger Property="IsKeyboardFocusWithin" Value="true"> + <Setter Property="Background" TargetName="ItemBorder" Value="{DynamicResource ComboboxItemMouseOverBackground}"/> + </Trigger> + + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Style.Resources> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/DarkThemesColors.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/DarkThemesColors.xaml new file mode 100644 index 000000000..caab88ef1 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/DarkThemesColors.xaml @@ -0,0 +1,100 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + + <SolidColorBrush x:Key="Menu.Background" Color="#FF2D2D30"/> + <SolidColorBrush x:Key="Menu.Foreground" Color="#FFF1F1F1"/> + <SolidColorBrush x:Key="Menu.MouseOverColor" Color="#FF464646"/> + <SolidColorBrush x:Key="Menu.Disable.Foreground" Color="#FF888888"/> + <SolidColorBrush x:Key="Menu.Submenu.Background" Color="#FF1B1B1C"/> + <SolidColorBrush x:Key="Menu.Submenu.MouseOverColor" Color="#FF3E3E40"/> + <SolidColorBrush x:Key="Grip.Submenu.Background.Static" Color="#FF3F3F46"/> + <SolidColorBrush x:Key="Grip.Submenu.Background.Selected" Color="#FF007ACC"/> + + <SolidColorBrush x:Key="Window.Background" Color="#FF1F1F20"/> + <SolidColorBrush x:Key="Control.Border.Static" Color="#FF555555"/> + <SolidColorBrush x:Key="Background.Static" Color="#FF2D2D30"/> + + <SolidColorBrush x:Key="ControlTextBrush" Color="#FFF0F0F0"/> + <SolidColorBrush x:Key="ControlBrushColorKey" Color="#FF007ACC"/> + <SolidColorBrush x:Key="ControlForegroundKey" Color="#FFF1F1F1"/> + <SolidColorBrush x:Key="HighlightTextBrushKey" Color="#FFF0F0F0"/> + <SolidColorBrush x:Key="ListBorder" Color="#FF3F3F46"/> + <SolidColorBrush x:Key="Inactive.Selection" Color="#FF444444"/> + <SolidColorBrush x:Key="ContextMenu.MouseOverColor" Color="#FF333334"/> + + + <SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FF007ACC"/> + <SolidColorBrush x:Key="TabItem.Selected.Border" Color="#FF007ACC"/> + <SolidColorBrush x:Key="TabItem.MouseOver.Border" Color="#FF007ACC"/> + <SolidColorBrush x:Key="TabItem.MouseOver.Background" Color="#FF007ACC"/> + <SolidColorBrush x:Key="TabItem.Disabled.Border" Color="#FF444444"/> + <SolidColorBrush x:Key="TabItem.Content.Static" Color="#FF1E1E1E"/> + <SolidColorBrush x:Key="TabItem.Static.Background" Color="Transparent" /> + <SolidColorBrush x:Key="TabItem.Static.Border" Color="Transparent"/> + <SolidColorBrush x:Key="TabItem.Disabled.Background" Color="#FF444444"/> + <SolidColorBrush x:Key="TabItem.MouseOver.Bottom.Background" Color="#19FFFFFF"/> + + <SolidColorBrush x:Key="ToolBarHorizontalBackground" Color="#FF2D2D30"/> + <SolidColorBrush x:Key="ToolBarToggleButtonVerticalBackground" Color="#FF2D2D30"/> + <SolidColorBrush x:Key="ToolBarButtonHover" Color="#42595959"/> + <SolidColorBrush x:Key="ToolBarGripper" Color="#FF3F3F46"/> + <SolidColorBrush x:Key="ToolBarVerticalBackground" Color="#FF2D2D30"/> + <SolidColorBrush x:Key="ToolBarToggleButtonHorizontalBackground" Color="#FF2D2D30"/> + <SolidColorBrush x:Key="ToolBarMenuBorder" Color="#FF2D2D30"/> + <SolidColorBrush x:Key="ToolBarSubMenuBackground" Color="#FF2D2D30"/> + + <SolidColorBrush x:Key="TreeBackgroundColor" Color="#FF252526"/> + <SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Fill" Color="#FFF0F0F0"/> + <SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Stroke" Color="#FFF0F0F0"/> + <SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Stroke" Color="#FF007ACC"/> + <SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Fill" Color="#FF007ACC"/> + <SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Stroke" Color="#FF007ACC"/> + <SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Fill" Color="#FF007ACC"/> + <SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Fill" Color="#FFF0F0F0"/> + <SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Stroke" Color="#FFF0F0F0"/> + + <SolidColorBrush x:Key="ToolBarDisabledFill" Color="#FF444444"/> + <SolidColorBrush x:Key="ToolBarDisabledBorder" Color="#FF2D2D2E"/> + <SolidColorBrush x:Key="ToolBarButtonHoverBorder" Color="#FF007ACC"/> + <SolidColorBrush x:Key="ToolBarButtonPressedBorder" Color="#FF007ACC"/> + <SolidColorBrush x:Key="ToolBarButtonPressed" Color="Transparent"/> + <SolidColorBrush x:Key="DropDownButtonHover" Color="#FF1F1F20"/> + <SolidColorBrush x:Key="ComboboxDropDownBorder" Color="#FF444444"/> + <SolidColorBrush x:Key="ComboboxDropDownBackground" Color="#FF1F1F20"/> + <SolidColorBrush x:Key="ComboboxItemBackground" Color="#FF1F1F20"/> + <SolidColorBrush x:Key="ComboboxItemMouseOverBackground" Color="#FF3F3F46"/> + + <SolidColorBrush x:Key="DataGrid.MouseOver" Color="#FF3E3E40"/> + <SolidColorBrush x:Key="DataGrid.Border" Color="#FF3E3E40"/> + <SolidColorBrush x:Key="DataGrid.Row.Selection" Color="#FF007ACC"/> + + <SolidColorBrush x:Key="ScrollBar.Static.Background" Color="#FF3E3E42"/> + <SolidColorBrush x:Key="ScrollBar.Static.Border" Color="#FF3E3E42"/> + <SolidColorBrush x:Key="ScrollBar.Pressed.Glyph" Color="#FF1C97EA"/> + <SolidColorBrush x:Key="ScrollBar.MouseOver.Glyph" Color="#FF1C97EA"/> + <SolidColorBrush x:Key="ScrollBar.Disabled.Glyph" Color="#FF636363"/> + <SolidColorBrush x:Key="ScrollBar.Static.Glyph" Color="#FF9E9E9E"/> + <SolidColorBrush x:Key="ScrollBar.MouseOver.Background" Color="Transparent"/> + <SolidColorBrush x:Key="ScrollBar.MouseOver.Border" Color="Transparent"/> + <SolidColorBrush x:Key="ScrollBar.Pressed.Background" Color="Transparent"/> + <SolidColorBrush x:Key="ScrollBar.Pressed.Border" Color="Transparent"/> + <SolidColorBrush x:Key="ScrollBar.Disabled.Background" Color="#FF646464"/> + <SolidColorBrush x:Key="ScrollBar.Disabled.Border" Color="#F0F0F0"/> + <SolidColorBrush x:Key="ScrollBar.MouseOver.Thumb" Color="#FF7F7F7F"/> + <SolidColorBrush x:Key="ScrollBar.Pressed.Thumb" Color="#FF999999"/> + <SolidColorBrush x:Key="ScrollBar.Static.Thumb" Color="#FF555555"/> + + <SolidColorBrush x:Key="Button.Static.Background" Color="#FF3F3F46"/> + <SolidColorBrush x:Key="Button.Static.Border" Color="#FF555555"/> + <SolidColorBrush x:Key="Button.MouseOver.Background" Color="Transparent"/> + <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF0097FB"/> + <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FF007ACC"/> + <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF007ACC"/> + <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FF252526"/> + <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FF434346"/> + <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF434346"/> + <SolidColorBrush x:Key="Toolbar.Button.MaouseMove.Background" Color="#FF3E3E40"/> + <SolidColorBrush x:Key="ToggleButton.Checked.Foreground" Color="#FF4E4E50"/> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/DataGridStyle.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/DataGridStyle.xaml new file mode 100644 index 000000000..5ec4c7ff4 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/DataGridStyle.xaml @@ -0,0 +1,248 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + <Style x:Key="TangoDataGridStyle" TargetType="{x:Type DataGrid}"> + <Setter Property="Background" Value="{DynamicResource Menu.Background}"/> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + <Setter Property="BorderBrush" Value="{DynamicResource DataGrid.Border}"/> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected"/> + <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> + <Setter Property="ScrollViewer.PanningMode" Value="Both"/> + <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> + <Setter Property="GridLinesVisibility" Value="None"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type DataGrid}"> + <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True"> + <ScrollViewer x:Name="DG_ScrollViewer" Focusable="false"> + <ScrollViewer.Template> + <ControlTemplate TargetType="{x:Type ScrollViewer}"> + <Grid > + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <!--<Button Background="Transparent" Command="{x:Static DataGrid.SelectAllCommand}" Focusable="false" Style="{DynamicResource {ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}}" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>--> + <DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/> + <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="2" Grid.Row="1"/> + <ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/> + <Grid Grid.Column="1" Grid.Row="2"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + <ScrollBar x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/> + </Grid> + </Grid> + </ControlTemplate> + </ScrollViewer.Template> + <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + </ScrollViewer> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsGrouping" Value="true"/> + <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> + </MultiTrigger> + </Style.Triggers> + <Style.Resources> + <Style TargetType="{x:Type DataGridRow}"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderBrush" Value="Transparent"/> + <Setter Property="BorderThickness" Value="0,0,0,0" /> + <Setter Property="SnapsToDevicePixels" Value="true"/> + <Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/> + <Setter Property="ValidationErrorTemplate"> + <Setter.Value> + <ControlTemplate> + <TextBlock Foreground="Red" Margin="2,0,0,0" Text="!" VerticalAlignment="Center"/> + </ControlTemplate> + </Setter.Value> + </Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type DataGridRow}"> + <Border x:Name="DGR_Border" BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="0" Background="{TemplateBinding Background}" + SnapsToDevicePixels="True"> + <SelectiveScrollingGrid> + <SelectiveScrollingGrid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </SelectiveScrollingGrid.ColumnDefinitions> + <SelectiveScrollingGrid.RowDefinitions> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + </SelectiveScrollingGrid.RowDefinitions> + <DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + <DataGridDetailsPresenter Grid.Column="1" Grid.Row="1" SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Visibility="{TemplateBinding DetailsVisibility}"/> + <!--<DataGridRowHeader Grid.RowSpan="2" SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>--> + </SelectiveScrollingGrid> + </Border> + <ControlTemplate.Triggers> + + <Trigger Property="IsMouseOver" Value="True"> + <Setter TargetName="DGR_Border" Property="Background" Value="{DynamicResource DataGrid.Row.Selection}" /> + </Trigger> + <Trigger Property="IsSelected" Value="True"> + <Setter TargetName="DGR_Border" Property="BorderBrush" Value="{DynamicResource DataGrid.Row.Selection}" /> + <Setter TargetName="DGR_Border" Property="Background" Value="{DynamicResource DataGrid.Row.Selection}" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="IsNewItem" Value="True"> + <Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/> + </Trigger> + </Style.Triggers> + </Style> + <Style TargetType="{x:Type DataGridCell}"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderBrush" Value="Transparent"/> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type DataGridCell}"> + <!--<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="Transparent" SnapsToDevicePixels="True">--> + <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + <!--</Border>--> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="Background" Value="Blue"/> + <Setter Property="BorderBrush" Value="{DynamicResource DataGrid.MouseOver}"/> + </Trigger> + <Trigger Property="IsKeyboardFocusWithin" Value="True"> + <Setter Property="BorderBrush" Value="{DynamicResource DataGrid.MouseOver}"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsSelected" Value="true"/> + <Condition Property="Selector.IsSelectionActive" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Background" Value="{DynamicResource DataGrid.MouseOver}"/> + <Setter Property="BorderBrush" Value="{DynamicResource DataGrid.MouseOver}"/> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + </MultiTrigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + </Trigger> + </Style.Triggers> + </Style> + <Style TargetType="{x:Type TextBlock}" > + <Setter Property="TextTrimming" Value="CharacterEllipsis"/> + <Setter Property="TextWrapping" Value="NoWrap"/> + <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text }" /> + </Style> + </Style.Resources> + </Style> + <Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}"> + <Setter Property="Width" Value="8"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Cursor" Value="SizeWE"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Thumb}"> + <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="TangoDataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}"> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <TextBlock TextTrimming="CharacterEllipsis" Text="{Binding}" TextAlignment="Right" TextWrapping="NoWrap"/> + </DataTemplate> + </Setter.Value> + </Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type DataGridColumnHeader}"> + <Grid> + <Themes:DataGridHeaderBorder x:Name="hBorder" BorderBrush="{DynamicResource DataGrid.Border}" + BorderThickness="0,1,1,1" + Background="Transparent" + IsClickable="{TemplateBinding CanUserSort}" + IsPressed="{TemplateBinding IsPressed}" + IsHovered="{TemplateBinding IsMouseOver}" + Padding="{TemplateBinding Padding}" + SortDirection="{TemplateBinding SortDirection}" + SeparatorBrush="{TemplateBinding SeparatorBrush}" + SeparatorVisibility="{TemplateBinding SeparatorVisibility}"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + <ContentPresenter Grid.Column="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="6,2,4,2"/> + <Path x:Name="SortArrow" + Grid.Column="1" + HorizontalAlignment="Right" VerticalAlignment="Center" + Width="8" Height="6" Margin="2,0,5,0" + Stretch="Fill" Opacity="0.5" Fill="{DynamicResource ControlTextBrush}" + RenderTransformOrigin="0.5,0.4" + Visibility="Collapsed" + Data="M0,0 L1,0 0.5,1 z" /> + </Grid> + </Themes:DataGridHeaderBorder> + <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}"/> + <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}"/> + </Grid> + + <ControlTemplate.Triggers> + <Trigger Property="SortDirection" Value="Ascending"> + <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" /> + <Setter TargetName="SortArrow" Property="RenderTransform"> + <Setter.Value> + <RotateTransform Angle="180" /> + </Setter.Value> + </Setter> + </Trigger> + <Trigger Property="SortDirection" Value="Descending"> + <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" /> + </Trigger> + + <Trigger Property='IsMouseOver' Value='True'> + <Setter TargetName="hBorder" Property="Background" Value="{DynamicResource DataGrid.MouseOver}"></Setter> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + + </Style> + + <Style x:Key="RowHeaderGripperStyle" TargetType="{x:Type Thumb}"> + <Setter Property="Height" Value="8"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Cursor" Value="SizeNS"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Thumb}"> + <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/Generic.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/Generic.xaml new file mode 100644 index 000000000..6c016ae84 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/Generic.xaml @@ -0,0 +1,36 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:controls="clr-namespace:Tango.Scripting.IDE.Controls" + xmlns:local="clr-namespace:Tango.Scripting.IDE"> + + <Style TargetType="{x:Type controls:SolutionItemControl}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type controls:SolutionItemControl}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + <StackPanel Orientation="Horizontal" Background="Transparent"> + <Image VerticalAlignment="Center" Width="16" Height="16" Source="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=SolutionItem.Image}" /> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=SolutionItem.Name}"></TextBlock> + </StackPanel> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type controls:TabConrolClose}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type controls:TabConrolClose}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/LightThemesColors.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/LightThemesColors.xaml new file mode 100644 index 000000000..da65cc9b7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/LightThemesColors.xaml @@ -0,0 +1,15 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + + + <SolidColorBrush x:Key="Menu.Background" Color="#FF2D2D30"/> + <SolidColorBrush x:Key="Menu.Foreground" Color="#FFF1F1F1"/> + <SolidColorBrush x:Key="Menu.MouseOverColor" Color="#FF333334"/> + <SolidColorBrush x:Key="Menu.Disable.Foreground" Color="#FF888888"/> + <SolidColorBrush x:Key="Menu.Submenu.Background" Color="#FF1B1B1C"/> + <SolidColorBrush x:Key="Menu.Submenu.MouseOverColor" Color="#FF3E3E40"/> + <SolidColorBrush x:Key="Grip.Submenu.Background.Static" Color="#FF3F3F46"/> + <SolidColorBrush x:Key="Grip.Submenu.Background.Selected" Color="#FF007ACC"/> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/MenuDict.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/MenuDict.xaml new file mode 100644 index 000000000..f51a50b50 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/MenuDict.xaml @@ -0,0 +1,229 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + + + <Style x:Key="TangoMenuStyle" TargetType="{x:Type Menu}"> + <Setter Property="OverridesDefaultStyle" Value="True" /> + <Setter Property="Background" Value="{DynamicResource Menu.Background}"/> + <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/> + <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}"/> + <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/> + <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/> + <Setter Property="Foreground" Value="{DynamicResource Menu.Foreground}"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Menu}"> + <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> + <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Resources> + <Style TargetType="{x:Type MenuItem}"> + <Setter Property="OverridesDefaultStyle" Value="True" /> + <Style.Triggers> + <Trigger Property="Role" Value="TopLevelHeader"> + <Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.TopLevelHeaderTemplateKey}}" /> + <Setter Property="Grid.IsSharedSizeScope" Value="true" /> + </Trigger> + <Trigger Property="Role" Value="TopLevelItem"> + <Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.TopLevelItemTemplateKey}}" /> + </Trigger> + <Trigger Property="Role" Value="SubmenuHeader"> + <Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}" /> + </Trigger> + <Trigger Property="Role" Value="SubmenuItem"> + <Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.SubmenuItemTemplateKey}}" /> + </Trigger> + </Style.Triggers> + </Style> + <Style TargetType="TextBlock"> + <Setter Property="TextWrapping" Value="Wrap"></Setter> + </Style> + </Style.Resources> + </Style> + <Geometry x:Key="Checkmark">M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z</Geometry> + <!-- TopLevelHeader --> + <ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}"> + <Grid x:Name="Border" Background="Transparent" Margin="0,2,0,2"> + + <Rectangle x:Name="Bg" Fill="Transparent" /> + <Rectangle x:Name="Inner_Border" Margin="4" Fill="Transparent"/> + <ContentPresenter Margin="8,2,8,2" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + <Popup x:Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" HorizontalOffset="2"> + <Border x:Name="SubmenuBorder" BorderBrush="{DynamicResource MenuItemHighlightedBackground}" BorderThickness="1" Background="{DynamicResource Menu.Background}" Padding="2" Margin="0,0,8,8"> + <Border.Effect> + <DropShadowEffect BlurRadius="6" Opacity="0.5" ShadowDepth="4" Direction="330"/> + </Border.Effect> + <Grid RenderOptions.ClearTypeHint="Enabled" Background="Transparent"> + <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/> + </Grid> + </Border> + </Popup> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsSuspendingPopupAnimation" Value="true"> + <Setter TargetName="Popup" Property="PopupAnimation" Value="None" /> + </Trigger> + <Trigger Property="IsHighlighted" Value="true"> + <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/> + </Trigger> + <Trigger SourceName="Popup" Property="AllowsTransparency" Value="True"> + <Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="0,0,0,0" /> + <Setter TargetName="SubmenuBorder" Property="Padding" Value="0,0,0,3" /> + </Trigger> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/> + </Trigger> + <Trigger Property="IsSubmenuOpen" Value="true"> + <Setter Property="Background" TargetName="Border" Value="{DynamicResource Menu.Submenu.Background}"/> + <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.Background}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + + <!-- TopLevelItem --> + <ControlTemplate x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" TargetType="{x:Type MenuItem}" > + <Grid SnapsToDevicePixels="true" Background="Transparent" Margin="0,2,0,2"> + <Rectangle x:Name="Bg" Fill="Transparent" /> + <Rectangle x:Name="InnerBorder" Margin="4" Fill="Transparent"/> + <!--<DockPanel> + <ContentPresenter x:Name="Icon" ContentSource="Icon" Margin="4,0,6,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/> + <Path x:Name="GlyphPanel" Data="{StaticResource Checkmark}" Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="7,0,0,0" Visibility="Collapsed" VerticalAlignment="Center"/>--> + <ContentPresenter ContentSource="Header" Margin="8,2,8,2" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + <!--</DockPanel>--> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsHighlighted" Value="true"> + <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/> + </Trigger> + <Trigger Property="IsKeyboardFocused" Value="true"> + <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + <ControlTemplate x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" TargetType="MenuItem"> + <Grid SnapsToDevicePixels="true" Background="{DynamicResource Menu.Submenu.Background}" x:Name="_grid" MinHeight="22"> + <Rectangle x:Name="Bg" Fill="Transparent" /> + <Rectangle x:Name="Inner_Border" Margin="4" Fill="Transparent"/> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition SharedSizeGroup="Icon" Width="Auto" MinWidth="20"/> + <ColumnDefinition Width="*" MinWidth="60"/> + <ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto" MinWidth="60"/> + <ColumnDefinition Width="13" /> + </Grid.ColumnDefinitions> + <ContentPresenter x:Name="Iconh" ContentSource="Icon" Margin="3" VerticalAlignment="Center" Grid.Column="0"/> + <ContentPresenter x:Name="HeaderHost" Margin="3,0,3,0" Grid.Column="1" VerticalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" TextOptions.TextFormattingMode="Display" /> + <TextBlock Grid.Column="2" Margin="10,0,0,0" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center"/> + <Path x:Name="RightArrow" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 0 7 L 4 3.5 Z" Fill="{DynamicResource Grip.Submenu.Background.Static}" Margin="8,0,0,0"/> + <Popup x:Name="popup" PlacementTarget="{Binding ElementName=_grid}" Placement="Right" HorizontalOffset="0" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade"> + <Border x:Name="SubmenuBorder" SnapsToDevicePixels="True" Background="{DynamicResource Menu.Submenu.Background}" BorderThickness="1" BorderBrush="{DynamicResource MenuItemHighlightedBackground}" Margin="0,0,10,10"> + <Border.Effect> + <DropShadowEffect BlurRadius="6" Opacity="0.5" ShadowDepth="4" Direction="330" /> + </Border.Effect> + <ItemsPresenter x:Name="_items" /> + </Border> + </Popup> + </Grid> + </Grid> + <!--</Border>--> + <ControlTemplate.Triggers> + <Trigger Property="IsHighlighted" Value="True" > + <Setter Property="Visibility" Value="Visible" TargetName="_items" /> + <Setter Property="IsOpen" Value="True" TargetName="popup" /> + <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/> + <Setter Property="Fill" TargetName="Inner_Border" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/> + <Setter TargetName="RightArrow" Property="Fill" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + + </Trigger> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/> + </Trigger> + <Trigger Property="IsSubmenuOpen" Value="true"> + <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/> + <Setter Property="Fill" TargetName="Inner_Border" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + <ControlTemplate x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" TargetType="MenuItem"> + <Grid SnapsToDevicePixels="true" Background="{DynamicResource Menu.Submenu.Background}" MinHeight="22"> + <Rectangle x:Name="Bg" Fill="Transparent" /> + <Rectangle x:Name="InnerBorder" Margin="4"/> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" MinWidth="24" SharedSizeGroup="IconGroup"/> + <ColumnDefinition Width="Auto" MinWidth="60" /> + <ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto" MinWidth="60"/> + <ColumnDefinition Width="20" /> + </Grid.ColumnDefinitions> + <ContentPresenter x:Name="Icon" ContentSource="Icon" Margin="{TemplateBinding Padding}" /> + <ContentPresenter Grid.Column="1" VerticalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + <TextBlock Grid.Column="2" Margin="10,0,0,0" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center"/> + </Grid> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsHighlighted" Value="True"> + <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/> + </Trigger> + <Trigger Property="Icon" Value="{x:Null}"> + <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + + <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}"> + <Setter Property="Height" Value="1" /> + <Setter Property="Margin" Value="20,0,2,0" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Separator}"> + <Border BorderThickness="1" BorderBrush="{DynamicResource Submenu.MouseOverColor}" /> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type ContextMenu}"> + <Setter Property="SnapsToDevicePixels" Value="True" /> + <Setter Property="OverridesDefaultStyle" Value="True" /> + <Setter Property="Grid.IsSharedSizeScope" Value="true" /> + <Setter Property="HasDropShadow" Value="True" /> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ContextMenu}"> + <Border x:Name="Border" Background="{DynamicResource Background.Static}" BorderThickness="1" BorderBrush="{DynamicResource Inactive.Selection}"> + <Border.Effect> + <DropShadowEffect Color="Black" Direction="135" Opacity="0.8" ShadowDepth="2"/> + </Border.Effect> + <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="true"> + <Setter TargetName="Border" Property="Background" Value="{DynamicResource Menu.Submenu.Background}" /> + <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ContextMenu.MouseOverColor}" /> + </Trigger> + <Trigger Property="HasDropShadow" Value="true"> + <Setter TargetName="Border" Property="Padding" Value="0,3,0,3" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Resources> + <Style TargetType="{x:Type MenuItem}"> + <Setter Property="Background" Value="{DynamicResource Menu.Submenu.Background}"></Setter> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"></Setter> + <Setter Property="Margin" Value="1,0,1,0"></Setter> + </Style> + </Style.Resources> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ScrollViewerStyle.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ScrollViewerStyle.xaml new file mode 100644 index 000000000..56c047424 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ScrollViewerStyle.xaml @@ -0,0 +1,258 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + + <ControlTemplate x:Key="ScrollViewerControlTemplate1" TargetType="{x:Type ScrollViewer}"> + <Grid x:Name="Grid" Background="{DynamicResource ScrollBar.Static.Background}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Rectangle x:Name="Corner" Grid.Column="1" Fill="{DynamicResource ScrollBar.Static.Background}" Grid.Row="1"/> + <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/> + <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/> + <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/> + </Grid> + </ControlTemplate> + <Style x:Key="FocusVisual"> + <Setter Property="Control.Template"> + <Setter.Value> + <ControlTemplate> + <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}"> + <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="HorizontalContentAlignment" Value="Center"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Padding" Value="1"/> + <Setter Property="Focusable" Value="false"/> + <Setter Property="IsTabStop" Value="false"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type RepeatButton}"> + <Border x:Name="border" BorderBrush="Transparent" BorderThickness="0" Background="{DynamicResource ScrollBar.Static.Background}" SnapsToDevicePixels="true"> + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/> + <!--<Setter Property="Background" TargetName="border" Value="{StaticResource ScrollBar.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollBar.Disabled.Border}"/>--> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="RepeatButtonTransparent" TargetType="{x:Type RepeatButton}"> + <Setter Property="OverridesDefaultStyle" Value="true"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Focusable" Value="false"/> + <Setter Property="IsTabStop" Value="false"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type RepeatButton}"> + <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ScrollBarThumbVertical" TargetType="{x:Type Thumb}"> + <Setter Property="OverridesDefaultStyle" Value="true"/> + <Setter Property="IsTabStop" Value="false"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Thumb}"> + <Rectangle x:Name="rectangle" Fill="{DynamicResource ScrollBar.Static.Thumb}" Height="{TemplateBinding Height}" SnapsToDevicePixels="True" Width="{TemplateBinding Width}" Margin="4,0,4,0"/> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Fill" TargetName="rectangle" Value="{DynamicResource ScrollBar.MouseOver.Thumb}"/> + </Trigger> + <Trigger Property="IsDragging" Value="true"> + <Setter Property="Fill" TargetName="rectangle" Value="{DynamicResource ScrollBar.Pressed.Thumb}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ScrollBarThumbHorizontal" TargetType="{x:Type Thumb}"> + <Setter Property="OverridesDefaultStyle" Value="true"/> + <Setter Property="IsTabStop" Value="false"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Thumb}" > + <Rectangle x:Name="rectangle" Fill="{DynamicResource ScrollBar.Static.Thumb}" Height="{TemplateBinding Height}" + SnapsToDevicePixels="True" Width="{TemplateBinding Width}" Margin="0,4,0,4"/> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Fill" TargetName="rectangle" Value="{DynamicResource ScrollBar.MouseOver.Thumb}"/> + </Trigger> + <Trigger Property="IsDragging" Value="true"> + <Setter Property="Fill" TargetName="rectangle" Value="{DynamicResource ScrollBar.Pressed.Thumb}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style TargetType="{x:Type ScrollBar}"> + <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/> + <Setter Property="Stylus.IsFlicksEnabled" Value="false"/> + <Setter Property="Background" Value="{DynamicResource ScrollBar.Static.Background}"/> + <Setter Property="BorderBrush" Value="{DynamicResource ScrollBar.Static.Border}"/> + <Setter Property="Foreground" Value="{DynamicResource ControlForegroundKey}"/> + <Setter Property="BorderThickness" Value="1,0"/> + <Setter Property="Width" Value="18"/> + <Setter Property="MinWidth" Value="18"/> + <Setter Property="OverridesDefaultStyle" Value="True"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ScrollBar}"> + <Grid x:Name="Bg" SnapsToDevicePixels="true"> + <Grid.RowDefinitions> + <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/> + <RowDefinition Height="0.00001*"/> + <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/> + </Grid.RowDefinitions> + <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" Grid.Row="1"/> + <RepeatButton x:Name="PART_LineUpButton" Command="{x:Static ScrollBar.LineUpCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}"> + <Path x:Name="ArrowTop" Data="M 0 10 L 20 10 L 10 0 Z" Fill="{DynamicResource ScrollBar.Static.Glyph}" Margin="2,2,2,1" Stretch="Uniform"/> + </RepeatButton> + <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1"> + <Track.DecreaseRepeatButton> + <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource RepeatButtonTransparent}"/> + </Track.DecreaseRepeatButton> + <Track.IncreaseRepeatButton> + <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource RepeatButtonTransparent}"/> + </Track.IncreaseRepeatButton> + <Track.Thumb> + <Thumb Style="{StaticResource ScrollBarThumbVertical}"/> + </Track.Thumb> + </Track> + <RepeatButton x:Name="PART_LineDownButton" Command="{x:Static ScrollBar.LineDownCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="2" Style="{StaticResource ScrollBarButton}"> + <Path x:Name="ArrowBottom" Data="M 0 0 L 10 10 L 20 0 Z" Fill="{DynamicResource ScrollBar.Static.Glyph}" Margin="2,1,2,2" Stretch="Uniform"/> + </RepeatButton> + </Grid> + <ControlTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineDownButton}" Value="true"/> + <Condition Binding="{Binding IsPressed, ElementName=PART_LineDownButton}" Value="true"/> + </MultiDataTrigger.Conditions> + <Setter Property="Fill" TargetName="ArrowBottom" Value="{DynamicResource ScrollBar.Pressed.Glyph}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineUpButton}" Value="true"/> + <Condition Binding="{Binding IsPressed, ElementName=PART_LineUpButton}" Value="true"/> + </MultiDataTrigger.Conditions> + <Setter Property="Fill" TargetName="ArrowTop" Value="{DynamicResource ScrollBar.Pressed.Glyph}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineDownButton}" Value="true"/> + <Condition Binding="{Binding IsPressed, ElementName=PART_LineDownButton}" Value="false"/> + </MultiDataTrigger.Conditions> + <Setter Property="Fill" TargetName="ArrowBottom" Value="{DynamicResource ScrollBar.MouseOver.Glyph}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineUpButton}" Value="true"/> + <Condition Binding="{Binding IsPressed, ElementName=PART_LineUpButton}" Value="false"/> + </MultiDataTrigger.Conditions> + <Setter Property="Fill" TargetName="ArrowTop" Value="{DynamicResource ScrollBar.MouseOver.Glyph}"/> + </MultiDataTrigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Fill" TargetName="ArrowTop" Value="{DynamicResource ScrollBar.Disabled.Glyph}"/> + <Setter Property="Fill" TargetName="ArrowBottom" Value="{DynamicResource ScrollBar.Disabled.Glyph}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="Orientation" Value="Horizontal"> + <Setter Property="Width" Value="Auto"/> + <Setter Property="MinWidth" Value="0"/> + <Setter Property="Height" Value="18"/> + <Setter Property="MinHeight" Value="18"/> + <Setter Property="BorderThickness" Value="0,1"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ScrollBar}"> + <Grid x:Name="Bg" SnapsToDevicePixels="true"> + <Grid.ColumnDefinitions> + <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/> + <ColumnDefinition Width="0.00001*"/> + <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/> + </Grid.ColumnDefinitions> + <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1"/> + <RepeatButton x:Name="PART_LineLeftButton" Command="{x:Static ScrollBar.LineLeftCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}"> + <Path x:Name="ArrowLeft" Data="M 0 10 L 10 0 L 10 20 Z" Fill="{DynamicResource ScrollBar.Static.Glyph}" Margin="2,2,1,2" Stretch="Uniform"/> + </RepeatButton> + <Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}"> + <Track.DecreaseRepeatButton> + <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource RepeatButtonTransparent}"/> + </Track.DecreaseRepeatButton> + <Track.IncreaseRepeatButton> + <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource RepeatButtonTransparent}"/> + </Track.IncreaseRepeatButton> + <Track.Thumb> + <Thumb Style="{StaticResource ScrollBarThumbHorizontal}"/> + </Track.Thumb> + </Track> + <RepeatButton x:Name="PART_LineRightButton" Grid.Column="2" Command="{x:Static ScrollBar.LineRightCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}"> + <Path x:Name="ArrowRight" Data="M 0 0 L 10 10 L 0 20 Z" Fill="{DynamicResource ScrollBar.Static.Glyph}" Margin="1,2,2,2" Stretch="Uniform"/> + </RepeatButton> + </Grid> + <ControlTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineRightButton}" Value="true"/> + <Condition Binding="{Binding IsPressed, ElementName=PART_LineRightButton}" Value="true"/> + </MultiDataTrigger.Conditions> + <Setter Property="Fill" TargetName="ArrowRight" Value="{DynamicResource ScrollBar.Pressed.Glyph}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineLeftButton}" Value="true"/> + <Condition Binding="{Binding IsPressed, ElementName=PART_LineLeftButton}" Value="true"/> + </MultiDataTrigger.Conditions> + <Setter Property="Fill" TargetName="ArrowLeft" Value="{DynamicResource ScrollBar.Pressed.Glyph}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineRightButton}" Value="true"/> + <Condition Binding="{Binding IsPressed, ElementName=PART_LineRightButton}" Value="false"/> + </MultiDataTrigger.Conditions> + <Setter Property="Fill" TargetName="ArrowRight" Value="{DynamicResource ScrollBar.MouseOver.Glyph}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineLeftButton}" Value="true"/> + <Condition Binding="{Binding IsPressed, ElementName=PART_LineLeftButton}" Value="false"/> + </MultiDataTrigger.Conditions> + <Setter Property="Fill" TargetName="ArrowLeft" Value="{DynamicResource ScrollBar.MouseOver.Glyph}"/> + </MultiDataTrigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Fill" TargetName="ArrowLeft" Value="{DynamicResource ScrollBar.Disabled.Glyph}"/> + <Setter Property="Fill" TargetName="ArrowRight" Value="{DynamicResource ScrollBar.Disabled.Glyph}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Trigger> + </Style.Triggers> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/Shared.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/Shared.xaml new file mode 100644 index 000000000..9b196411b --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/Shared.xaml @@ -0,0 +1,14 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="MenuDict.xaml"/> + <ResourceDictionary Source="TabConrolStyle.xaml"/> + <ResourceDictionary Source="ToolbarStyle.xaml"/> + <ResourceDictionary Source="TreeViewItem.xaml"/> + <ResourceDictionary Source="ComboboxStyle.xaml"/> + <ResourceDictionary Source="DataGridStyle.xaml"/> + <ResourceDictionary Source="ScrollViewerStyle.xaml"/> + <ResourceDictionary Source="ButtonStyle.xaml"/> + </ResourceDictionary.MergedDictionaries> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/TabConrolStyle.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/TabConrolStyle.xaml new file mode 100644 index 000000000..81b4463f6 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/TabConrolStyle.xaml @@ -0,0 +1,354 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes"> + <Style x:Key="TangoTabControlStyle" TargetType="{x:Type TabControl}"> + <Setter Property="Padding" Value="2"/> + <Setter Property="HorizontalContentAlignment" Value="Center"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderBrush" Value="Transparent"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type TabControl}"> + <Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local"> + <Grid.ColumnDefinitions> + <ColumnDefinition x:Name="ColumnDefinition0"/> + <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition x:Name="RowDefinition0" Height="Auto"/> + <RowDefinition x:Name="RowDefinition1" Height="*"/> + </Grid.RowDefinitions> + <TabPanel x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="2,1,2,0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/> + <Border x:Name="contentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,0" Background="{DynamicResource TabItem.Content.Static}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local"> + <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + </Border> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="TabStripPlacement" Value="Bottom"> + <Setter Property="Grid.Row" TargetName="headerPanel" Value="1"/> + <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/> + <Setter Property="Height" TargetName="RowDefinition0" Value="*"/> + <Setter Property="Height" TargetName="RowDefinition1" Value="Auto"/> + <Setter Property="Margin" TargetName="headerPanel" Value="0,0,2,2"/> + </Trigger> + <Trigger Property="TabStripPlacement" Value="Left"> + <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/> + <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/> + <Setter Property="Grid.Column" TargetName="headerPanel" Value="0"/> + <Setter Property="Grid.Column" TargetName="contentPanel" Value="1"/> + <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto"/> + <Setter Property="Width" TargetName="ColumnDefinition1" Value="*"/> + <Setter Property="Height" TargetName="RowDefinition0" Value="*"/> + <Setter Property="Height" TargetName="RowDefinition1" Value="0"/> + <Setter Property="Margin" TargetName="headerPanel" Value="2,2,0,2"/> + </Trigger> + <Trigger Property="TabStripPlacement" Value="Right"> + <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/> + <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/> + <Setter Property="Grid.Column" TargetName="headerPanel" Value="1"/> + <Setter Property="Grid.Column" TargetName="contentPanel" Value="0"/> + <Setter Property="Width" TargetName="ColumnDefinition0" Value="*"/> + <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto"/> + <Setter Property="Height" TargetName="RowDefinition0" Value="*"/> + <Setter Property="Height" TargetName="RowDefinition1" Value="0"/> + <Setter Property="Margin" TargetName="headerPanel" Value="0,2,2,2"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource ControlTextBrush}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Resources> + <Style TargetType="{x:Type TabItem}"> + <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + <Setter Property="Background" Value="{DynamicResource TabItem.Static.Background}"/> + <Setter Property="BorderBrush" Value="{DynamicResource TabItem.Static.Border}"/> + <Setter Property="Margin" Value="0"/> + <Setter Property="Padding" Value="6,2,6,2"/> + <Setter Property="HorizontalContentAlignment" Value="Stretch"/> + <Setter Property="VerticalContentAlignment" Value="Stretch"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type TabItem}"> + <Grid x:Name="templateRoot" SnapsToDevicePixels="true"> + <Border x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Margin="0,-1,0,0"> + <Border x:Name="innerBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Margin="0" Opacity="0"/> + </Border> + <StackPanel Orientation="Horizontal" Margin="0" > + <ContentPresenter x:Name="contentPresenter" ContentSource="Header" Focusable="False" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> + <Button x:Name="CloseButton" Width="18" Height="18" + Margin="6,0,2,0" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center" + Command="{Binding DataContext.CloseProjectItemCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" + CommandParameter="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabItem}}, Path=Content}" + VerticalAlignment="Center" Focusable="False" Visibility="Hidden"> + <Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" > + <Line StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Stroke="{DynamicResource ControlTextBrush}" X1="1" Y1="1" X2="9" Y2="9" HorizontalAlignment="Center" VerticalAlignment="Center" /> + <Line StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Stroke="{DynamicResource ControlTextBrush}" X1="1" Y1="9" X2="9" Y2="1" HorizontalAlignment="Center" VerticalAlignment="Center" /> + </Grid> + <Button.Style> + <Style TargetType="{x:Type Button}"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Button}"> + <Border Background="{TemplateBinding Background}"> + <Grid> + <Rectangle x:Name="background" Fill="{DynamicResource TabItem.Static.Background}" Opacity="1"/> + <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter TargetName="background" Property="Fill" Value="#E51C97EA"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + + </Style> + </Button.Style> + </Button> + </StackPanel> + </Grid> + <ControlTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/> + </MultiDataTrigger.Conditions> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Border}"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/> + <Setter Property="Visibility" TargetName="CloseButton" Value="Visible"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/> + </MultiDataTrigger.Conditions> + <Setter Property="Opacity" TargetName="contentPresenter" Value="1.0"/> + <Setter Property="Margin" Value="-2,0,-2,0"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Bottom.Background}"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Bottom.Background}"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/> + <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource TabItem.Selected.Background}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/> + </MultiDataTrigger.Conditions> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Border}"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/> + <Setter Property="Visibility" TargetName="CloseButton" Value="Visible"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/> + </MultiDataTrigger.Conditions> + <Setter Property="Visibility" TargetName="CloseButton" Value="Visible"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Border}"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/> + </MultiDataTrigger.Conditions> + <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.Disabled.Border}"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/> + </MultiDataTrigger.Conditions> + <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/> + <Setter Property="Background" TargetName="mainBorder" Value="Transparent"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="Transparent"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/> + <Setter Property="Visibility" TargetName="CloseButton" Value="Collapsed"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/> + </MultiDataTrigger.Conditions> + <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.Disabled.Border}"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/> + </MultiDataTrigger.Conditions> + <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.Disabled.Border}"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/> + </MultiDataTrigger.Conditions> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/> + </MultiDataTrigger.Conditions> + <Setter Property="Panel.ZIndex" Value="1"/> + <Setter Property="Margin" Value="-2,-2,0,-2"/> + <Setter Property="Opacity" TargetName="innerBorder" Value="1"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/> + <Setter Property="Visibility" TargetName="CloseButton" Value="Visible"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/> + </MultiDataTrigger.Conditions> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/> + <Setter Property="Visibility" TargetName="CloseButton" Value="Collapsed"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="Transparent"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/> + </MultiDataTrigger.Conditions> + <Setter Property="Panel.ZIndex" Value="1"/> + <Setter Property="Margin" Value="-2,0,-2,0"/> + <Setter Property="Opacity" TargetName="innerBorder" Value="1"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/> + <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource TabItem.MouseOver.Background}"/> + <Setter Property="Visibility" TargetName="CloseButton" Value="Collapsed"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.Content.Static}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.Disabled.Background}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/> + </MultiDataTrigger.Conditions> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/> + </MultiDataTrigger.Conditions> + <Setter Property="Panel.ZIndex" Value="1"/> + <Setter Property="Margin" Value="0,-2,-2,-2"/> + <Setter Property="Opacity" TargetName="innerBorder" Value="1"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/> + <Setter Property="Visibility" TargetName="CloseButton" Value="Visible"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/> + </MultiDataTrigger.Conditions> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/> + <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/> + </MultiDataTrigger.Conditions> + <Setter Property="Panel.ZIndex" Value="1"/> + <Setter Property="Margin" Value="-2,-2,-2,0"/> + <Setter Property="Opacity" TargetName="innerBorder" Value="1"/> + <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/> + <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/> + <Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + <Setter Property="BorderBrush" TargetName="mainBorder" Value="{DynamicResource TabItem.MouseOver.Background}"/> + <Setter Property="Visibility" TargetName="CloseButton" Value="Visible"/> + </MultiDataTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Style.Resources> + </Style> + <Style x:Key="FocusVisual"> + <Setter Property="Control.Template"> + <Setter.Value> + <ControlTemplate> + <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="TangoGroupBoxStyle" TargetType="{x:Type GroupBox}"> + <Setter Property="BorderBrush" Value="Transparent"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="Background" Value="{DynamicResource Background.Static}"/> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type GroupBox}"> + <Grid SnapsToDevicePixels="true"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + <Border BorderBrush="{DynamicResource ListBorder}" BorderThickness="{TemplateBinding BorderThickness}" + Background="{TemplateBinding Background}" + Grid.ColumnSpan="2" + Grid.Column="0" CornerRadius="0" + Grid.Row="0" + Grid.RowSpan="3"> + </Border> + <Border x:Name="Header" Grid.Column="0" Padding="3,1,3,0" Grid.Row="0" Grid.RowSpan="2" BorderBrush="Transparent" BorderThickness="1" Margin="1" Grid.ColumnSpan="2"> + <ContentPresenter ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + </Border> + <ContentPresenter Grid.Row="2" Margin="0,1,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.ColumnSpan="2" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ToolbarStyle.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ToolbarStyle.xaml new file mode 100644 index 000000000..6223934b5 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/ToolbarStyle.xaml @@ -0,0 +1,236 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + x:Class="ToolbarSttyle.MainWindow"> + <Style x:Key="ToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}"> + <Setter Property="Background" Value="{DynamicResource ToolBarToggleButtonVerticalBackground}"/> + <Setter Property="MinHeight" Value="0"/> + <Setter Property="MinWidth" Value="0"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="0,0,3,3" Background="{TemplateBinding Background}"> + <Canvas Width="7" VerticalAlignment="Bottom" SnapsToDevicePixels="true" Margin="2,7,2,2" Height="6" HorizontalAlignment="Right"> + <!--<Path x:Name="Path1" Data="M 1.5 1 L 1.5 6" Stroke="{DynamicResource ToolBarGripper}"/>--> + <Path x:Name="Path2" Data="M 0.5 0 L 0.5 5" Stroke="{DynamicResource ControlForegroundKey}"/> + <!--<Path x:Name="Path3" Data="M 3.5 0.5 L 7 3.5 L 4 6.5 Z" Fill="{DynamicResource ToolBarGripper}"/>--> + <Path x:Name="Path4" Data="M 3 -0.5 L 6 2.5 L 3 5.5 Z" Fill="{DynamicResource ControlForegroundKey}"/> + </Canvas> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ToolBarButtonHover}"/> + <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + </Trigger> + <Trigger Property="IsKeyboardFocused" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ToolBarButtonHover}"/> + <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource ToolBarGripper}"/> + </Trigger> + <Trigger Property="IsPressed" Value="True"> + <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> + <Setter Property="Background" Value="{DynamicResource ControlBrushColorKey}"/> + </DataTrigger> + </Style.Triggers> + </Style> + <Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}"> + <Setter Property="Background" Value="{DynamicResource ToolBarToggleButtonHorizontalBackground}"/> + <Setter Property="MinHeight" Value="0"/> + <Setter Property="MinWidth" Value="0"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="0,3,3,0" Background="{TemplateBinding Background}"> + <Canvas Width="6" VerticalAlignment="Bottom" SnapsToDevicePixels="true" Margin="7,2,2,2" Height="7" HorizontalAlignment="Right"> + <!--<Path x:Name="Path1" Data="M 1 1.5 L 6 1.5" Stroke="{DynamicResource ControlForegroundKey}"/>--> + <Path x:Name="Path2" Data="M 0 0.5 L 5 0.5" Stroke="{DynamicResource ControlForegroundKey}"/> + <!--<Path x:Name="Path3" Data="M 0.5 4 L 6.5 4 L 3.5 7 Z" Fill="{DynamicResource ControlForegroundKey}"/>--> + <Path x:Name="Path4" Data="M -0.5 3 L 5.5 3 L 2.5 6 Z" Fill="{DynamicResource ControlForegroundKey}"/> + </Canvas> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ToolBarButtonHover}"/> + <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + </Trigger> + <Trigger Property="IsKeyboardFocused" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ToolBarButtonHover}"/> + <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource ToolBarGripper}"/> + </Trigger> + <Trigger Property="IsPressed" Value="True"> + <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> + <Setter Property="Background" Value="{DynamicResource ControlBrushColorKey}"/> + </DataTrigger> + </Style.Triggers> + </Style> + <Style x:Key="ToolBarThumbStyle" TargetType="{x:Type Thumb}"> + <Setter Property="OverridesDefaultStyle" Value="true" /> + <Setter Property="Cursor" Value="SizeAll" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Thumb}"> + <Border Background="Transparent" SnapsToDevicePixels="True"> + <Rectangle Margin="0,2" > + <Rectangle.Fill> + <DrawingBrush Viewport="0,0,4,4" ViewportUnits="Absolute" Viewbox="0,0,8,8" ViewboxUnits="Absolute" TileMode="Tile"> + <DrawingBrush.Drawing> + <DrawingGroup> + <GeometryDrawing Brush="#FF46464A" + Geometry="M 4 4 L 4 8 L 8 8 L 8 4 z" /> + </DrawingGroup> + </DrawingBrush.Drawing> + </DrawingBrush> + </Rectangle.Fill> + </Rectangle> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ToolBarMainPanelBorderStyle" TargetType="{x:Type Border}"> + <Setter Property="Margin" Value="0,0,11,0"/> + <Setter Property="CornerRadius" Value="3,3,3,3"/> + <Style.Triggers> + <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> + <Setter Property="CornerRadius" Value="0,0,0,0"/> + </DataTrigger> + </Style.Triggers> + </Style> + <Style x:Key="TangoToolBarStyle" TargetType="{x:Type ToolBar}"> + <Setter Property="Background" Value="{DynamicResource ToolBarHorizontalBackground}"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToolBar}"> + <Grid x:Name="Grid" Margin="3,1,1,1" SnapsToDevicePixels="true"> + <Grid x:Name="OverflowGrid" HorizontalAlignment="Right"> + <ToggleButton x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{DynamicResource ToolBarHorizontalOverflowButtonStyle}"/> + <Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false"> + <!--<AThemes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">--> + <Border x:Name="ToolBarSubMenuBorder" BorderBrush="{DynamicResource ToolBarMenuBorder}" BorderThickness="1" Background="{DynamicResource ToolBarSubMenuBackground}" RenderOptions.ClearTypeHint="Enabled"> + <ToolBarOverflowPanel x:Name="PART_ToolBarOverflowPanel" KeyboardNavigation.DirectionalNavigation="Cycle" FocusVisualStyle="{x:Null}" Focusable="true" Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" WrapWidth="200"/> + </Border> + <!--</AThemes:SystemDropShadowChrome>--> + </Popup> + </Grid> + <Border x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Style="{DynamicResource ToolBarMainPanelBorderStyle}"> + <DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local"> + <Thumb x:Name="ToolBarThumb" Margin="-3,-1,0,0" Padding="6,5,1,6" Style="{StaticResource ToolBarThumbStyle}" Width="10"/> + <ContentPresenter x:Name="ToolBarHeader" ContentSource="Header" HorizontalAlignment="Center" Margin="4,0,4,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/> + <ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" Margin="0,1,2,2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + </DockPanel> + </Border> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsOverflowOpen" Value="true"> + <Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false"/> + </Trigger> + <Trigger Property="Header" Value="{x:Null}"> + <Setter Property="Visibility" TargetName="ToolBarHeader" Value="Collapsed"/> + </Trigger> + <Trigger Property="ToolBarTray.IsLocked" Value="true"> + <Setter Property="Visibility" TargetName="ToolBarThumb" Value="Collapsed"/> + </Trigger> + <Trigger Property="HasDropShadow" SourceName="OverflowPopup" Value="true"> + <!--<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/> + <Setter Property="SnapsToDevicePixels" TargetName="Shdw" Value="true"/> + <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>--> + </Trigger> + <Trigger Property="Orientation" Value="Vertical"> + <Setter Property="Margin" TargetName="Grid" Value="1,3,1,1"/> + <Setter Property="Style" TargetName="OverflowButton" Value="{StaticResource ToolBarVerticalOverflowButtonStyle}"/> + <Setter Property="Height" TargetName="ToolBarThumb" Value="10"/> + <Setter Property="Width" TargetName="ToolBarThumb" Value="Auto"/> + <Setter Property="Margin" TargetName="ToolBarThumb" Value="-1,-3,0,0"/> + <Setter Property="Padding" TargetName="ToolBarThumb" Value="5,6,6,1"/> + <Setter Property="Margin" TargetName="ToolBarHeader" Value="0,0,0,4"/> + <Setter Property="Margin" TargetName="PART_ToolBarPanel" Value="1,0,2,2"/> + <Setter Property="DockPanel.Dock" TargetName="ToolBarThumb" Value="Top"/> + <Setter Property="DockPanel.Dock" TargetName="ToolBarHeader" Value="Top"/> + <Setter Property="HorizontalAlignment" TargetName="OverflowGrid" Value="Stretch"/> + <Setter Property="VerticalAlignment" TargetName="OverflowGrid" Value="Bottom"/> + <Setter Property="Placement" TargetName="OverflowPopup" Value="Right"/> + <Setter Property="Margin" TargetName="MainPanelBorder" Value="0,0,0,11"/> + <Setter Property="Background" Value="{DynamicResource ToolBarVerticalBackground}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> + <Setter Property="Background" Value="{DynamicResource ControlBrushColorKey}"/> + </DataTrigger> + </Style.Triggers> + <Style.Resources> + <Style TargetType="{x:Type Button}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Button}"> + <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> + <Grid> + <Rectangle x:Name="background" Fill="Transparent" Opacity="1"/> + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsDefaulted" Value="true"> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Fill" TargetName="background" Value="{DynamicResource Toolbar.Button.MaouseMove.Background}"/> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Fill" TargetName="background" Value="{DynamicResource ControlBrushColorKey}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Background" TargetName="border" Value="{DynamicResource Button.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource Button.Disabled.Border}"/> + <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource Button.Disabled.Foreground}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Style.Resources> + </Style> + + <Style x:Key="{x:Static ToolBar.SeparatorStyleKey}" TargetType="{x:Type Separator}"> + <Setter Property="Width" Value="1" /> + <Setter Property="Margin" Value="10,2,10,2" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Separator}"> + <Rectangle Fill="{DynamicResource Inactive.Selection}" VerticalAlignment="Stretch"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/TreeViewItem.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/TreeViewItem.xaml new file mode 100644 index 000000000..4814368d0 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Themes/TreeViewItem.xaml @@ -0,0 +1,177 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes" + xmlns:conv="clr-namespace:Tango.Scripting.IDE.Converters"> + <Style x:Key="TangoTreeViewStyle" TargetType="{x:Type TreeView}"> + <Setter Property="Background" Value="{DynamicResource TreeBackgroundColor}"/> + <Setter Property="BorderBrush" Value="{DynamicResource ListBorder}"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="Padding" Value="1"/> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> + <Setter Property="ScrollViewer.PanningMode" Value="Both"/> + <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type TreeView}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> + <ScrollViewer x:Name="_tv_scrollviewer_" Background="{TemplateBinding Background}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> + <ItemsPresenter /> + </ScrollViewer> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlTextBrush}"/> + </Trigger> + <Trigger Property="VirtualizingPanel.IsVirtualizing" Value="true"> + <Setter Property="CanContentScroll" TargetName="_tv_scrollviewer_" Value="true"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="VirtualizingPanel.IsVirtualizing" Value="true"> + <Setter Property="ItemsPanel"> + <Setter.Value> + <ItemsPanelTemplate> + <VirtualizingStackPanel/> + </ItemsPanelTemplate> + </Setter.Value> + </Setter> + </Trigger> + </Style.Triggers> + </Style> + <Style x:Key="TreeViewItemFocusVisual"> + <Setter Property="Control.Template"> + <Setter.Value> + <ControlTemplate> + <Rectangle/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <StreamGeometry x:Key="TreeArrow" >M0,0L0,6 6,0z</StreamGeometry> + <Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}"> + <Setter Property="Focusable" Value="False"/> + <Setter Property="Width" Value="16"/> + <Setter Property="Height" Value="16"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Border Background="Transparent" Height="16" Padding="5,5,5,5" Width="16"> + <Path x:Name="ExpandPath" Data="{StaticResource TreeArrow}" Fill="{DynamicResource TreeViewItem.TreeArrow.Static.Fill}" Stroke="{DynamicResource TreeViewItem.TreeArrow.Static.Stroke}"> + <Path.RenderTransform> + <RotateTransform Angle="135" CenterY="3" CenterX="3"/> + </Path.RenderTransform> + </Path> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsChecked" Value="True"> + <Setter Property="RenderTransform" TargetName="ExpandPath"> + <Setter.Value> + <RotateTransform Angle="180" CenterY="3" CenterX="3"/> + </Setter.Value> + </Setter> + <Setter Property="Fill" TargetName="ExpandPath" Value="{DynamicResource TreeViewItem.TreeArrow.Static.Checked.Fill}"/> + <Setter Property="Stroke" TargetName="ExpandPath" Value="{DynamicResource TreeViewItem.TreeArrow.Static.Checked.Stroke}"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Stroke" TargetName="ExpandPath" Value="{DynamicResource TreeViewItem.TreeArrow.MouseOver.Stroke}"/> + <Setter Property="Fill" TargetName="ExpandPath" Value="{DynamicResource TreeViewItem.TreeArrow.MouseOver.Fill}"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsMouseOver" Value="True"/> + <Condition Property="IsChecked" Value="True"/> + </MultiTrigger.Conditions> + <Setter Property="Stroke" TargetName="ExpandPath" Value="{DynamicResource TreeViewItem.TreeArrow.MouseOver.Checked.Stroke}"/> + <Setter Property="Fill" TargetName="ExpandPath" Value="{DynamicResource TreeViewItem.TreeArrow.MouseOver.Checked.Fill}"/> + </MultiTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style TargetType="{x:Type TreeViewItem}"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> + <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> + <Setter Property="Padding" Value="4,0,0,0"/> + <Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"/> + <Setter Property="FocusVisualStyle" Value="{StaticResource TreeViewItemFocusVisual}"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type TreeViewItem}"> + <ControlTemplate.Resources> + <conv:LeftMarginMultiplierConverter Length="19" x:Key="lengthConverter" /> + </ControlTemplate.Resources> + <StackPanel> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> + <Grid x:Name="GridTreeItem" Margin="{Binding Converter={StaticResource lengthConverter}, + RelativeSource={RelativeSource TemplatedParent}}"> + <Grid.ColumnDefinitions> + <ColumnDefinition MinWidth="19" Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/> + <ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + </Grid> + </Border> + <ItemsPresenter x:Name="ItemsHost"/> + </StackPanel> + <ControlTemplate.Triggers> + <Trigger Property="IsExpanded" Value="false"> + <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/> + </Trigger> + <Trigger Property="HasItems" Value="false"> + <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="HasHeader" Value="false"/> + <Condition Property="Width" Value="Auto"/> + </MultiTrigger.Conditions> + <Setter TargetName="PART_Header" Property="MinWidth" Value="75"/> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="HasHeader" Value="false"/> + <Condition Property="Height" Value="Auto"/> + </MultiTrigger.Conditions> + <Setter TargetName="PART_Header" Property="MinHeight" Value="19"/> + </MultiTrigger> + <Trigger Property="IsSelected" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBrushColorKey}"/> + <Setter Property="Foreground" Value="{DynamicResource HighlightTextBrushKey}"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsSelected" Value="true"/> + <Condition Property="IsSelectionActive" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="GridTreeItem" Value="{DynamicResource ControlBrushColorKey}"/> + <Setter Property="Foreground" Value="{DynamicResource HighlightTextBrushKey}"/> + </MultiTrigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource Inactive.Selection}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="VirtualizingPanel.IsVirtualizing" Value="true"> + <Setter Property="ItemsPanel"> + <Setter.Value> + <ItemsPanelTemplate> + <VirtualizingStackPanel/> + </ItemsPanelTemplate> + </Setter.Value> + </Setter> + </Trigger> + </Style.Triggers> + </Style> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ViewModelLocator.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ViewModelLocator.cs new file mode 100644 index 000000000..ffe78f49d --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ViewModelLocator.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.Scripting.IDE.Dialogs; +using Tango.Scripting.IDE.Notifications; + +namespace Tango.Scripting.IDE +{ + /// <summary> + /// This class contains static references to all the view models in the + /// application and provides an entry point for the bindings. + /// </summary> + public static class ViewModelLocator + { + /// <summary> + /// Initializes a new instance of the ViewModelLocator class. + /// </summary> + static ViewModelLocator() + { + TangoIOC.Default.Register<INotificationManager, DefaultNotificationManager>(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Windows/DialogWindow.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Windows/DialogWindow.xaml new file mode 100644 index 000000000..683391afd --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Windows/DialogWindow.xaml @@ -0,0 +1,28 @@ +<mahapps:MetroWindow x:Class="Tango.Scripting.IDE.Windows.DialogWindow" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:Tango.Scripting.IDE.Windows" + mc:Ignorable="d" + Title="Some Title" Height="720" Width="1280" + SizeToContent="WidthAndHeight" + ResizeMode="NoResize" + ShowMaxRestoreButton="False" + ShowMinButton="False" + ShowCloseButton="False" + BorderThickness="1" BorderBrush="Gray" TitleCaps="False"> + <Window.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="/Tango.Scripting.IDE;component/Themes/DarkThemesColors.xaml"/> + <ResourceDictionary Source="/Tango.Scripting.IDE;component/Themes/ButtonStyle.xaml"/> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </Window.Resources> + + <Grid> + + </Grid> +</mahapps:MetroWindow> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Windows/DialogWindow.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Windows/DialogWindow.xaml.cs new file mode 100644 index 000000000..cfddd09e3 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Windows/DialogWindow.xaml.cs @@ -0,0 +1,28 @@ +using MahApps.Metro.Controls; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE.Windows +{ + /// <summary> + /// Interaction logic for DialogWindow.xaml + /// </summary> + public partial class DialogWindow : MetroWindow + { + public DialogWindow() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/app.config b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/app.config new file mode 100644 index 000000000..a00da21b0 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/app.config @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/packages.config b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/packages.config new file mode 100644 index 000000000..893958c68 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/packages.config @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net461" /> + <package id="MahApps.Metro" version="1.5.0" targetFramework="net461" /> +</packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.sln b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.sln index bd59e05d9..e77aad451 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.sln +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.sln @@ -9,6 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Scripting.Editors", "Tango.Scripting.Editors\Tango.Scripting.Editors.csproj", "{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Scripting.IDE", "Tango.Scripting.IDE\Tango.Scripting.IDE.csproj", "{C9F60285-91FB-4293-BCF5-164D76755CDD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Scripting.IDE.UI", "Tango.Scripting.IDE.UI\Tango.Scripting.IDE.UI.csproj", "{B0EFE7A0-7039-4DC4-8B39-465E521299F6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +31,14 @@ Global {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.Build.0 = Debug|Any CPU {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.ActiveCfg = Release|Any CPU {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.Build.0 = Release|Any CPU + {C9F60285-91FB-4293-BCF5-164D76755CDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9F60285-91FB-4293-BCF5-164D76755CDD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9F60285-91FB-4293-BCF5-164D76755CDD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9F60285-91FB-4293-BCF5-164D76755CDD}.Release|Any CPU.Build.0 = Release|Any CPU + {B0EFE7A0-7039-4DC4-8B39-465E521299F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0EFE7A0-7039-4DC4-8B39-465E521299F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0EFE7A0-7039-4DC4-8B39-465E521299F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0EFE7A0-7039-4DC4-8B39-465E521299F6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptParser.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptParser.cs index 1fc771a93..15760c950 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptParser.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptParser.cs @@ -2,7 +2,9 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using System; +using System.Collections; using System.Collections.Generic; +using System.Collections.Immutable; using System.IO; using System.Linq; using System.Text; @@ -13,6 +15,19 @@ namespace Tango.Scripting.Parsing { public class ScriptParser { + private const string fakeScript = "CurrentScript"; + private string fakeScriptName = "CurrentScript."; + + private String ReplaceFakeScript(String str) + { + if (str != null) + { + return str.Replace(fakeScriptName, "").Replace(fakeScript, ""); + } + + return str; + } + private CompilationUnitSyntax GetRoot(String code) { SyntaxTree tree = CSharpSyntaxTree.ParseText(code); @@ -26,108 +41,342 @@ namespace Tango.Scripting.Parsing CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); var compilation = CSharpCompilation.Create("CSharpScript").AddSyntaxTrees(tree); SemanticModel model = compilation.GetSemanticModel(tree); - return model; } - public List<ScriptVariable> ParseScript(String code) + public List<ScriptSymbol> GetContextSymbols(String code, int caretOffset) { - List<ScriptVariable> vars = new List<ScriptVariable>(); - - SyntaxTree tree = CSharpSyntaxTree.ParseText(code); - var root = (CompilationUnitSyntax)tree.GetRoot(); + var currentNode = GetCaretOffsetNode(code, caretOffset); - List<VariableDeclaratorSyntax> variables = new List<VariableDeclaratorSyntax>(); - FillVariables(variables, root.Members[0]); - variables = variables.Distinct().ToList(); + if (currentNode == null) return new List<ScriptSymbol>(); - foreach (var item in variables) + if (currentNode.Ancestors().OfType<BaseTypeDeclarationSyntax>().Count() == 0) { - ScriptVariable v = new ScriptVariable(); - v.Name = item.Identifier.ToString(); + var usings = GetUsingsFull(code); - if (item.Initializer.Value.GetType() == typeof(ObjectCreationExpressionSyntax)) - { - v.Type = (item.Initializer.Value as ObjectCreationExpressionSyntax).Type.ToString(); - } - else if (item.Initializer.Value.GetType() == typeof(InvocationExpressionSyntax)) + int removedLength = usings.Select(x => x.Length).Sum(); + + foreach (var use in usings) { - v.Type = (((item.Initializer.Value as InvocationExpressionSyntax).Expression as MemberAccessExpressionSyntax).Name as GenericNameSyntax).TypeArgumentList.Arguments[0].ToString(); + code = code.Replace(use, ""); } - vars.Add(v); + String scriptStart = $"public class {fakeScript}\n{{\n"; + code = $"{scriptStart}{code}\n}}"; + caretOffset = caretOffset - removedLength + scriptStart.Length; } - return vars; - } + var model = GetSemanticModel(code); + var symbols = model.LookupSymbols(caretOffset).ToList().Where(x => x.Kind == SymbolKind.Property || x.Kind == SymbolKind.Field || x.Kind == SymbolKind.Parameter || x.Kind == SymbolKind.Local || x.Kind == SymbolKind.Method).ToList(); - //public List<DetectedType> DetectTypes(String code, List<ReferenceAssembly> referenceAssemblies) - //{ - // SyntaxTree tree = CSharpSyntaxTree.ParseText(code); - // CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); - // var compilation = CSharpCompilation.Create("CSharpScript").AddReferences(referenceAssemblies.Select(x => MetadataReference.CreateFromFile(x.Assembly.Location))).AddSyntaxTrees(tree); + List<ScriptSymbol> vars = new List<ScriptSymbol>(); - // SemanticModel model = compilation.GetSemanticModel(tree); + foreach (var symbol in symbols.DistinctBy(x => x.Name)) + { + if (symbol.ContainingSymbol.GetType().Name == "LambdaSymbol") + { + var invocationNode = currentNode.Ancestors().OfType<InvocationExpressionSyntax>().FirstOrDefault(); + if (invocationNode != null) + { + var expressionNode = invocationNode.Expression as MemberAccessExpressionSyntax; - //} + if (expressionNode != null && expressionNode.Name != null) + { + var name = expressionNode.Name as GenericNameSyntax; - private void FillVariables(List<VariableDeclaratorSyntax> variables, SyntaxNode node) - { - foreach (var item in node.DescendantNodes(x => true)) - { - if (item.GetType() == typeof(VariableDeclaratorSyntax)) + if (name != null) + { + var type = name.TypeArgumentList.Arguments.FirstOrDefault()?.ToString(); + + vars.Add(new ScriptSymbol() + { + Name = symbol.Name, + Type = ReplaceFakeScript(type), + Class = ReplaceFakeScript(symbol.ContainingType?.Name), + Kind = symbol.Kind, + Accessibility = symbol.DeclaredAccessibility, + ContainingNamespace = ReplaceFakeScript(symbol.ContainingNamespace?.Name), + Summary = GetSymbolDocumentation(symbol), + }); + } + } + } + } + if (symbol.Kind == SymbolKind.Method) { - variables.Add(item as VariableDeclaratorSyntax); + var prop = symbol.GetType().GetProperty("ReturnType"); + + if (prop != null) + { + ScriptSymbol m = new ScriptSymbol() + { + Name = symbol.Name, + Type = ReplaceFakeScript(prop.GetValue(symbol).ToString()), + Class = ReplaceFakeScript(symbol.ContainingType?.Name), + Kind = symbol.Kind, + Accessibility = symbol.DeclaredAccessibility, + ContainingNamespace = ReplaceFakeScript(symbol.ContainingNamespace?.Name), + Summary = GetSymbolDocumentation(symbol), + }; + + m.Parameters = GetMethodSymbolParameters(symbol); + + vars.Add(m); + } } else { - FillVariables(variables, item); + var prop = symbol.GetType().GetProperty("Type"); + + if (prop != null) + { + vars.Add(new ScriptSymbol() + { + Name = symbol.Name, + Type = ReplaceFakeScript(prop.GetValue(symbol).ToString()), + Class = ReplaceFakeScript(symbol.ContainingType?.Name), + Kind = symbol.Kind, + Accessibility = symbol.DeclaredAccessibility, + ContainingNamespace = ReplaceFakeScript(symbol.ContainingNamespace?.Name), + Summary = GetSymbolDocumentation(symbol), + }); + } } } + + return vars.Where(x => x.Type != "?").ToList(); } public List<String> GetUsings(String code) { - Regex r = new Regex("(using [^;]+;)"); + Regex r = new Regex("(using [^;^\n]+;)"); var matches = r.Matches(code); - return matches.OfType<Match>().Select(x => x.Value.Replace("using ", "").Replace(";", "")).ToList(); + return matches.OfType<Match>().Select(x => x.Value.Replace("using ", "").Replace(";", "").Replace("\n", "").Replace("\t", "").Replace("\r", "")).ToList(); } - //class ClassVirtualizationVisitor : CSharpSyntaxRewriter - //{ - // public List<string> classes = new List<String>(); - - // public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node) - // { - // node = (ClassDeclarationSyntax)base.VisitClassDeclaration(node); - - // string className = node.Identifier.ValueText; - // classes.Add(className); // save your visited classes - - // return node; - // } - //} + public List<String> GetUsingsFull(String code) + { + Regex r = new Regex("(using [^;^\n]+;)"); + var matches = r.Matches(code); + return matches.OfType<Match>().Select(x => x.Value).ToList(); + } - public List<INamedTypeSymbol> GetDeclaredTypes(String code) + public List<ScriptType> GetDeclaredTypes(String code) { - List<INamedTypeSymbol> types = new List<INamedTypeSymbol>(); + List<ScriptType> types = new List<ScriptType>(); SyntaxTree tree = CSharpSyntaxTree.ParseText(code); CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); var compilation = CSharpCompilation.Create("CSharpScript").AddSyntaxTrees(tree); SemanticModel model = compilation.GetSemanticModel(tree); - foreach (var d in root.DescendantNodes().OfType<ClassDeclarationSyntax>()) + foreach (var d in root.DescendantNodes().Where(x => x is ClassDeclarationSyntax || x is EnumDeclarationSyntax || x is InterfaceDeclarationSyntax).OfType<BaseTypeDeclarationSyntax>()) { var type = model.GetDeclaredSymbol(d); if (!String.IsNullOrWhiteSpace(type.Name)) { - types.Add(type); + ScriptType scriptType = new ScriptType(); + scriptType.Name = type.Name; + scriptType.Kind = type.TypeKind; + scriptType.ContainingNamespace = type.ContainingNamespace?.Name; + scriptType.Summary = GetNodeDocumentation(d); + + + foreach (var symbol in d.DescendantNodes().OfType<PropertyDeclarationSyntax>()) + { + var symbolModel = model.GetDeclaredSymbol(symbol); + + scriptType.Symbols.Add(new ScriptSymbol() + { + Class = scriptType.Name, + Accessibility = symbolModel.DeclaredAccessibility, + Kind = SymbolKind.Property, + Name = symbolModel.Name, + Type = symbolModel.Type.ToString(), + ContainingNamespace = symbolModel.ContainingNamespace?.Name, + Summary = GetNodeDocumentation(symbol), + }); + } + + foreach (var symbol in d.DescendantNodes().OfType<FieldDeclarationSyntax>()) + { + var symbolModel = model.GetDeclaredSymbol(symbol.Declaration.Variables.FirstOrDefault()) as IFieldSymbol; + + if (symbolModel != null) + { + scriptType.Symbols.Add(new ScriptSymbol() + { + Class = scriptType.Name, + Accessibility = symbolModel.DeclaredAccessibility, + Kind = SymbolKind.Field, + Name = symbolModel.Name, + Type = symbolModel.Type.ToString(), + ContainingNamespace = symbolModel.ContainingNamespace?.Name, + Summary = GetNodeDocumentation(symbol), + }); + } + } + + foreach (var symbol in d.DescendantNodes().OfType<MethodDeclarationSyntax>()) + { + var symbolModel = model.GetDeclaredSymbol(symbol); + + if (symbolModel != null) + { + ScriptSymbol m = new ScriptSymbol() + { + Class = scriptType.Name, + Accessibility = symbolModel.DeclaredAccessibility, + Kind = SymbolKind.Method, + Name = symbolModel.Name, + Type = symbolModel.ReturnType.ToString(), + ContainingNamespace = symbolModel.ContainingNamespace?.Name, + Summary = GetNodeDocumentation(symbol), + }; + + foreach (var p in symbol.DescendantNodes().OfType<ParameterSyntax>()) + { + if (p.Type != null && p.Identifier != null) + { + m.Parameters.Add(new KeyValuePair<string, string>(p.Type.ToString(), p.Identifier.ToString())); + } + } + + scriptType.Symbols.Add(m); + } + } + + types.Add(scriptType); } } return types; } + + public ObjectCreationExpressionSyntax GetCurrentConstructionExpression(String code) + { + SyntaxTree tree = CSharpSyntaxTree.ParseText(code); + CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); + return root.DescendantNodes().OfType<ObjectCreationExpressionSyntax>().FirstOrDefault(); + } + + public T GetExpressionFirst<T>(String line) where T : CSharpSyntaxNode + { + SyntaxTree tree = CSharpSyntaxTree.ParseText(line); + CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); + return root.DescendantNodes().OfType<T>().FirstOrDefault(); + } + + public List<T> GetExpressions<T>(String line) where T : CSharpSyntaxNode + { + SyntaxTree tree = CSharpSyntaxTree.ParseText(line); + CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); + return root.DescendantNodes().OfType<T>().ToList(); + } + + public List<T> GetDirectExpressions<T>(SyntaxNode node) where T : CSharpSyntaxNode + { + return node.DescendantNodes().OfType<T>().ToList(); + } + + private SyntaxNode GetCaretOffsetNode(String code, int offset) + { + SyntaxTree tree = CSharpSyntaxTree.ParseText(code); + CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); + return root.DescendantNodes().Where(x => offset >= x.FullSpan.Start && offset <= x.FullSpan.End).OrderBy(x => x.FullSpan.Length).FirstOrDefault(); + } + + private List<SyntaxNode> GetNodeAncestors(SyntaxNode node) + { + return node.Ancestors().ToList(); + } + + private String GetNodeDocumentation(SyntaxNode node) + { + try + { + var trivia = node.GetLeadingTrivia().FirstOrDefault(t => t.Kind() == SyntaxKind.SingleLineCommentTrivia); + + if (trivia != null && !String.IsNullOrWhiteSpace(trivia.ToString())) + { + return trivia.ToString().Replace("//", ""); + } + } + catch { } + + return "No documentation."; + } + + private String GetSymbolDocumentation(ISymbol symbol) + { + if (symbol != null) + { + var prop = symbol.GetType().GetProperty("SyntaxNode"); + + if (prop != null) + { + var node = prop.GetValue(symbol) as SyntaxNode; + + if (node != null) + { + return GetNodeDocumentation(node.Parent); + } + } + } + + return "No documentation."; + } + + private SyntaxNode GetSymbolSyntaxNode(ISymbol symbol) + { + if (symbol != null) + { + var prop = symbol.GetType().GetProperty("SyntaxNode"); + + if (prop != null) + { + var node = prop.GetValue(symbol) as SyntaxNode; + + return node; + } + } + + return null; + } + + private List<KeyValuePair<String, String>> GetMethodSymbolParameters(ISymbol symbol) + { + List<KeyValuePair<String, String>> parameters = new List<KeyValuePair<string, string>>(); + + try + { + var prop = symbol.GetType().GetProperty("Parameters"); + + if (prop != null) + { + var array = prop.GetValue(symbol) as IEnumerable; + + foreach (var item in array) + { + var type = item.GetType().GetProperty("Type").GetValue(item).ToString(); + var value = item.GetType().GetProperty("Name").GetValue(item).ToString(); + + parameters.Add(new KeyValuePair<string, string>(type, value)); + } + } + } + catch { } + + return parameters; + } + + public String IndentCSharpCode(String code) + { + var tree = CSharpSyntaxTree.ParseText(code); + var root = tree.GetRoot().NormalizeWhitespace(); + var ret = root.ToFullString(); + return ret; + } } } diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptSymbol.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptSymbol.cs new file mode 100644 index 000000000..d6fdaeebf --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptSymbol.cs @@ -0,0 +1,31 @@ +using Microsoft.CodeAnalysis; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Parsing +{ + public class ScriptSymbol + { + public String Name { get; set; } + public String Type { get; set; } + public SymbolKind Kind { get; set; } + public String Class { get; set; } + public Accessibility Accessibility { get; set; } + public String ContainingNamespace { get; set; } + public List<KeyValuePair<String,String>> Parameters { get; set; } + public String Summary { get; set; } + + public ScriptSymbol() + { + Parameters = new List<KeyValuePair<string, string>>(); + } + + public override string ToString() + { + return $"{Kind.ToString()} : {Type} : {Name}"; + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptType.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptType.cs new file mode 100644 index 000000000..3ca34a85e --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Parsing/ScriptType.cs @@ -0,0 +1,23 @@ +using Microsoft.CodeAnalysis; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Scripting.Parsing +{ + public class ScriptType + { + public String Name { get; set; } + public TypeKind Kind { get; set; } + public List<ScriptSymbol> Symbols { get; set; } + public string ContainingNamespace { get; set; } + public String Summary { get; set; } + + public ScriptType() + { + Symbols = new List<ScriptSymbol>(); + } + } +} diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Tango.Scripting.csproj b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Tango.Scripting.csproj index 28425884a..081009e7e 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Tango.Scripting.csproj +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting/Tango.Scripting.csproj @@ -114,6 +114,9 @@ <Reference Include="System.Xml.XPath.XDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <HintPath>..\packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll</HintPath> </Reference> + <Reference Include="Tango.Core"> + <HintPath>..\..\..\Build\Core\Debug\Tango.Core.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="CompilationError.cs" /> @@ -121,7 +124,7 @@ <Compile Include="ExtensionMethods.cs" /> <Compile Include="GlobalObject.cs" /> <Compile Include="IScriptingEngine.cs" /> - <Compile Include="Parsing\DetectedType.cs" /> + <Compile Include="Parsing\ScriptType.cs" /> <Compile Include="ReferenceAssembly.cs" /> <Compile Include="Script.cs" /> <Compile Include="ScriptingEngine.cs" /> @@ -131,7 +134,7 @@ <Compile Include="ScriptSession.cs" /> <Compile Include="ScriptSessionStateChangedEventArgs.cs" /> <Compile Include="ScriptSessionState.cs" /> - <Compile Include="Parsing\ScriptVariable.cs" /> + <Compile Include="Parsing\ScriptSymbol.cs" /> </ItemGroup> <ItemGroup> <None Include="app.config" /> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/MainWindow.xaml b/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/MainWindow.xaml index e9cc002ba..56fe9da3c 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/MainWindow.xaml +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/MainWindow.xaml @@ -5,22 +5,10 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:editors="clr-namespace:Tango.Scripting.Editors;assembly=Tango.Scripting.Editors" xmlns:local="clr-namespace:TestApp" + xmlns:ide="clr-namespace:Tango.Scripting.IDE;assembly=Tango.Scripting.IDE" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="42"/> - <RowDefinition Height="377*"/> - </Grid.RowDefinitions> - - <StackPanel Orientation="Horizontal"> - <Button Padding="20 10" Click="Button_Click">START</Button> - <Button Padding="20 10" Click="Button_Click_1">STOP</Button> - <CheckBox Margin="10 0 0 0" VerticalAlignment="Center" IsChecked="{Binding ElementName=editor,Path=EnableFolding}">Enable Folding</CheckBox> - </StackPanel> - - <editors:ScriptEditor Grid.Row="1" x:Name="editor" Margin="0 5 0 0"> - - </editors:ScriptEditor> + <ide:ScriptIDEView/> </Grid> </Window> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/MainWindow.xaml.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/MainWindow.xaml.cs index 59bd4ef50..8ae84b20e 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/MainWindow.xaml.cs +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/MainWindow.xaml.cs @@ -34,7 +34,13 @@ namespace TestApp private async void Button_Click(object sender, RoutedEventArgs e) { Script s = new Script(); - s.Code = editor.Text; + s.Code = +@" +using System; +using System.Windows.Forms; + +MessageBox.Show(""Hi Roy""); +"; try { diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/TestApp.csproj b/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/TestApp.csproj index 1f264b981..ebcb2f004 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/TestApp.csproj +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/TestApp.csproj @@ -38,8 +38,14 @@ <Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL"> <HintPath>..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath> </Reference> + <Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> + <HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + </Reference> <Reference Include="System.Xml" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Core" /> @@ -103,6 +109,10 @@ <Project>{6c55b776-26d4-4db3-a6ab-87e783b2f3d1}</Project> <Name>Tango.Scripting.Editors</Name> </ProjectReference> + <ProjectReference Include="..\Tango.Scripting.IDE\Tango.Scripting.IDE.csproj"> + <Project>{c9f60285-91fb-4293-bcf5-164d76755cdd}</Project> + <Name>Tango.Scripting.IDE</Name> + </ProjectReference> <ProjectReference Include="..\Tango.Scripting\Tango.Scripting.csproj"> <Project>{1e938fd2-c669-4738-98c9-77f96ce4d451}</Project> <Name>Tango.Scripting</Name> diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/packages.config b/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/packages.config index f69b3c48f..893958c68 100644 --- a/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/packages.config +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/TestApp/packages.config @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net461" /> + <package id="MahApps.Metro" version="1.5.0" targetFramework="net461" /> </packages>
\ No newline at end of file |
