aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs1
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridView.xaml31
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridView.xaml.cs130
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridViewVM.cs31
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs2
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj8
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs17
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs26
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml18
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs11
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml14
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/FSEDialogViewVM.cs13
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml70
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs2
14 files changed, 335 insertions, 39 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs
index 97cf9a433..04287e765 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Contracts/ITestDesignerView.cs
@@ -12,5 +12,6 @@ namespace Tango.FSE.Stubs.Contracts
void FormatCode();
void HighlightCode(int position, int length);
void InsertCode(String code);
+ void InvalidateHighlighting();
}
}
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridView.xaml
new file mode 100644
index 000000000..0e7a1185b
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridView.xaml
@@ -0,0 +1,31 @@
+<UserControl x:Class="Tango.FSE.Stubs.Dialogs.ResultGridView"
+ 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:material="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:local="clr-namespace:Tango.FSE.Stubs.Dialogs"
+ mc:Ignorable="d"
+ Width="1000" Height="600" d:DataContext="{d:DesignInstance Type=local:ResultGridViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">
+ <Grid Margin="10">
+ <DockPanel>
+ <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
+ <material:PackIcon Kind="ViewGrid" Width="32" Height="32" />
+ <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargeFontSize}" VerticalAlignment="Center" Text="{Binding Result.Name}"></TextBlock>
+ </StackPanel>
+
+ <Border Margin="0 20 0 0" BorderThickness="1" BorderBrush="{StaticResource FSE_BorderBrush}" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" CornerRadius="5">
+ <DataGrid x:Name="grid"
+ CellStyle="{StaticResource FSE_DataGrid_Cell}"
+ Style="{StaticResource FSE_DataGrid}"
+ AutoGenerateColumns="False"
+ CanUserSortColumns="True"
+ CanUserReorderColumns="True"
+ CanUserResizeColumns="True"
+ CanUserResizeRows="True">
+
+ </DataGrid>
+ </Border>
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridView.xaml.cs
new file mode 100644
index 000000000..ab908f94f
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridView.xaml.cs
@@ -0,0 +1,130 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+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.FSE.Stubs.Dialogs
+{
+ /// <summary>
+ /// Interaction logic for ResultGridView.xaml
+ /// </summary>
+ public partial class ResultGridView : UserControl
+ {
+ public class ResultObject
+ {
+ public Object V0 { get; set; }
+ public Object V1 { get; set; }
+ public Object V2 { get; set; }
+ public Object V3 { get; set; }
+ public Object V4 { get; set; }
+ public Object V5 { get; set; }
+ public Object V6 { get; set; }
+ public Object V7 { get; set; }
+ public Object V8 { get; set; }
+ public Object V9 { get; set; }
+ public Object V10 { get; set; }
+ public Object V11 { get; set; }
+ public Object V12 { get; set; }
+ public Object V13 { get; set; }
+ public Object V14 { get; set; }
+ }
+
+ public ResultGridView()
+ {
+ InitializeComponent();
+
+ Loaded += ResultGridView_Loaded;
+ }
+
+ private void ResultGridView_Loaded(object sender, RoutedEventArgs e)
+ {
+ var vm = DataContext as ResultGridViewVM;
+ var results = vm.Items;
+
+ List<ResultObject> objects = new List<ResultObject>();
+
+ if (results.Count > 0)
+ {
+ var model = results.First();
+
+ if (model.GetType().IsValueTypeOrString())
+ {
+ grid.Columns.Add(new DataGridTextColumn()
+ {
+ Header = "Values",
+ Binding = new Binding("V0"),
+ });
+
+ foreach (var item in results)
+ {
+ objects.Add(new ResultObject()
+ {
+ V0 = item,
+ });
+ }
+ }
+ else
+ {
+ int columnCount = 0;
+
+ //Generate columns
+ foreach (var prop in model.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
+ {
+ grid.Columns.Add(new DataGridTextColumn()
+ {
+ Header = prop.Name,
+ Binding = new Binding($"V{columnCount++}"),
+ });
+ }
+
+ foreach (var field in model.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance))
+ {
+ grid.Columns.Add(new DataGridTextColumn()
+ {
+ Header = field.Name,
+ Binding = new Binding($"V{columnCount++}"),
+ });
+ }
+
+ //Generate cells
+
+ foreach (var item in results)
+ {
+ ResultObject obj = new ResultObject();
+
+ var properties = model.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList();
+ var fields = model.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance).ToList();
+
+ int propCount = 0;
+
+ for (int i = 0; i < properties.Count; i++)
+ {
+ typeof(ResultObject).GetProperty($"V{i}").SetValue(obj, properties[i].GetValue(item));
+ propCount++;
+ }
+
+ for (int i = 0; i < fields.Count; i++)
+ {
+ typeof(ResultObject).GetProperty($"V{i + propCount}").SetValue(obj, fields[i].GetValue(item));
+ }
+
+ objects.Add(obj);
+ }
+ }
+ }
+
+ grid.ItemsSource = objects;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridViewVM.cs
new file mode 100644
index 000000000..b6e45c208
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Dialogs/ResultGridViewVM.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.FSE.Common;
+
+namespace Tango.FSE.Stubs.Dialogs
+{
+ public class ResultGridViewVM : FSEDialogViewVM
+ {
+ public Result Result { get; set; }
+
+ public List<Object> Items { get; set; }
+
+ public ResultGridViewVM(Result result) : base()
+ {
+ CanCancel = false;
+ OKText = "CLOSE";
+
+ Result = result;
+ Items = new List<object>();
+
+ foreach (var item in Result.Value as IEnumerable)
+ {
+ Items.Add(item);
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs
index 813f31532..b75bf3c42 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Result.cs
@@ -14,7 +14,7 @@ namespace Tango.FSE.Stubs
public String Name { get; set; }
public Object Value { get; set; }
- internal bool IsValueArray
+ public bool IsValueArray
{
get { return Value != null && typeof(IEnumerable).IsAssignableFrom(Value.GetType()) && Value.GetType() != typeof(String); }
}
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj
index 67bd5dfc8..61dedf949 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj
@@ -110,6 +110,10 @@
<DependentUpon>LoadPublishedProjectView.xaml</DependentUpon>
</Compile>
<Compile Include="Dialogs\LoadPublishedProjectViewVM.cs" />
+ <Compile Include="Dialogs\ResultGridView.xaml.cs">
+ <DependentUpon>ResultGridView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Dialogs\ResultGridViewVM.cs" />
<Compile Include="Dialogs\UserInputDialogView.xaml.cs">
<DependentUpon>UserInputDialogView.xaml</DependentUpon>
</Compile>
@@ -247,6 +251,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Dialogs\ResultGridView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Dialogs\UserInputDialogView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs
index cc5cdfdc7..7c0b0e01f 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestDesignerViewVM.cs
@@ -179,6 +179,7 @@ namespace Tango.FSE.Stubs.ViewModels
public RelayCommand TogglePublishPanelCommand { get; set; }
public RelayCommand<Script> RenameLibraryCommand { get; set; }
public RelayCommand<CreateItem> CreateItemCommand { get; set; }
+ public RelayCommand<Result> DisplayResultGridCommand { get; set; }
#endregion
@@ -223,6 +224,7 @@ namespace Tango.FSE.Stubs.ViewModels
TogglePublishPanelCommand = new RelayCommand(() => IsPublishPanelOpened = !IsPublishPanelOpened);
RenameLibraryCommand = new RelayCommand<Script>(RenameLibrary);
CreateItemCommand = new RelayCommand<CreateItem>(AutoCreateItem);
+ DisplayResultGridCommand = new RelayCommand<Result>(DisplayResultGrid);
}
#endregion
@@ -637,6 +639,8 @@ namespace Tango.FSE.Stubs.ViewModels
}
InvalidateRelayCommands();
+
+ View.InvalidateHighlighting();
}
private async void OpenProject()
@@ -943,6 +947,19 @@ namespace Tango.FSE.Stubs.ViewModels
#endregion
+ #region Results
+
+ private void DisplayResultGrid(Result result)
+ {
+ if (result != null)
+ {
+ ResultGridViewVM vm = new ResultGridViewVM(result);
+ NotificationProvider.ShowDialog(vm);
+ }
+ }
+
+ #endregion
+
#region INavigationObjectReceiver
public async void OnNavigatedToWithObject(NavigationObject obj)
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs
index 6e4ec2b74..54e3d0f6d 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.Core.Commands;
using Tango.FSE.Common;
+using Tango.FSE.Stubs.Dialogs;
using Tango.FSE.Stubs.Messages;
using Tango.FSE.Stubs.Views;
@@ -82,10 +83,18 @@ namespace Tango.FSE.Stubs.ViewModels
set { _failedError = value; RaisePropertyChangedAuto(); }
}
+ private bool _isRunning;
+ public bool IsRunning
+ {
+ get { return _isRunning; }
+ set { _isRunning = value; RaisePropertyChangedAuto(); }
+ }
+
public RelayCommand<PublishedTestProject> EditProjectCommand { get; set; }
public RelayCommand<PublishedTestProject> RunProjectCommand { get; set; }
public RelayCommand StartProjectCommand { get; set; }
public RelayCommand StopProjectCommand { get; set; }
+ public RelayCommand<Result> DisplayResultGridCommand { get; set; }
public TestRunnerViewVM()
{
@@ -93,6 +102,7 @@ namespace Tango.FSE.Stubs.ViewModels
RunProjectCommand = new RelayCommand<PublishedTestProject>(RunProject);
StartProjectCommand = new RelayCommand(StartProject, () => ProjectRunner != null && ProjectRunner.CanRun);
StopProjectCommand = new RelayCommand(StopProject, () => ProjectRunner != null && ProjectRunner.IsRunning);
+ DisplayResultGridCommand = new RelayCommand<Result>(DisplayResultGrid);
_requiresReloadingOfProjects = true;
RegisterForMessage<TestProjectPublishedOrSuppressed>((x) => _requiresReloadingOfProjects = true);
@@ -102,6 +112,7 @@ namespace Tango.FSE.Stubs.ViewModels
{
try
{
+ IsRunning = true;
FailedError = null;
Results = new List<Result>();
Status = "Running...";
@@ -119,6 +130,10 @@ namespace Tango.FSE.Stubs.ViewModels
Status = "Failed";
FailedError = ex.FlattenMessage();
}
+ finally
+ {
+ IsRunning = false;
+ }
}
private void StopProject()
@@ -187,7 +202,7 @@ namespace Tango.FSE.Stubs.ViewModels
public override Task<bool> OnNavigateBackRequest()
{
- if (SelectedView == RunnerView.TestRunnerExecutionView)
+ if (SelectedView == RunnerView.TestRunnerExecutionView && !IsRunning)
{
SelectedView = RunnerView.TestRunnerCatalogView;
return Task.FromResult(false);
@@ -210,5 +225,14 @@ namespace Tango.FSE.Stubs.ViewModels
{
//Do nothing
}
+
+ private void DisplayResultGrid(Result result)
+ {
+ if (result != null)
+ {
+ ResultGridViewVM vm = new ResultGridViewVM(result);
+ NotificationProvider.ShowDialog(vm);
+ }
+ }
}
}
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml
index 97f8cea6b..9fc2d5b1f 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml
@@ -585,7 +585,23 @@
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="NAME" Binding="{Binding Name}" />
- <DataGridTextColumn Header="VALUE" Binding="{Binding Value}" Width="1*" />
+ <DataGridTemplateColumn Header="VALUE" Width="1*">
+ <DataGridTemplateColumn.CellTemplate>
+ <DataTemplate>
+ <Grid>
+ <TextBlock Visibility="{Binding IsValueArray,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Text="{Binding Value}"></TextBlock>
+ <StackPanel Orientation="Horizontal" Visibility="{Binding IsValueArray,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <TextBlock Foreground="{StaticResource FSE_GrayBrush}">
+ <Run>This test result contains</Run>
+ <Run Text="{Binding Value.Count,Mode=OneWay}"></Run>
+ <Run Text="Values."></Run>
+ </TextBlock>
+ <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.DisplayResultGridCommand}" CommandParameter="{Binding}" Height="22" Foreground="{StaticResource FSE_PrimaryAccentBrush}" Background="Transparent" BorderBrush="Transparent" Margin="0 -4 0 0">(Grid View)</Button>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+ </DataGridTemplateColumn.CellTemplate>
+ </DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</DockPanel>
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs
index b91ede833..60b215112 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestDesignerView.xaml.cs
@@ -58,5 +58,16 @@ namespace Tango.FSE.Stubs.Views
{
GetCurrentEditor()?.InsertCode(code);
}
+
+ public void InvalidateHighlighting()
+ {
+ Dispatcher.BeginInvoke(new Action(() =>
+ {
+ foreach (var editor in tabControl.FindVisualChildren<ScriptEditor>())
+ {
+ editor.InvalidateHighlighting();
+ }
+ }));
+ }
}
}
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml
index 53c0bff56..baee19f14 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml
@@ -6,6 +6,7 @@
xmlns:global="clr-namespace:Tango.FSE.Stubs"
xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels"
xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
xmlns:local="clr-namespace:Tango.FSE.Stubs.Views"
mc:Ignorable="d"
d:DesignHeight="720" d:DesignWidth="1280" d:DesignStyle="{StaticResource FSE_User_Control_Designer}" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">
@@ -135,7 +136,18 @@
</material:PackIcon>
<StackPanel Margin="15 0 0 0" VerticalAlignment="Center">
<TextBlock Text="{Binding Name}" ></TextBlock>
- <TextBlock Margin="0 2 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Value}"></TextBlock>
+ <Grid Margin="0 2 0 0">
+ <TextBlock Visibility="{Binding IsValueArray,Converter={StaticResource BooleanToVisibilityInverseConverter}}" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Value}"></TextBlock>
+
+ <StackPanel Orientation="Horizontal" Visibility="{Binding IsValueArray,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}">
+ <Run>This test result contains</Run>
+ <Run Text="{Binding Value.Count,Mode=OneWay}"></Run>
+ <Run Text="Values."></Run>
+ </TextBlock>
+ <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.DisplayResultGridCommand}" CommandParameter="{Binding}" Height="22" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" Background="Transparent" BorderBrush="Transparent" Margin="0 -4 0 0">(Grid View)</Button>
+ </StackPanel>
+ </Grid>
</StackPanel>
</DockPanel>
</DataTemplate>
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEDialogViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEDialogViewVM.cs
index e5bc8f8e8..bd0df575f 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEDialogViewVM.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEDialogViewVM.cs
@@ -52,12 +52,25 @@ namespace Tango.FSE.Common
set { _cancelText = value; RaisePropertyChangedAuto(); }
}
+ private bool _canCancel;
+ /// <summary>
+ /// Gets or sets a value indicating whether to display the cancel button.
+ /// When CanClose is set to false, the cancel button will also be hidden.
+ /// </summary>
+ public bool CanCancel
+ {
+ get { return _canCancel; }
+ set { _canCancel = value; RaisePropertyChangedAuto(); }
+ }
+
+
/// <summary>
/// Initializes a new instance of the <see cref="FSEDialogViewVM"/> class.
/// </summary>
public FSEDialogViewVM() : base()
{
AutoMode = true;
+ CanCancel = true;
Settings = SettingsManager.Default.GetOrCreate<FSESettings>();
}
}
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml
index 6982ee92a..724dc178a 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml
@@ -78,45 +78,45 @@
</Style>
</Border.Style>
<Grid>
- <DockPanel>
- <Rectangle DockPanel.Dock="Top" Height="2" Fill="{Binding ElementName=msgIcon,Path=Foreground}"></Rectangle>
<DockPanel>
- <material:PackIcon Margin="8 8 0 0" Width="16" Height="16" x:Name="msgIcon">
- <material:PackIcon.Style>
- <Style TargetType="material:PackIcon">
- <Setter Property="Foreground" Value="{StaticResource FSE_InfoBrush}"></Setter>
- <Setter Property="Kind" Value="InfoOutline"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Type}" Value="Warning">
- <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter>
- <Setter Property="Kind" Value="AlertOutline"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Type}" Value="Error">
- <Setter Property="Foreground" Value="{StaticResource FSE_ErrorBrush}"></Setter>
- <Setter Property="Kind" Value="AlertCircleOutline"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Type}" Value="Success">
- <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter>
- <Setter Property="Kind" Value="Check"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Type}" Value="Busy">
- <Setter Property="Foreground" Value="{StaticResource FSE_InfoBrush}"></Setter>
- <Setter Property="Kind" Value="Clock"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </material:PackIcon.Style>
- </material:PackIcon>
- <commonControls:IconButton Visibility="{Binding CanClose,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 -5 -3 0" Icon="Close" DockPanel.Dock="Right" Padding="8" Command="{Binding CloseCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"/>
+ <Rectangle DockPanel.Dock="Top" Height="2" Fill="{Binding ElementName=msgIcon,Path=Foreground}"></Rectangle>
+ <DockPanel>
+ <material:PackIcon Margin="8 8 0 0" Width="16" Height="16" x:Name="msgIcon">
+ <material:PackIcon.Style>
+ <Style TargetType="material:PackIcon">
+ <Setter Property="Foreground" Value="{StaticResource FSE_InfoBrush}"></Setter>
+ <Setter Property="Kind" Value="InfoOutline"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Type}" Value="Warning">
+ <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter>
+ <Setter Property="Kind" Value="AlertOutline"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Type}" Value="Error">
+ <Setter Property="Foreground" Value="{StaticResource FSE_ErrorBrush}"></Setter>
+ <Setter Property="Kind" Value="AlertCircleOutline"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Type}" Value="Success">
+ <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter>
+ <Setter Property="Kind" Value="Check"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Type}" Value="Busy">
+ <Setter Property="Foreground" Value="{StaticResource FSE_InfoBrush}"></Setter>
+ <Setter Property="Kind" Value="Clock"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </material:PackIcon.Style>
+ </material:PackIcon>
+ <commonControls:IconButton Visibility="{Binding CanClose,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 -5 -3 0" Icon="Close" DockPanel.Dock="Right" Padding="8" Command="{Binding CloseCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"/>
- <StackPanel Margin="10 8 0 0" Width="250">
+ <StackPanel Margin="10 8 0 0" Width="250">
<TextBlock TextWrapping="Wrap" Text="{Binding Title}" FontSize="{StaticResource FSE_SmallFontSize}"></TextBlock>
<TextBlock TextWrapping="Wrap" Margin="0 2 0 0" TextTrimming="CharacterEllipsis" Text="{Binding Message}" FontSize="{StaticResource FSE_SmallerFontSize}" Foreground="{StaticResource FSE_GrayBrush}"></TextBlock>
- </StackPanel>
+ </StackPanel>
+ </DockPanel>
</DockPanel>
- </DockPanel>
- <ProgressBar Height="Auto" Opacity="0.2" Width="Auto" IsIndeterminate="True" Visibility="{Binding IsProgress,Converter={StaticResource BooleanToVisibilityConverter}}" />
+ <ProgressBar Height="Auto" Opacity="0.2" Width="Auto" IsIndeterminate="True" Visibility="{Binding IsProgress,Converter={StaticResource BooleanToVisibilityConverter}}" />
</Grid>
</Border>
</DataTemplate>
@@ -169,7 +169,9 @@
<Grid DockPanel.Dock="Bottom" Visibility="{Binding DataContext.AutoMode,Converter={StaticResource BooleanToVisibilityConverter}}">
<Border Background="{StaticResource FSE_PrimaryBackgroundBrush}" CornerRadius="0 0 5 5" Padding="10">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
- <Button Height="40" MinWidth="150" Margin="0 0 5 0" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Command="{Binding DataContext.CloseCommand}" Visibility="{Binding DataContext.CanClose,Converter={StaticResource BooleanToVisibilityConverter}}" Content="{Binding DataContext.CancelText,TargetNullValue='CANCEL'}"></Button>
+ <Grid Margin="0 0 5 0" Visibility="{Binding DataContext.CanCancel,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <Button Height="40" MinWidth="150" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Command="{Binding DataContext.CloseCommand}" Visibility="{Binding DataContext.CanClose,Converter={StaticResource BooleanToVisibilityConverter}}" Content="{Binding DataContext.CancelText,TargetNullValue='CANCEL'}"></Button>
+ </Grid>
<Button x:Name="btnDialogOK" Height="40" MinWidth="150" IsDefault="{Binding DataContext.HasDefault}" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Command="{Binding DataContext.OKCommand}" Content="{Binding DataContext.OKText,TargetNullValue='OK'}"></Button>
</StackPanel>
</Border>
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs
index 2da7d3e46..7fd6d99e7 100644
--- a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs
@@ -1502,7 +1502,7 @@ namespace Tango.Scripting.Editors
// _isLoadingCachedAssemblies = false;
//}
- private void InvalidateHighlighting(bool loadKnownTypes = true)
+ public void InvalidateHighlighting(bool loadKnownTypes = true)
{
if (!_isLoadingTypes)
{