This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,174 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Browse" xml:space="preserve">
<value>Browse...</value>
</data>
<data name="ChannelCount" xml:space="preserve">
<value>Channels: </value>
</data>
<data name="Description" xml:space="preserve">
<value>Description: </value>
</data>
<data name="FileDate" xml:space="preserve">
<value>File Date: </value>
</data>
<data name="FileDateAscending" xml:space="preserve">
<value>File Date</value>
</data>
<data name="FileDateDescending" xml:space="preserve">
<value>File Date (Descending)</value>
</data>
<data name="IdAscending" xml:space="preserve">
<value>Test ID</value>
</data>
<data name="IdDescending" xml:space="preserve">
<value>Test ID (Descending)</value>
</data>
<data name="Refresh" xml:space="preserve">
<value>Refresh</value>
</data>
<data name="SetupNameAscending" xml:space="preserve">
<value>Test Setup</value>
</data>
<data name="SetupNameDescending" xml:space="preserve">
<value>Test Setup (Descending)</value>
</data>
<data name="Sort" xml:space="preserve">
<value>Sort: </value>
</data>
<data name="TestID" xml:space="preserve">
<value>Test ID: </value>
</data>
<data name="TestSetup" xml:space="preserve">
<value>Test Setup: </value>
</data>
<data name="TimeStamp" xml:space="preserve">
<value>Time Stamp: </value>
</data>
<data name="TimeStampAscending" xml:space="preserve">
<value>Time Stamp</value>
</data>
<data name="TimeStampDescending" xml:space="preserve">
<value>Time Stamp (Descending)</value>
</data>
<data name="Type" xml:space="preserve">
<value>Type: </value>
</data>
</root>

View File

@@ -0,0 +1,164 @@
using System;
using System.Collections.Generic;
using DTS.Common.Classes.Viewer.TestMetadata;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interface;
using DTS.Viewer.TestSummaryList.ViewModel;
using Prism.Events;
// ReSharper disable InconsistentNaming
// ReSharper disable UnassignedGetOnlyAutoProperty
namespace DTS.Viewer.TestSummaryList.Model
{
public class TestSummaryModel : IBaseModel
{
public ITestSummaryListViewModel Parent { get; set; }
public IEventAggregator _eventAggregator { get; set; }
/// <summary>
/// Returns list of Test Definition from DTS/Data folder
/// </summary>
/// <param name="path">Data folder</param>
/// <param name="file">.dts file</param>
/// <param name="Include">whether to set file as selected/included </param>
/// <returns></returns>
public void GetTestSummary(string path, string file, bool Include = false, bool selectAll = false)
{
Parent.IsBusy = true;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(true);
_eventAggregator.GetEvent<AppStatusExEvent>().Publish(new AppStatusExArg(AppStatusArg.Busy, "GetTestSummary"));
Dispatcher.CurrentDispatcher.InvokeAsync(async () =>
{
try
{
var tmd = new TestMetadataList();
if (!string.IsNullOrEmpty(path) && !Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
var list = await tmd.GetTestSummaryListAsync(Parent, path, file);
if (Parent.TestSummaryList.Any())
{
foreach (var l in list)
{
//http://manuscript.dts.local/f/cases/28164/Shift-T0-with-derive-ROI-from-ALL-does-not-shift-T0-for-ROI
//we need to check more than just id and setup name
//here I added the data type too (ROI/ALL) but ideally we would just use the filename
//the existing structure did not seem to have file name exposed so I just made use of one additional
//piece of data
if (Parent.TestSummaryList.Any(summ => summ.Id == l.Id && summ.SetupName == l.SetupName && summ.DataType == l.DataType))
{
var testToReplace = Parent.TestSummaryList.First(summ =>
summ.Id == l.Id && summ.SetupName == l.SetupName && summ.DataType == l.DataType);
var testIndex = Parent.TestSummaryList.IndexOf(testToReplace);
var isTestSelected = testToReplace.IsSelected;
Parent.SelectedTestSummaryList.Remove(testToReplace);
Parent.TestSummaryList.Remove(testToReplace);
Parent.TestSummaryList.Insert(testIndex, l);
Parent.TestSummaryList[testIndex].IsSelected = isTestSelected;
}
else
{
Parent.TestSummaryList.Add(l);
}
}
}
else
{
list.CollectionChanged += Parent.TestSummaryList_CollectionChanged;
Parent.TestSummaryList = list;
}
DetermineTestsSelected(selectAll);
_eventAggregator.GetEvent<TestLoadedCountNotification>().Publish(new TestLoadedCountNotificationArg { LoadedCount = Parent.TestSummaryList.Count, ParentVM = ((TestSummaryViewListModel)Parent).Parent });
Parent.IsBusy = false;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(false);
try
{
//put this in a try/catch because I'm putting it in as a new feature into a regression build and wanted to cut down
//the chances a new feature adding a crash
//16158 Browse button on View Data tab not functional
//this will select the test
//we don't need to select it if there's only one in the list as the code above will select it automatically if there's
//only one in the parent summary list
if (list.Any() && Include && Parent.TestSummaryList.Count != 1)
{
list[0].IsSelected = true;
}
}
catch (Exception) { }
}
catch (Exception ex)
{
MessageBox.Show("Error", ex.Message, MessageBoxButton.OK);
Parent.IsBusy = false;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(false);
}
finally
{
_eventAggregator.GetEvent<AppStatusExEvent>().Publish(new AppStatusExArg(AppStatusArg.Available, "GetTestSummary"));
}
}, DispatcherPriority.Background);
}
/// <summary>
/// 43387 - If called by Viewer, only select the first test, if called by Export, select all.
/// </summary>
/// <param name="selectAll"></param>
private void DetermineTestsSelected(bool selectAll)
{
if (selectAll)
{
foreach (var testSummaryList in Parent.TestSummaryList)
{
testSummaryList.IsSelected = true;
}
}
else
{
if (Parent.TestSummaryList.Count == 1)
{
Parent.TestSummaryList[0].IsSelected = true;
}
else if (Parent.TestSummaryList.Count > 1)
{
var names = Parent.TestSummaryList.Select(p => p.TestMetadata.TestSetup.SetupName).Distinct();
//http://manuscript.dts.local/f/cases/35546/Viewer-always-selects-first-dataset-after-making-modification-to-other-dataset
//don't select the all test if there are multiple tests involved, we are not in the view all step ...
if (1 == names.Count() && Parent.TestSummaryList.Any(p => p.DataType == "ALL"))
{
Parent.TestSummaryList[0].IsSelected = true;
}
}
}
}
///<summary>
///Occurs when a property value changes.
///</summary>
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public bool IsSaved { get; }
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 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("DTS.Viewer.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DTS.Viewer.Test")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[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)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b2b2b862-1b93-476a-8246-91e1310c7ec7")]
// 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")]

View File

@@ -0,0 +1,202 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Threading.Tasks;
using DTS.Common.Base;
using DTS.Common.Classes.TestMetadata;
using DTS.Common.Events;
using DTS.Common.Interface;
using DTS.Common.Interface.TestDefinition;
using DTS.Viewer.TestSummaryList.Model;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
// ReSharper disable ConvertToAutoProperty
namespace DTS.Viewer.TestSummaryList.ViewModel
{
public class TestSummaryViewModel : BaseViewModel<ITestSummaryListViewModel>, ITestSummaryListViewModel
{
public ITestSummaryListView TestSummaryListView { get; private set; }
private IBaseWindowModel Parent { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private IRegionManager _regionManager;
private IUnityContainer UnityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the TechnologyDoFrontEditViewModel.
/// </summary>
/// <param name="view">The TestListView View.</param>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The unityContainer.</param>
public TestSummaryViewModel(ITestSummaryListView view, IRegionManager regionManager, IEventAggregator eventAggregator,
IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
TestSummaryListView = view;
TestSummaryListView.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
UnityContainer = unityContainer;
_regionManager = regionManager;
_eventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
_eventAggregator.GetEvent<DataFolderChangedEvent>().Subscribe(OnDataFolderChanged);
}
#region Methods
public override void Initialize()
{
}
public override void Initialize(object parameter)
{
Parent = (IBaseWindowModel)parameter;
}
private void OnDataFolderChanged(string path)
{
if (String.IsNullOrEmpty(path)) return;
IsBusy = true;
_eventAggregator.GetEvent<ShowStatus>().Publish(new StatusInfo(StatusInfo.StatusState.Busy, "Please wait..."));
var td = new TestSummaryModel { Parent = this, _eventAggregator = _eventAggregator };
td.GetTestSummary(path);
}
/// <summary>
/// Private Event handler for RaiseNotification event.
/// </summary>
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
{
// Notification object expects a NotificationContentEventArgsWithoutTitle object and a Title string.
var eventArgsWithoutTitle = new NotificationContentEventArgs(eventArgsWithTitle.Message, eventArgsWithTitle.MessageDetails, eventArgsWithTitle.Image);
NotificationRequest.Raise(new Notification
{
Content = eventArgsWithoutTitle,
Title = eventArgsWithTitle.Title
});
}
public override void Activated()
{
throw new NotImplementedException();
}
public override void Cleanup()
{
throw new NotImplementedException();
}
public new Task CleanupAsync()
{
throw new NotImplementedException();
}
public override Task InitializeAsync()
{
throw new NotImplementedException();
}
public override Task InitializeAsync(object parameter)
{
throw new NotImplementedException();
}
public void PublishSelectedTestSummaryList()
{
_eventAggregator.GetEvent<TestSummaryChangeNotification>().Publish(SelectedTestSummaryList);
_eventAggregator.GetEvent<TestSelectedChangedEvent>().Publish(SelectedTestSummaryList.Count);
}
#endregion
#region ContextRegion
public object ContextNavigationRegion
{
get => ((TestSummaryView)TestSummaryListView).TestListRegion.Content;
set
{
((TestSummaryView)TestSummaryListView).TestListRegion.Content = value;
OnPropertyChanged("ContextNavigationRegion");
}
}
#endregion
#region Properties
private TestSummary _selectedTestSummary = new TestSummary();
public TestSummary SelectedTestSummary
{
get => _selectedTestSummary;
set { _selectedTestSummary = value; OnPropertyChanged("SelectedTestSummary"); }
}
private List<ITestSummary> _selectedTestSummaryList = new List<ITestSummary>();
public List<ITestSummary> SelectedTestSummaryList
{
get => _selectedTestSummaryList;
set { _selectedTestSummaryList = value; OnPropertyChanged("SelectedTestSummaryList"); }
}
private ObservableCollection<ITestSummary> _testSummaryList = new ObservableCollection<ITestSummary>();
public ObservableCollection<ITestSummary> TestSummaryList
{
get => _testSummaryList;
set { _testSummaryList = value; OnPropertyChanged("TestSummaryList"); }
}
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo => "TestSummaryRegion";
private bool _isBusy = false;
public new bool IsBusy
{
get => _isBusy;
set { _isBusy = value; OnPropertyChanged("IsBusy"); }
}
private bool _isDirty;
public new bool IsDirty
{
get => _isDirty;
set => _isDirty = value;
}
private bool _isNavigationIncluded;
public new bool IsNavigationIncluded
{
get => _isNavigationIncluded;
set => _isNavigationIncluded = value;
}
#endregion
}
}

View File

@@ -0,0 +1,128 @@
<base:BaseView x:Class="DTS.Viewer.TestSummaryList.TestSummaryListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:prism="http://prismlibrary.com/"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:strings="clr-namespace:DTS.Viewer.TestSummaryList"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<base:BaseView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/DTS.Common;component/Themes/CommonStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="Button" BasedOn="{StaticResource PageContentButton}">
<Setter Property="FontSize" Value="10" />
<Setter Property="Margin" Value="3,3" />
</Style>
<Style TargetType="TextBox" BasedOn="{StaticResource PageContentTextBoxStyle}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
<converters:DateTimeWithMillisecondsToStringConverter x:Key="dateToString" />
</ResourceDictionary>
</base:BaseView.Resources>
<Grid x:Name="TestListRegion" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="{strings:TranslateExtension Refresh}"
Command="{Binding Path=RefreshDataFolderCommand}"
AutomationProperties.AutomationId="RefreshTestsBtn" />
<Button Grid.Column="1" Content="{strings:TranslateExtension Browse}" HorizontalAlignment="Left"
Command="{Binding Path=SelectDataFolderCommand}" HorizontalContentAlignment="Center"
AutomationProperties.AutomationId="BrowseTestsBtn" />
<ContentControl Grid.Column="2" Content="{Binding FilterView}" IsEnabled="{Binding IsFilterEnabled}" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{strings:TranslateExtension Sort}" FontSize="12"/>
<ComboBox ItemsSource="{Binding SortableAttributes}" SelectedIndex="{Binding SelectedSortIndex}" Grid.Column="1" AutomationProperties.AutomationId="ComboBox_TestSummarySort"/>
</Grid>
<ListView x:Name="ListViewTestSummary" Grid.Row="2"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ItemsSource="{Binding FilteredTestSummaryList, Mode=TwoWay}"
SelectedItem="{Binding SelectedTestSummary, Mode=TwoWay}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
AutomationProperties.AutomationId="ListViewTestSummary"
SelectionMode="Single" KeyUp="TestSummary_KeyUp">
<ListView.ItemTemplate>
<DataTemplate>
<Border CornerRadius="0" BorderThickness="2" BorderBrush="Transparent" Margin="0 0 0 0">
<Grid Margin="0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<CheckBox Grid.Column="0" Grid.Row="0" x:Name="CheckBox_TestSummary" IsChecked="{Binding Path=IsSelected}" HorizontalAlignment="Left" Margin="0,2,0,0" AutomationProperties.AutomationId="CheckBox_IsSelected"/>
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal">
<Expander IsExpanded="False" x:Name="Expander_TestSummary" FontSize="14" Margin="2,0,0,0"
AutomationProperties.AutomationId="Expander_TestSummary">
<Expander.Header>
<TextBlock Text="{Binding Id, FallbackValue=Id}" />
</Expander.Header>
<Grid Margin="23,0,0,0">
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" Text="{strings:TranslateExtension TestSetup}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding SetupName, FallbackValue=SetupName}" Margin="5,0" AutomationProperties.AutomationId="Label_SetupName" />
<TextBlock Grid.Column="0" Grid.Row="1" Text="{strings:TranslateExtension FileDate}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding FileDate, FallbackValue=FileDate}" Margin="5,0" AutomationProperties.AutomationId="Label_FileDate"/>
<TextBlock Grid.Column="0" Grid.Row="2" Text="{strings:TranslateExtension TimeStamp}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="2" Text="{Binding TimeStamp, FallbackValue=TimeStamp, Converter={StaticResource dateToString}}" Margin="5,0" AutomationProperties.AutomationId="Label_TimeStamp"/>
<TextBlock Grid.Column="0" Grid.Row="3" Text="{strings:TranslateExtension Type}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="3" Text="{Binding DataType, FallbackValue=DataType}" Margin="5,0" AutomationProperties.AutomationId="Label_DataType"/>
<TextBlock Grid.Column="0" Grid.Row="4" Text="{strings:TranslateExtension ChannelCount}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="4" Text="{Binding ChannelCount, FallbackValue=ChannelCount}" Margin="5,0" AutomationProperties.AutomationId="Label_ChannelCount"/>
<TextBlock Grid.Column="0" Grid.Row="5" Text="{strings:TranslateExtension Description}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="5" Text="{Binding Description, FallbackValue=Description}" Margin="5,0" TextWrapping="Wrap" AutomationProperties.AutomationId="Label_Description"/>
</Grid>
</Expander>
</StackPanel>
</Grid>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</base:BaseView>

View File

@@ -0,0 +1,120 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,139 @@
using System;
using System.Windows.Media.Imaging;
using DTS.Common;
using DTS.Common.Interface;
using DTS.Viewer.TestSummaryList;
using DTS.Viewer.TestSummaryList.ViewModel;
using Prism.Ioc;
using Prism.Modularity;
using Unity;
// ReSharper disable RedundantAttributeUsageProperty
// ReSharper disable UnusedParameter.Local
[assembly: TestSummaryListModuleName()]
[assembly: TestSummaryListModuleImageAttribute()]
namespace DTS.Viewer.TestSummaryList
{
[Module(ModuleName = "TestSummaryList")]
public class TestSummaryListModule : IModule
{
/// <summary>
/// Injected unity container
/// </summary>
private readonly IUnityContainer _unityContainer;
/// <summary>
/// Initializes a new instance of the <see cref="TestSummaryListModule"/> class.
/// </summary>
/// <param name="unityContainer">Obtained reference of the unity container by using dependency injection.</param>
public TestSummaryListModule(IUnityContainer unityContainer)
{
_unityContainer = unityContainer;
}
public void Initialize()
{
// Register View & View-Model with Unity dependency injection container as a singleton.
_unityContainer.RegisterType<ITestSummaryListView, TestSummaryListView>();
_unityContainer.RegisterType<ITestSummaryListViewModel, TestSummaryViewListModel>();
}
public void OnInitialized(IContainerProvider containerProvider)
{
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
Initialize();
}
}
/// <summary>
/// Attribute class contains assembly name
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class TestSummaryListModuleNameAttribute : TextAttribute
{
public TestSummaryListModuleNameAttribute() : this(null) { }
public TestSummaryListModuleNameAttribute(string s)
{
AssemblyName = AssemblyNames.TestSummaryList.ToString();
}
public override string AssemblyName { get; }
public override Type GetAttributeType()
{
return typeof(TextAttribute);
}
public override string GetAssemblyName()
{
return AssemblyName;
}
}
/// <summary>
/// Attribute class contains assembly image and name - used on the Main screen to display available components
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class TestSummaryListModuleImageAttribute : ImageAttribute
{
private BitmapImage _img;
public TestSummaryListModuleImageAttribute() : this(null) { }
public override BitmapImage AssemblyImage
{
get { _img = AssemblyInfo.GetImage(AssemblyNames.TestSummaryList.ToString()); return _img; }
}
public TestSummaryListModuleImageAttribute(string s)
{
_img = AssemblyInfo.GetImage(AssemblyNames.TestSummaryList.ToString());
}
public override Type GetAttributeType()
{
return typeof(ImageAttribute);
}
public override BitmapImage GetAssemblyImage()
{
return AssemblyImage;
}
private string _name;
public override string AssemblyName
{
get { _name = AssemblyNames.TestSummaryList.ToString(); return _name; }
}
public override string GetAssemblyName()
{
return AssemblyName;
}
private string _group;
public override string AssemblyGroup
{
get { _group = eAssemblyGroups.Viewer.ToString(); return _group; }
}
public override string GetAssemblyGroup()
{
return AssemblyGroup;
}
private eAssemblyRegion _region;
public override eAssemblyRegion AssemblyRegion
{
get { _region = eAssemblyRegion.TestSummaryRegion; return _region; }
}
public override eAssemblyRegion GetAssemblyRegion()
{
return AssemblyRegion;
}
}
}

View File

@@ -0,0 +1,15 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
<ResourceDictionary x:Key="GenericResourceDictionary">
<ResourceDictionary.MergedDictionaries>
<!-- Common base theme -->
<!--<ResourceDictionary Source="pack://application:,,,/Another.AssemblyName;component/YourResDictionaryFolder/OtherStyles.xaml" />-->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -0,0 +1,16 @@
using DTS.Common.Interface;
namespace DTS.Viewer.TestSummaryList
{
/// <summary>
/// Interaction logic for TestListView.xaml
/// </summary>
public partial class TestSummaryView : ITestSummaryListView
{
public TestSummaryView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,419 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Threading;
using DTS.Common.Base;
using DTS.Common.Classes.Viewer.TestMetadata;
using DTS.Common.Events;
using DTS.Common.Interactivity;
using DTS.Common.Interface;
using DTS.Common.Interface.TestDefinition;
using DTS.Viewer.TestSummaryList.Model;
using DTS.Viewer.TestSummaryList.Resources;
using Prism.Commands;
using Prism.Events;
using Prism.Regions;
using Unity;
namespace DTS.Viewer.TestSummaryList.ViewModel
{
public class TestSummaryViewListModel : BaseViewModel<ITestSummaryListViewModel>, ITestSummaryListViewModel
{
public IFilterView FilterView { get; private set; }
public ITestSummaryListView View { get; set; }
internal IBaseViewModel Parent { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the TestSummaryViewListModel.
/// </summary>
/// <param name="view">The TestSummaryList View interface.</param>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The unityContainer.</param>
public TestSummaryViewListModel(ITestSummaryListView view, IRegionManager regionManager, IEventAggregator eventAggregator,
IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
View = view;
View.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
}
#region Methods
public override void Initialize()
{
}
public override void Initialize(object parameter)
{
Parent = (IBaseViewModel)parameter;
FilterView = GetFilterView(this);
TestSummaryList.CollectionChanged += TestSummaryList_CollectionChanged;
FilteredTestSummaryList.CollectionChanged += TestSummaryList_CollectionChanged;
Subscribe();
}
private void Subscribe()
{
_eventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
_eventAggregator.GetEvent<DataFolderChangedEvent>().Subscribe(OnDataFolderChanged);
_eventAggregator.GetEvent<FilterParameterChangedEvent>().Subscribe(OnFilterChanged);
_eventAggregator.GetEvent<RefreshTestRequestEvent>().Subscribe(OnRefreshTestRequest);
}
public void OnFilterChanged(FilterParameterArgs args)
{
if (((IFilterViewModel)FilterView.DataContext).Parent == this)
{
FilteredTestSummaryList = string.IsNullOrEmpty(args.Param) ? new ObservableCollection<ITestSummary>(TestSummaryList)
: new ObservableCollection<ITestSummary>((from x in TestSummaryList where x.SetupName.ToLower().Contains(args.Param.ToLower()) || x.Id.ToLower().Contains(args.Param.ToLower()) || x.Description.ToLower().Contains(args.Param.ToLower()) select x).ToList());
}
}
private void OnDataFolderChanged(DataFolderSelectionArg arg)
{
if (Parent != arg.ParentVM) return;
var path = arg.Path;
var file = arg.File;
if (string.IsNullOrEmpty(path) && string.IsNullOrEmpty(file)) return;
if (!string.IsNullOrEmpty(path) && string.IsNullOrEmpty(file)) { Cleanup(); }
_selectedDataFolder = path;
_selectedDataFile = file;
IsBusy = true;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(true);
var td = new TestSummaryModel { Parent = this, _eventAggregator = _eventAggregator };
td.GetTestSummary(path, file, arg.SetSelected, arg.SelectAll);
}
/// <summary>
/// Private Event handler for RaiseNotification event.
/// </summary>
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
{
// Notification object expects a NotificationContentEventArgsWithoutTitle object and a Title string.
var eventArgsWithoutTitle = new NotificationContentEventArgs(eventArgsWithTitle.Message, eventArgsWithTitle.MessageDetails, eventArgsWithTitle.Image);
NotificationRequest.Raise(new Notification
{
Content = eventArgsWithoutTitle,
Title = eventArgsWithTitle.Title
});
}
public override void Activated()
{
var fp = new FilterParameterArgs
{
Param = string.Empty,
Requester = this
};
_eventAggregator.GetEvent<FilterParameterChangedEvent>().Publish(fp);
}
public override void Cleanup()
{
TestSummaryList.Clear();
SelectedTestSummaryList.Clear();
FilteredTestSummaryList.Clear();
SelectedTestSummary = new TestSummary();
PublishSelectedTestSummaryList();
}
public void PublishSelectedTestSummaryList()
{
_eventAggregator.GetEvent<TestSummaryChangeNotification>().Publish(new TestSummaryChangeNotificationArg { SummaryList = SelectedTestSummaryList, ParentVM = Parent, TotalSummaryCount = TestSummaryList.Count });
_eventAggregator.GetEvent<TestSummaryCountNotification>().Publish(new TestSummaryCountNotificationArg { SummaryCount = SelectedTestSummaryList.Count, ParentVM = Parent });
_eventAggregator.GetEvent<ResetZoomChangedEvent>().Publish(true);
}
#endregion
#region ContextRegion
public object ContextNavigationRegion
{
get => ((TestSummaryListView)View).TestListRegion.DataContext;
set { ((TestSummaryListView)View).TestListRegion.DataContext = value; OnPropertyChanged("ContextNavigationRegion"); }
}
private IFilterView GetFilterView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IFilterView>();
var viewModel = _unityContainer.Resolve<IFilterViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
#endregion
#region Properties
private bool _isFilterEnabled = false;
public bool IsFilterEnabled { get => _isFilterEnabled; set { _isFilterEnabled = value; OnPropertyChanged("IsFilterEnabled"); } }
private TestSummary _selectedTestSummary = new TestSummary();
public TestSummary SelectedTestSummary
{
get => _selectedTestSummary;
set { _selectedTestSummary = value; OnPropertyChanged("SelectedTestSummary"); }
}
private List<ITestSummary> _selectedTestSummaryList = new List<ITestSummary>();
public List<ITestSummary> SelectedTestSummaryList
{
get => _selectedTestSummaryList;
set { _selectedTestSummaryList = value; OnPropertyChanged("SelectedTestSummaryList"); }
}
private ObservableCollection<ITestSummary> _testSummaryList = new ObservableCollection<ITestSummary>();
public ObservableCollection<ITestSummary> TestSummaryList
{
get => _testSummaryList;
set
{
_testSummaryList = value;
IsFilterEnabled = _testSummaryList.Count > 0;
FilteredTestSummaryList = new ObservableCollection<ITestSummary>(_testSummaryList);
OnPropertyChanged("TestSummaryList");
}
}
public void TestSummaryList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.OldItems != null)
{
foreach (INotifyPropertyChanged item in e.OldItems)
item.PropertyChanged -= TestSummaryList_PropertyChanged;
}
if (e.NewItems != null)
{
foreach (INotifyPropertyChanged item in e.NewItems)
item.PropertyChanged += TestSummaryList_PropertyChanged;
}
IsFilterEnabled = _testSummaryList.Count > 0;
FilteredTestSummaryList = new ObservableCollection<ITestSummary>(_testSummaryList);
SortTestSummaryList();
}
private void TestSummaryList_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "TestSummaryList")
{
IsFilterEnabled = _testSummaryList.Count > 0;
FilteredTestSummaryList = new ObservableCollection<ITestSummary>(_testSummaryList);
}
}
private ObservableCollection<ITestSummary> _filteredTestSummaryList = new ObservableCollection<ITestSummary>();
public ObservableCollection<ITestSummary> FilteredTestSummaryList
{
get => _filteredTestSummaryList;
set { _filteredTestSummaryList = value; OnPropertyChanged("FilteredTestSummaryList"); }
}
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo => "TestSummaryRegion";
private bool _isBusy = false;
public new bool IsBusy
{
get => _isBusy;
set { _isBusy = value; OnPropertyChanged("IsBusy"); }
}
private bool _isDirty;
public new bool IsDirty
{
get => _isDirty;
set => _isDirty = value;
}
private bool _isNavigationIncluded;
public new bool IsNavigationIncluded
{
get => _isNavigationIncluded;
set => _isNavigationIncluded = value;
}
private string _selectedDataFolder = string.Empty;
public string SelectedDataFolder
{
get => _selectedDataFolder;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFolder = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = _selectedDataFolder, File = string.Empty, SelectAll = false, ParentVM = Parent }); OnPropertyChanged("SelectedDataFolder");
}
}
private string _selectedDataFile = string.Empty;
public string SelectedDataFile
{
get => _selectedDataFile;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFile = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = string.Empty, File = _selectedDataFile, SelectAll = false, ParentVM = Parent }); OnPropertyChanged("SelectedDataFile");
}
}
#endregion
#region Commands
private DelegateCommand _refreshDataFolderCommand;
public DelegateCommand RefreshDataFolderCommand => _refreshDataFolderCommand ?? (_refreshDataFolderCommand = new DelegateCommand(RefreshDataFolder));
private DelegateCommand _selectDataFolderCommand;
public DelegateCommand SelectDataFolderCommand => _selectDataFolderCommand ?? (_selectDataFolderCommand = new DelegateCommand(SelectDataFolder));
private void RefreshDataFolder()
{
Dispatcher.CurrentDispatcher.Invoke(() =>
{
_eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = _selectedDataFolder, File = string.Empty, SelectAll = false, ParentVM = Parent });
}, DispatcherPriority.Background);
}
private void SelectDataFolder()
{
const string fileExt = "DTS Files (*.dts)|*.dts";
var fileDialog = new System.Windows.Forms.OpenFileDialog { Filter = fileExt };
var result = fileDialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
{
//16158 Browse button on View Data tab not functiona
//((IViewerMainViewModel) Parent).SelectAndIncludeDataFile(fileDialog.FileName);
_eventAggregator.GetEvent<DataFileSelectedEvent>().Publish(new DataFileSelectionArg { File = fileDialog.FileName, ParentVM = Parent });
}
}
private void OnRefreshTestRequest(string file)
{
var td = new TestSummaryModel { Parent = this, _eventAggregator = _eventAggregator };
td.GetTestSummary(string.Empty, file);
}
#endregion Commands
public enum SortableAttribute
{
TimeStampDescending,
Timestamp,
FileDateDescending,
FileDate,
IdDescending,
Id,
TestSetupDescending,
TestSetup
}
public List<string> SortableAttributes
{
get
{
var rv = new List<string>();
foreach (var sortableAttribute in Enum.GetValues(typeof(SortableAttribute)).Cast<SortableAttribute>().ToList())
{
rv.Add(new SortableAttributeHelper(sortableAttribute).ToString());
}
return rv;
}
}
private int _selctedSortIndex = (int)SortableAttribute.TimeStampDescending;
public int SelectedSortIndex
{
get => _selctedSortIndex;
set
{
_selctedSortIndex = value;
SortTestSummaryList();
}
}
private void SortTestSummaryList()
{
var rv = new ITestSummary[FilteredTestSummaryList.Count];
switch ((SortableAttribute)_selctedSortIndex)
{
default:
case SortableAttribute.TimeStampDescending:
FilteredTestSummaryList.OrderByDescending(x => x.TimeStamp.Ticks).ToList().CopyTo(rv);
break;
case SortableAttribute.Timestamp:
FilteredTestSummaryList.OrderBy(x => x.TimeStamp.Ticks).ToList().CopyTo(rv);
break;
case SortableAttribute.FileDateDescending:
FilteredTestSummaryList.OrderByDescending(x => x.FileDate.Ticks).ToList().CopyTo(rv);
break;
case SortableAttribute.FileDate:
FilteredTestSummaryList.OrderBy(x => x.FileDate.Ticks).ToList().CopyTo(rv);
break;
case SortableAttribute.IdDescending:
FilteredTestSummaryList.OrderByDescending(x => x.Id).ToList().CopyTo(rv);
break;
case SortableAttribute.Id:
FilteredTestSummaryList.OrderBy(x => x.Id).ToList().CopyTo(rv);
break;
case SortableAttribute.TestSetupDescending:
FilteredTestSummaryList.OrderByDescending(x => x.SetupName).ToList().CopyTo(rv);
break;
case SortableAttribute.TestSetup:
FilteredTestSummaryList.OrderBy(x => x.SetupName).ToList().CopyTo(rv);
break;
}
FilteredTestSummaryList.Clear();
foreach (var testSummary in rv)
{
FilteredTestSummaryList.Add(testSummary);
}
}
public class SortableAttributeHelper
{
public SortableAttributeHelper(SortableAttribute attribute)
{
_attribute = attribute;
}
private SortableAttribute _attribute;
public SortableAttribute Attribute
{
get => _attribute;
set => _attribute = value;
}
public override string ToString()
{
return StringResources.ResourceManager.GetString(_attribute.ToString()) ?? _attribute.ToString();
}
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Windows.Markup;
using DTS.Viewer.TestSummaryList.Resources;
namespace DTS.Viewer.TestSummaryList
{
[MarkupExtensionReturnType(typeof(string))]
public class TranslateExtension : MarkupExtension
{
private readonly string _key;
public TranslateExtension(string key) { _key = key; }
private const string NotFound = "#stringnotfound#";
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (string.IsNullOrEmpty(_key)) { return NotFound; }
return StringResources.ResourceManager.GetString(_key) ?? NotFound + " " + _key;
}
}
}

View File

@@ -0,0 +1,159 @@
<?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>{B2B2B862-1B93-476A-8246-91E1310C7EC7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DTS.Viewer.TestSummaryList</RootNamespace>
<AssemblyName>DTS.Viewer.TestSummaryList</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xaml.Behaviors">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Prism">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.Unity.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Unity.Wpf.dll</HintPath>
</Reference>
<Reference Include="Prism.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Unity.Abstractions">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Unity.Container">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Container.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="Xceed.Wpf.DataGrid">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.DataGrid.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Model\TestSummaryModel.cs" />
<Compile Include="Resources\StringResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>StringResources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\StringResources.ja.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>StringResources.ja.resx</DependentUpon>
</Compile>
<Compile Include="Resources\TranslateExtension.cs" />
<Compile Include="TestSummaryListModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModel\TestSummaryViewListModel.cs" />
<Compile Include="View\TestSummaryListView.xaml.cs">
<DependentUpon>TestSummaryListView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Include="Resources\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\TestSummaryListView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\DTS.Common.Core\DTS.Common.Core.csproj">
<Project>{fab1f470-1574-4301-b56e-d3364aa93679}</Project>
<Name>DTS.Common.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common\DTS.Common.csproj">
<Project>{114edc77-f3b5-4576-a91b-40818d503b55}</Project>
<Name>DTS.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\StringResources.ja.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringResources.ja.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\StringResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringResources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,86 @@
<base:BaseView x:Class="DTS.Viewer.TestSummaryList.TestSummaryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">
<ContentControl x:Name="TestListRegion" Background="LightGray" Width="Auto">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<xcdg:DataGridControl x:Name="_dataGridTestSummary" ItemsSource="{Binding TestSummaryList}"
AllowDrag="False" AutoCreateColumns="False" SelectedItem="{Binding SelectedTestSummary}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" Width="Auto">
<xcdg:DataGridControl.ReadOnly>True</xcdg:DataGridControl.ReadOnly>
<xcdg:DataGridControl.View>
<xcdg:TableflowView UseDefaultHeadersFooters="False">
<xcdg:TableflowView.FixedHeaders>
<DataTemplate>
<xcdg:ColumnManagerRow />
</DataTemplate>
</xcdg:TableflowView.FixedHeaders>
</xcdg:TableflowView>
</xcdg:DataGridControl.View>
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="." Title="" Width="22" >
<xcdg:Column.CellContentTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Path=IsSelected}" HorizontalAlignment="Center"
Command="{Binding IsSelectedCommand}">
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="IsChecked">
<i:InvokeCommandAction Command="{Binding IsSelectedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>-->
</CheckBox>
</DataTemplate>
</xcdg:Column.CellContentTemplate>
</xcdg:Column>
<xcdg:Column FieldName="Id" Title="Id" Width="160" />
<xcdg:Column FieldName="Name" Title="Name" Width="*" MaxWidth="200" />
<xcdg:Column FieldName="Description" Title="Description" Width="160" />
<xcdg:Column FieldName="ChannelCount" Title="Channel Count" Width="90" />
<xcdg:Column FieldName="TestDate" Title="Date" Width="100" />
<xcdg:Column FieldName="DataType" Title="Type" Width="60" />
</xcdg:DataGridControl.Columns>
</xcdg:DataGridControl>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</base:BaseView>

View File

@@ -0,0 +1,35 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using DTS.Common.Classes.Viewer.TestMetadata;
using DTS.Common.Interface;
using DTS.Common.Interface.TestDefinition;
// ReSharper disable CheckNamespace
namespace DTS.Viewer.TestSummaryList
{
/// <summary>
/// Interaction logic for TestSummaryListView.xaml
/// </summary>
public partial class TestSummaryListView : ITestSummaryListView
{
public TestSummaryListView()
{
InitializeComponent();
}
private void TestSummary_KeyUp(object sender, KeyEventArgs e)
{
if ((sender as ListView)?.SelectedItem is TestSummary ts)
{
if (e.Key == Key.Space)
{
ts.IsSelected = !ts.IsSelected;
e.Handled = true;
}
}
else { e.Handled = false; }
}
}
}

View File

@@ -0,0 +1,225 @@
//------------------------------------------------------------------------------
// <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 DTS.Viewer.TestSummaryList.Resources {
using System;
/// <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", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class StringResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal StringResources() {
}
/// <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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DTS.Viewer.TestSummaryList.Resources.StringResources", typeof(StringResources).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;
}
}
/// <summary>
/// Looks up a localized string similar to Browse....
/// </summary>
internal static string Browse {
get {
return ResourceManager.GetString("Browse", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Channels: .
/// </summary>
internal static string ChannelCount {
get {
return ResourceManager.GetString("ChannelCount", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Description: .
/// </summary>
internal static string Description {
get {
return ResourceManager.GetString("Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File Date: .
/// </summary>
internal static string FileDate {
get {
return ResourceManager.GetString("FileDate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File Date.
/// </summary>
internal static string FileDateAscending {
get {
return ResourceManager.GetString("FileDateAscending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File Date (Descending).
/// </summary>
internal static string FileDateDescending {
get {
return ResourceManager.GetString("FileDateDescending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test ID.
/// </summary>
internal static string IdAscending {
get {
return ResourceManager.GetString("IdAscending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test ID (Descending).
/// </summary>
internal static string IdDescending {
get {
return ResourceManager.GetString("IdDescending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Refresh.
/// </summary>
internal static string Refresh {
get {
return ResourceManager.GetString("Refresh", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test Setup.
/// </summary>
internal static string SetupNameAscending {
get {
return ResourceManager.GetString("SetupNameAscending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test Setup (Descending).
/// </summary>
internal static string SetupNameDescending {
get {
return ResourceManager.GetString("SetupNameDescending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sort: .
/// </summary>
internal static string Sort {
get {
return ResourceManager.GetString("Sort", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test ID: .
/// </summary>
internal static string TestID {
get {
return ResourceManager.GetString("TestID", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test Setup: .
/// </summary>
internal static string TestSetup {
get {
return ResourceManager.GetString("TestSetup", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time Stamp: .
/// </summary>
internal static string TimeStamp {
get {
return ResourceManager.GetString("TimeStamp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time Stamp.
/// </summary>
internal static string TimeStampAscending {
get {
return ResourceManager.GetString("TimeStampAscending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time Stamp (Descending).
/// </summary>
internal static string TimeStampDescending {
get {
return ResourceManager.GetString("TimeStampDescending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Type: .
/// </summary>
internal static string Type {
get {
return ResourceManager.GetString("Type", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,159 @@
<?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>{B2B2B862-1B93-476A-8246-91E1310C7EC7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DTS.Viewer.TestSummaryList</RootNamespace>
<AssemblyName>DTS.Viewer.TestSummaryList</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xaml.Behaviors">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Prism">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.Unity.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Unity.Wpf.dll</HintPath>
</Reference>
<Reference Include="Prism.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Unity.Abstractions">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Unity.Container">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Container.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="Xceed.Wpf.DataGrid">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.DataGrid.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Model\TestSummaryModel.cs" />
<Compile Include="Resources\StringResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>StringResources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\StringResources.ja.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>StringResources.ja.resx</DependentUpon>
</Compile>
<Compile Include="Resources\TranslateExtension.cs" />
<Compile Include="TestSummaryListModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModel\TestSummaryViewListModel.cs" />
<Compile Include="View\TestSummaryListView.xaml.cs">
<DependentUpon>TestSummaryListView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Include="Resources\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\TestSummaryListView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\DTS.Common.Core\DTS.Common.Core.csproj">
<Project>{fab1f470-1574-4301-b56e-d3364aa93679}</Project>
<Name>DTS.Common.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common\DTS.Common.csproj">
<Project>{114edc77-f3b5-4576-a91b-40818d503b55}</Project>
<Name>DTS.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\StringResources.ja.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringResources.ja.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\StringResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringResources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,164 @@
using System;
using System.Collections.Generic;
using DTS.Common.Classes.Viewer.TestMetadata;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interface;
using DTS.Viewer.TestSummaryList.ViewModel;
using Prism.Events;
// ReSharper disable InconsistentNaming
// ReSharper disable UnassignedGetOnlyAutoProperty
namespace DTS.Viewer.TestSummaryList.Model
{
public class TestSummaryModel : IBaseModel
{
public ITestSummaryListViewModel Parent { get; set; }
public IEventAggregator _eventAggregator { get; set; }
/// <summary>
/// Returns list of Test Definition from DTS/Data folder
/// </summary>
/// <param name="path">Data folder</param>
/// <param name="file">.dts file</param>
/// <param name="Include">whether to set file as selected/included </param>
/// <returns></returns>
public void GetTestSummary(string path, string file, bool Include = false, bool selectAll = false)
{
Parent.IsBusy = true;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(true);
_eventAggregator.GetEvent<AppStatusExEvent>().Publish(new AppStatusExArg(AppStatusArg.Busy, "GetTestSummary"));
Dispatcher.CurrentDispatcher.InvokeAsync(async () =>
{
try
{
var tmd = new TestMetadataList();
if (!string.IsNullOrEmpty(path) && !Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
var list = await tmd.GetTestSummaryListAsync(Parent, path, file);
if (Parent.TestSummaryList.Any())
{
foreach (var l in list)
{
//http://manuscript.dts.local/f/cases/28164/Shift-T0-with-derive-ROI-from-ALL-does-not-shift-T0-for-ROI
//we need to check more than just id and setup name
//here I added the data type too (ROI/ALL) but ideally we would just use the filename
//the existing structure did not seem to have file name exposed so I just made use of one additional
//piece of data
if (Parent.TestSummaryList.Any(summ => summ.Id == l.Id && summ.SetupName == l.SetupName && summ.DataType == l.DataType))
{
var testToReplace = Parent.TestSummaryList.First(summ =>
summ.Id == l.Id && summ.SetupName == l.SetupName && summ.DataType == l.DataType);
var testIndex = Parent.TestSummaryList.IndexOf(testToReplace);
var isTestSelected = testToReplace.IsSelected;
Parent.SelectedTestSummaryList.Remove(testToReplace);
Parent.TestSummaryList.Remove(testToReplace);
Parent.TestSummaryList.Insert(testIndex, l);
Parent.TestSummaryList[testIndex].IsSelected = isTestSelected;
}
else
{
Parent.TestSummaryList.Add(l);
}
}
}
else
{
list.CollectionChanged += Parent.TestSummaryList_CollectionChanged;
Parent.TestSummaryList = list;
}
DetermineTestsSelected(selectAll);
_eventAggregator.GetEvent<TestLoadedCountNotification>().Publish(new TestLoadedCountNotificationArg { LoadedCount = Parent.TestSummaryList.Count, ParentVM = ((TestSummaryViewListModel)Parent).Parent });
Parent.IsBusy = false;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(false);
try
{
//put this in a try/catch because I'm putting it in as a new feature into a regression build and wanted to cut down
//the chances a new feature adding a crash
//16158 Browse button on View Data tab not functional
//this will select the test
//we don't need to select it if there's only one in the list as the code above will select it automatically if there's
//only one in the parent summary list
if (list.Any() && Include && Parent.TestSummaryList.Count != 1)
{
list[0].IsSelected = true;
}
}
catch (Exception) { }
}
catch (Exception ex)
{
MessageBox.Show("Error", ex.Message, MessageBoxButton.OK);
Parent.IsBusy = false;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(false);
}
finally
{
_eventAggregator.GetEvent<AppStatusExEvent>().Publish(new AppStatusExArg(AppStatusArg.Available, "GetTestSummary"));
}
}, DispatcherPriority.Background);
}
/// <summary>
/// 43387 - If called by Viewer, only select the first test, if called by Export, select all.
/// </summary>
/// <param name="selectAll"></param>
private void DetermineTestsSelected(bool selectAll)
{
if (selectAll)
{
foreach (var testSummaryList in Parent.TestSummaryList)
{
testSummaryList.IsSelected = true;
}
}
else
{
if (Parent.TestSummaryList.Count == 1)
{
Parent.TestSummaryList[0].IsSelected = true;
}
else if (Parent.TestSummaryList.Count > 1)
{
var names = Parent.TestSummaryList.Select(p => p.TestMetadata.TestSetup.SetupName).Distinct();
//http://manuscript.dts.local/f/cases/35546/Viewer-always-selects-first-dataset-after-making-modification-to-other-dataset
//don't select the all test if there are multiple tests involved, we are not in the view all step ...
if (1 == names.Count() && Parent.TestSummaryList.Any(p => p.DataType == "ALL"))
{
Parent.TestSummaryList[0].IsSelected = true;
}
}
}
}
///<summary>
///Occurs when a property value changes.
///</summary>
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public bool IsSaved { get; }
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 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("DTS.Viewer.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DTS.Viewer.Test")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[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)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b2b2b862-1b93-476a-8246-91e1310c7ec7")]
// 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")]

View File

@@ -0,0 +1,15 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
<ResourceDictionary x:Key="GenericResourceDictionary">
<ResourceDictionary.MergedDictionaries>
<!-- Common base theme -->
<!--<ResourceDictionary Source="pack://application:,,,/Another.AssemblyName;component/YourResDictionaryFolder/OtherStyles.xaml" />-->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -0,0 +1,225 @@
//------------------------------------------------------------------------------
// <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 DTS.Viewer.TestSummaryList.Resources {
using System;
/// <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", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class StringResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal StringResources() {
}
/// <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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DTS.Viewer.TestSummaryList.Resources.StringResources", typeof(StringResources).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;
}
}
/// <summary>
/// Looks up a localized string similar to Browse....
/// </summary>
internal static string Browse {
get {
return ResourceManager.GetString("Browse", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Channels: .
/// </summary>
internal static string ChannelCount {
get {
return ResourceManager.GetString("ChannelCount", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Description: .
/// </summary>
internal static string Description {
get {
return ResourceManager.GetString("Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File Date: .
/// </summary>
internal static string FileDate {
get {
return ResourceManager.GetString("FileDate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File Date.
/// </summary>
internal static string FileDateAscending {
get {
return ResourceManager.GetString("FileDateAscending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File Date (Descending).
/// </summary>
internal static string FileDateDescending {
get {
return ResourceManager.GetString("FileDateDescending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test ID.
/// </summary>
internal static string IdAscending {
get {
return ResourceManager.GetString("IdAscending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test ID (Descending).
/// </summary>
internal static string IdDescending {
get {
return ResourceManager.GetString("IdDescending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Refresh.
/// </summary>
internal static string Refresh {
get {
return ResourceManager.GetString("Refresh", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test Setup.
/// </summary>
internal static string SetupNameAscending {
get {
return ResourceManager.GetString("SetupNameAscending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test Setup (Descending).
/// </summary>
internal static string SetupNameDescending {
get {
return ResourceManager.GetString("SetupNameDescending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sort: .
/// </summary>
internal static string Sort {
get {
return ResourceManager.GetString("Sort", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test ID: .
/// </summary>
internal static string TestID {
get {
return ResourceManager.GetString("TestID", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test Setup: .
/// </summary>
internal static string TestSetup {
get {
return ResourceManager.GetString("TestSetup", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time Stamp: .
/// </summary>
internal static string TimeStamp {
get {
return ResourceManager.GetString("TimeStamp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time Stamp.
/// </summary>
internal static string TimeStampAscending {
get {
return ResourceManager.GetString("TimeStampAscending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time Stamp (Descending).
/// </summary>
internal static string TimeStampDescending {
get {
return ResourceManager.GetString("TimeStampDescending", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Type: .
/// </summary>
internal static string Type {
get {
return ResourceManager.GetString("Type", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,120 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,174 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Browse" xml:space="preserve">
<value>Browse...</value>
</data>
<data name="ChannelCount" xml:space="preserve">
<value>Channels: </value>
</data>
<data name="Description" xml:space="preserve">
<value>Description: </value>
</data>
<data name="FileDate" xml:space="preserve">
<value>File Date: </value>
</data>
<data name="FileDateAscending" xml:space="preserve">
<value>File Date</value>
</data>
<data name="FileDateDescending" xml:space="preserve">
<value>File Date (Descending)</value>
</data>
<data name="IdAscending" xml:space="preserve">
<value>Test ID</value>
</data>
<data name="IdDescending" xml:space="preserve">
<value>Test ID (Descending)</value>
</data>
<data name="Refresh" xml:space="preserve">
<value>Refresh</value>
</data>
<data name="SetupNameAscending" xml:space="preserve">
<value>Test Setup</value>
</data>
<data name="SetupNameDescending" xml:space="preserve">
<value>Test Setup (Descending)</value>
</data>
<data name="Sort" xml:space="preserve">
<value>Sort: </value>
</data>
<data name="TestID" xml:space="preserve">
<value>Test ID: </value>
</data>
<data name="TestSetup" xml:space="preserve">
<value>Test Setup: </value>
</data>
<data name="TimeStamp" xml:space="preserve">
<value>Time Stamp: </value>
</data>
<data name="TimeStampAscending" xml:space="preserve">
<value>Time Stamp</value>
</data>
<data name="TimeStampDescending" xml:space="preserve">
<value>Time Stamp (Descending)</value>
</data>
<data name="Type" xml:space="preserve">
<value>Type: </value>
</data>
</root>

View File

@@ -0,0 +1,21 @@
using System;
using System.Windows.Markup;
using DTS.Viewer.TestSummaryList.Resources;
namespace DTS.Viewer.TestSummaryList
{
[MarkupExtensionReturnType(typeof(string))]
public class TranslateExtension : MarkupExtension
{
private readonly string _key;
public TranslateExtension(string key) { _key = key; }
private const string NotFound = "#stringnotfound#";
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (string.IsNullOrEmpty(_key)) { return NotFound; }
return StringResources.ResourceManager.GetString(_key) ?? NotFound + " " + _key;
}
}
}

View File

@@ -0,0 +1,139 @@
using System;
using System.Windows.Media.Imaging;
using DTS.Common;
using DTS.Common.Interface;
using DTS.Viewer.TestSummaryList;
using DTS.Viewer.TestSummaryList.ViewModel;
using Prism.Ioc;
using Prism.Modularity;
using Unity;
// ReSharper disable RedundantAttributeUsageProperty
// ReSharper disable UnusedParameter.Local
[assembly: TestSummaryListModuleName()]
[assembly: TestSummaryListModuleImageAttribute()]
namespace DTS.Viewer.TestSummaryList
{
[Module(ModuleName = "TestSummaryList")]
public class TestSummaryListModule : IModule
{
/// <summary>
/// Injected unity container
/// </summary>
private readonly IUnityContainer _unityContainer;
/// <summary>
/// Initializes a new instance of the <see cref="TestSummaryListModule"/> class.
/// </summary>
/// <param name="unityContainer">Obtained reference of the unity container by using dependency injection.</param>
public TestSummaryListModule(IUnityContainer unityContainer)
{
_unityContainer = unityContainer;
}
public void Initialize()
{
// Register View & View-Model with Unity dependency injection container as a singleton.
_unityContainer.RegisterType<ITestSummaryListView, TestSummaryListView>();
_unityContainer.RegisterType<ITestSummaryListViewModel, TestSummaryViewListModel>();
}
public void OnInitialized(IContainerProvider containerProvider)
{
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
Initialize();
}
}
/// <summary>
/// Attribute class contains assembly name
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class TestSummaryListModuleNameAttribute : TextAttribute
{
public TestSummaryListModuleNameAttribute() : this(null) { }
public TestSummaryListModuleNameAttribute(string s)
{
AssemblyName = AssemblyNames.TestSummaryList.ToString();
}
public override string AssemblyName { get; }
public override Type GetAttributeType()
{
return typeof(TextAttribute);
}
public override string GetAssemblyName()
{
return AssemblyName;
}
}
/// <summary>
/// Attribute class contains assembly image and name - used on the Main screen to display available components
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class TestSummaryListModuleImageAttribute : ImageAttribute
{
private BitmapImage _img;
public TestSummaryListModuleImageAttribute() : this(null) { }
public override BitmapImage AssemblyImage
{
get { _img = AssemblyInfo.GetImage(AssemblyNames.TestSummaryList.ToString()); return _img; }
}
public TestSummaryListModuleImageAttribute(string s)
{
_img = AssemblyInfo.GetImage(AssemblyNames.TestSummaryList.ToString());
}
public override Type GetAttributeType()
{
return typeof(ImageAttribute);
}
public override BitmapImage GetAssemblyImage()
{
return AssemblyImage;
}
private string _name;
public override string AssemblyName
{
get { _name = AssemblyNames.TestSummaryList.ToString(); return _name; }
}
public override string GetAssemblyName()
{
return AssemblyName;
}
private string _group;
public override string AssemblyGroup
{
get { _group = eAssemblyGroups.Viewer.ToString(); return _group; }
}
public override string GetAssemblyGroup()
{
return AssemblyGroup;
}
private eAssemblyRegion _region;
public override eAssemblyRegion AssemblyRegion
{
get { _region = eAssemblyRegion.TestSummaryRegion; return _region; }
}
public override eAssemblyRegion GetAssemblyRegion()
{
return AssemblyRegion;
}
}
}

View File

@@ -0,0 +1,128 @@
<base:BaseView x:Class="DTS.Viewer.TestSummaryList.TestSummaryListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:prism="http://prismlibrary.com/"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:strings="clr-namespace:DTS.Viewer.TestSummaryList"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<base:BaseView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/DTS.Common;component/Themes/CommonStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="Button" BasedOn="{StaticResource PageContentButton}">
<Setter Property="FontSize" Value="10" />
<Setter Property="Margin" Value="3,3" />
</Style>
<Style TargetType="TextBox" BasedOn="{StaticResource PageContentTextBoxStyle}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
<converters:DateTimeWithMillisecondsToStringConverter x:Key="dateToString" />
</ResourceDictionary>
</base:BaseView.Resources>
<Grid x:Name="TestListRegion" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="{strings:TranslateExtension Refresh}"
Command="{Binding Path=RefreshDataFolderCommand}"
AutomationProperties.AutomationId="RefreshTestsBtn" />
<Button Grid.Column="1" Content="{strings:TranslateExtension Browse}" HorizontalAlignment="Left"
Command="{Binding Path=SelectDataFolderCommand}" HorizontalContentAlignment="Center"
AutomationProperties.AutomationId="BrowseTestsBtn" />
<ContentControl Grid.Column="2" Content="{Binding FilterView}" IsEnabled="{Binding IsFilterEnabled}" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{strings:TranslateExtension Sort}" FontSize="12"/>
<ComboBox ItemsSource="{Binding SortableAttributes}" SelectedIndex="{Binding SelectedSortIndex}" Grid.Column="1" AutomationProperties.AutomationId="ComboBox_TestSummarySort"/>
</Grid>
<ListView x:Name="ListViewTestSummary" Grid.Row="2"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ItemsSource="{Binding FilteredTestSummaryList, Mode=TwoWay}"
SelectedItem="{Binding SelectedTestSummary, Mode=TwoWay}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
AutomationProperties.AutomationId="ListViewTestSummary"
SelectionMode="Single" KeyUp="TestSummary_KeyUp">
<ListView.ItemTemplate>
<DataTemplate>
<Border CornerRadius="0" BorderThickness="2" BorderBrush="Transparent" Margin="0 0 0 0">
<Grid Margin="0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<CheckBox Grid.Column="0" Grid.Row="0" x:Name="CheckBox_TestSummary" IsChecked="{Binding Path=IsSelected}" HorizontalAlignment="Left" Margin="0,2,0,0" AutomationProperties.AutomationId="CheckBox_IsSelected"/>
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal">
<Expander IsExpanded="False" x:Name="Expander_TestSummary" FontSize="14" Margin="2,0,0,0"
AutomationProperties.AutomationId="Expander_TestSummary">
<Expander.Header>
<TextBlock Text="{Binding Id, FallbackValue=Id}" />
</Expander.Header>
<Grid Margin="23,0,0,0">
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" Text="{strings:TranslateExtension TestSetup}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding SetupName, FallbackValue=SetupName}" Margin="5,0" AutomationProperties.AutomationId="Label_SetupName" />
<TextBlock Grid.Column="0" Grid.Row="1" Text="{strings:TranslateExtension FileDate}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding FileDate, FallbackValue=FileDate}" Margin="5,0" AutomationProperties.AutomationId="Label_FileDate"/>
<TextBlock Grid.Column="0" Grid.Row="2" Text="{strings:TranslateExtension TimeStamp}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="2" Text="{Binding TimeStamp, FallbackValue=TimeStamp, Converter={StaticResource dateToString}}" Margin="5,0" AutomationProperties.AutomationId="Label_TimeStamp"/>
<TextBlock Grid.Column="0" Grid.Row="3" Text="{strings:TranslateExtension Type}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="3" Text="{Binding DataType, FallbackValue=DataType}" Margin="5,0" AutomationProperties.AutomationId="Label_DataType"/>
<TextBlock Grid.Column="0" Grid.Row="4" Text="{strings:TranslateExtension ChannelCount}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="4" Text="{Binding ChannelCount, FallbackValue=ChannelCount}" Margin="5,0" AutomationProperties.AutomationId="Label_ChannelCount"/>
<TextBlock Grid.Column="0" Grid.Row="5" Text="{strings:TranslateExtension Description}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Grid.Row="5" Text="{Binding Description, FallbackValue=Description}" Margin="5,0" TextWrapping="Wrap" AutomationProperties.AutomationId="Label_Description"/>
</Grid>
</Expander>
</StackPanel>
</Grid>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</base:BaseView>

View File

@@ -0,0 +1,35 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using DTS.Common.Classes.Viewer.TestMetadata;
using DTS.Common.Interface;
using DTS.Common.Interface.TestDefinition;
// ReSharper disable CheckNamespace
namespace DTS.Viewer.TestSummaryList
{
/// <summary>
/// Interaction logic for TestSummaryListView.xaml
/// </summary>
public partial class TestSummaryListView : ITestSummaryListView
{
public TestSummaryListView()
{
InitializeComponent();
}
private void TestSummary_KeyUp(object sender, KeyEventArgs e)
{
if ((sender as ListView)?.SelectedItem is TestSummary ts)
{
if (e.Key == Key.Space)
{
ts.IsSelected = !ts.IsSelected;
e.Handled = true;
}
}
else { e.Handled = false; }
}
}
}

View File

@@ -0,0 +1,86 @@
<base:BaseView x:Class="DTS.Viewer.TestSummaryList.TestSummaryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">
<ContentControl x:Name="TestListRegion" Background="LightGray" Width="Auto">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<xcdg:DataGridControl x:Name="_dataGridTestSummary" ItemsSource="{Binding TestSummaryList}"
AllowDrag="False" AutoCreateColumns="False" SelectedItem="{Binding SelectedTestSummary}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" Width="Auto">
<xcdg:DataGridControl.ReadOnly>True</xcdg:DataGridControl.ReadOnly>
<xcdg:DataGridControl.View>
<xcdg:TableflowView UseDefaultHeadersFooters="False">
<xcdg:TableflowView.FixedHeaders>
<DataTemplate>
<xcdg:ColumnManagerRow />
</DataTemplate>
</xcdg:TableflowView.FixedHeaders>
</xcdg:TableflowView>
</xcdg:DataGridControl.View>
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="." Title="" Width="22" >
<xcdg:Column.CellContentTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Path=IsSelected}" HorizontalAlignment="Center"
Command="{Binding IsSelectedCommand}">
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="IsChecked">
<i:InvokeCommandAction Command="{Binding IsSelectedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>-->
</CheckBox>
</DataTemplate>
</xcdg:Column.CellContentTemplate>
</xcdg:Column>
<xcdg:Column FieldName="Id" Title="Id" Width="160" />
<xcdg:Column FieldName="Name" Title="Name" Width="*" MaxWidth="200" />
<xcdg:Column FieldName="Description" Title="Description" Width="160" />
<xcdg:Column FieldName="ChannelCount" Title="Channel Count" Width="90" />
<xcdg:Column FieldName="TestDate" Title="Date" Width="100" />
<xcdg:Column FieldName="DataType" Title="Type" Width="60" />
</xcdg:DataGridControl.Columns>
</xcdg:DataGridControl>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</base:BaseView>

View File

@@ -0,0 +1,16 @@
using DTS.Common.Interface;
namespace DTS.Viewer.TestSummaryList
{
/// <summary>
/// Interaction logic for TestListView.xaml
/// </summary>
public partial class TestSummaryView : ITestSummaryListView
{
public TestSummaryView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,419 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Threading;
using DTS.Common.Base;
using DTS.Common.Classes.Viewer.TestMetadata;
using DTS.Common.Events;
using DTS.Common.Interactivity;
using DTS.Common.Interface;
using DTS.Common.Interface.TestDefinition;
using DTS.Viewer.TestSummaryList.Model;
using DTS.Viewer.TestSummaryList.Resources;
using Prism.Commands;
using Prism.Events;
using Prism.Regions;
using Unity;
namespace DTS.Viewer.TestSummaryList.ViewModel
{
public class TestSummaryViewListModel : BaseViewModel<ITestSummaryListViewModel>, ITestSummaryListViewModel
{
public IFilterView FilterView { get; private set; }
public ITestSummaryListView View { get; set; }
internal IBaseViewModel Parent { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the TestSummaryViewListModel.
/// </summary>
/// <param name="view">The TestSummaryList View interface.</param>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The unityContainer.</param>
public TestSummaryViewListModel(ITestSummaryListView view, IRegionManager regionManager, IEventAggregator eventAggregator,
IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
View = view;
View.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
}
#region Methods
public override void Initialize()
{
}
public override void Initialize(object parameter)
{
Parent = (IBaseViewModel)parameter;
FilterView = GetFilterView(this);
TestSummaryList.CollectionChanged += TestSummaryList_CollectionChanged;
FilteredTestSummaryList.CollectionChanged += TestSummaryList_CollectionChanged;
Subscribe();
}
private void Subscribe()
{
_eventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
_eventAggregator.GetEvent<DataFolderChangedEvent>().Subscribe(OnDataFolderChanged);
_eventAggregator.GetEvent<FilterParameterChangedEvent>().Subscribe(OnFilterChanged);
_eventAggregator.GetEvent<RefreshTestRequestEvent>().Subscribe(OnRefreshTestRequest);
}
public void OnFilterChanged(FilterParameterArgs args)
{
if (((IFilterViewModel)FilterView.DataContext).Parent == this)
{
FilteredTestSummaryList = string.IsNullOrEmpty(args.Param) ? new ObservableCollection<ITestSummary>(TestSummaryList)
: new ObservableCollection<ITestSummary>((from x in TestSummaryList where x.SetupName.ToLower().Contains(args.Param.ToLower()) || x.Id.ToLower().Contains(args.Param.ToLower()) || x.Description.ToLower().Contains(args.Param.ToLower()) select x).ToList());
}
}
private void OnDataFolderChanged(DataFolderSelectionArg arg)
{
if (Parent != arg.ParentVM) return;
var path = arg.Path;
var file = arg.File;
if (string.IsNullOrEmpty(path) && string.IsNullOrEmpty(file)) return;
if (!string.IsNullOrEmpty(path) && string.IsNullOrEmpty(file)) { Cleanup(); }
_selectedDataFolder = path;
_selectedDataFile = file;
IsBusy = true;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(true);
var td = new TestSummaryModel { Parent = this, _eventAggregator = _eventAggregator };
td.GetTestSummary(path, file, arg.SetSelected, arg.SelectAll);
}
/// <summary>
/// Private Event handler for RaiseNotification event.
/// </summary>
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
{
// Notification object expects a NotificationContentEventArgsWithoutTitle object and a Title string.
var eventArgsWithoutTitle = new NotificationContentEventArgs(eventArgsWithTitle.Message, eventArgsWithTitle.MessageDetails, eventArgsWithTitle.Image);
NotificationRequest.Raise(new Notification
{
Content = eventArgsWithoutTitle,
Title = eventArgsWithTitle.Title
});
}
public override void Activated()
{
var fp = new FilterParameterArgs
{
Param = string.Empty,
Requester = this
};
_eventAggregator.GetEvent<FilterParameterChangedEvent>().Publish(fp);
}
public override void Cleanup()
{
TestSummaryList.Clear();
SelectedTestSummaryList.Clear();
FilteredTestSummaryList.Clear();
SelectedTestSummary = new TestSummary();
PublishSelectedTestSummaryList();
}
public void PublishSelectedTestSummaryList()
{
_eventAggregator.GetEvent<TestSummaryChangeNotification>().Publish(new TestSummaryChangeNotificationArg { SummaryList = SelectedTestSummaryList, ParentVM = Parent, TotalSummaryCount = TestSummaryList.Count });
_eventAggregator.GetEvent<TestSummaryCountNotification>().Publish(new TestSummaryCountNotificationArg { SummaryCount = SelectedTestSummaryList.Count, ParentVM = Parent });
_eventAggregator.GetEvent<ResetZoomChangedEvent>().Publish(true);
}
#endregion
#region ContextRegion
public object ContextNavigationRegion
{
get => ((TestSummaryListView)View).TestListRegion.DataContext;
set { ((TestSummaryListView)View).TestListRegion.DataContext = value; OnPropertyChanged("ContextNavigationRegion"); }
}
private IFilterView GetFilterView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IFilterView>();
var viewModel = _unityContainer.Resolve<IFilterViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
#endregion
#region Properties
private bool _isFilterEnabled = false;
public bool IsFilterEnabled { get => _isFilterEnabled; set { _isFilterEnabled = value; OnPropertyChanged("IsFilterEnabled"); } }
private TestSummary _selectedTestSummary = new TestSummary();
public TestSummary SelectedTestSummary
{
get => _selectedTestSummary;
set { _selectedTestSummary = value; OnPropertyChanged("SelectedTestSummary"); }
}
private List<ITestSummary> _selectedTestSummaryList = new List<ITestSummary>();
public List<ITestSummary> SelectedTestSummaryList
{
get => _selectedTestSummaryList;
set { _selectedTestSummaryList = value; OnPropertyChanged("SelectedTestSummaryList"); }
}
private ObservableCollection<ITestSummary> _testSummaryList = new ObservableCollection<ITestSummary>();
public ObservableCollection<ITestSummary> TestSummaryList
{
get => _testSummaryList;
set
{
_testSummaryList = value;
IsFilterEnabled = _testSummaryList.Count > 0;
FilteredTestSummaryList = new ObservableCollection<ITestSummary>(_testSummaryList);
OnPropertyChanged("TestSummaryList");
}
}
public void TestSummaryList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.OldItems != null)
{
foreach (INotifyPropertyChanged item in e.OldItems)
item.PropertyChanged -= TestSummaryList_PropertyChanged;
}
if (e.NewItems != null)
{
foreach (INotifyPropertyChanged item in e.NewItems)
item.PropertyChanged += TestSummaryList_PropertyChanged;
}
IsFilterEnabled = _testSummaryList.Count > 0;
FilteredTestSummaryList = new ObservableCollection<ITestSummary>(_testSummaryList);
SortTestSummaryList();
}
private void TestSummaryList_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "TestSummaryList")
{
IsFilterEnabled = _testSummaryList.Count > 0;
FilteredTestSummaryList = new ObservableCollection<ITestSummary>(_testSummaryList);
}
}
private ObservableCollection<ITestSummary> _filteredTestSummaryList = new ObservableCollection<ITestSummary>();
public ObservableCollection<ITestSummary> FilteredTestSummaryList
{
get => _filteredTestSummaryList;
set { _filteredTestSummaryList = value; OnPropertyChanged("FilteredTestSummaryList"); }
}
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo => "TestSummaryRegion";
private bool _isBusy = false;
public new bool IsBusy
{
get => _isBusy;
set { _isBusy = value; OnPropertyChanged("IsBusy"); }
}
private bool _isDirty;
public new bool IsDirty
{
get => _isDirty;
set => _isDirty = value;
}
private bool _isNavigationIncluded;
public new bool IsNavigationIncluded
{
get => _isNavigationIncluded;
set => _isNavigationIncluded = value;
}
private string _selectedDataFolder = string.Empty;
public string SelectedDataFolder
{
get => _selectedDataFolder;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFolder = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = _selectedDataFolder, File = string.Empty, SelectAll = false, ParentVM = Parent }); OnPropertyChanged("SelectedDataFolder");
}
}
private string _selectedDataFile = string.Empty;
public string SelectedDataFile
{
get => _selectedDataFile;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFile = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = string.Empty, File = _selectedDataFile, SelectAll = false, ParentVM = Parent }); OnPropertyChanged("SelectedDataFile");
}
}
#endregion
#region Commands
private DelegateCommand _refreshDataFolderCommand;
public DelegateCommand RefreshDataFolderCommand => _refreshDataFolderCommand ?? (_refreshDataFolderCommand = new DelegateCommand(RefreshDataFolder));
private DelegateCommand _selectDataFolderCommand;
public DelegateCommand SelectDataFolderCommand => _selectDataFolderCommand ?? (_selectDataFolderCommand = new DelegateCommand(SelectDataFolder));
private void RefreshDataFolder()
{
Dispatcher.CurrentDispatcher.Invoke(() =>
{
_eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = _selectedDataFolder, File = string.Empty, SelectAll = false, ParentVM = Parent });
}, DispatcherPriority.Background);
}
private void SelectDataFolder()
{
const string fileExt = "DTS Files (*.dts)|*.dts";
var fileDialog = new System.Windows.Forms.OpenFileDialog { Filter = fileExt };
var result = fileDialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
{
//16158 Browse button on View Data tab not functiona
//((IViewerMainViewModel) Parent).SelectAndIncludeDataFile(fileDialog.FileName);
_eventAggregator.GetEvent<DataFileSelectedEvent>().Publish(new DataFileSelectionArg { File = fileDialog.FileName, ParentVM = Parent });
}
}
private void OnRefreshTestRequest(string file)
{
var td = new TestSummaryModel { Parent = this, _eventAggregator = _eventAggregator };
td.GetTestSummary(string.Empty, file);
}
#endregion Commands
public enum SortableAttribute
{
TimeStampDescending,
Timestamp,
FileDateDescending,
FileDate,
IdDescending,
Id,
TestSetupDescending,
TestSetup
}
public List<string> SortableAttributes
{
get
{
var rv = new List<string>();
foreach (var sortableAttribute in Enum.GetValues(typeof(SortableAttribute)).Cast<SortableAttribute>().ToList())
{
rv.Add(new SortableAttributeHelper(sortableAttribute).ToString());
}
return rv;
}
}
private int _selctedSortIndex = (int)SortableAttribute.TimeStampDescending;
public int SelectedSortIndex
{
get => _selctedSortIndex;
set
{
_selctedSortIndex = value;
SortTestSummaryList();
}
}
private void SortTestSummaryList()
{
var rv = new ITestSummary[FilteredTestSummaryList.Count];
switch ((SortableAttribute)_selctedSortIndex)
{
default:
case SortableAttribute.TimeStampDescending:
FilteredTestSummaryList.OrderByDescending(x => x.TimeStamp.Ticks).ToList().CopyTo(rv);
break;
case SortableAttribute.Timestamp:
FilteredTestSummaryList.OrderBy(x => x.TimeStamp.Ticks).ToList().CopyTo(rv);
break;
case SortableAttribute.FileDateDescending:
FilteredTestSummaryList.OrderByDescending(x => x.FileDate.Ticks).ToList().CopyTo(rv);
break;
case SortableAttribute.FileDate:
FilteredTestSummaryList.OrderBy(x => x.FileDate.Ticks).ToList().CopyTo(rv);
break;
case SortableAttribute.IdDescending:
FilteredTestSummaryList.OrderByDescending(x => x.Id).ToList().CopyTo(rv);
break;
case SortableAttribute.Id:
FilteredTestSummaryList.OrderBy(x => x.Id).ToList().CopyTo(rv);
break;
case SortableAttribute.TestSetupDescending:
FilteredTestSummaryList.OrderByDescending(x => x.SetupName).ToList().CopyTo(rv);
break;
case SortableAttribute.TestSetup:
FilteredTestSummaryList.OrderBy(x => x.SetupName).ToList().CopyTo(rv);
break;
}
FilteredTestSummaryList.Clear();
foreach (var testSummary in rv)
{
FilteredTestSummaryList.Add(testSummary);
}
}
public class SortableAttributeHelper
{
public SortableAttributeHelper(SortableAttribute attribute)
{
_attribute = attribute;
}
private SortableAttribute _attribute;
public SortableAttribute Attribute
{
get => _attribute;
set => _attribute = value;
}
public override string ToString()
{
return StringResources.ResourceManager.GetString(_attribute.ToString()) ?? _attribute.ToString();
}
}
}
}

View File

@@ -0,0 +1,202 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Threading.Tasks;
using DTS.Common.Base;
using DTS.Common.Classes.TestMetadata;
using DTS.Common.Events;
using DTS.Common.Interface;
using DTS.Common.Interface.TestDefinition;
using DTS.Viewer.TestSummaryList.Model;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
// ReSharper disable ConvertToAutoProperty
namespace DTS.Viewer.TestSummaryList.ViewModel
{
public class TestSummaryViewModel : BaseViewModel<ITestSummaryListViewModel>, ITestSummaryListViewModel
{
public ITestSummaryListView TestSummaryListView { get; private set; }
private IBaseWindowModel Parent { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private IRegionManager _regionManager;
private IUnityContainer UnityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the TechnologyDoFrontEditViewModel.
/// </summary>
/// <param name="view">The TestListView View.</param>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The unityContainer.</param>
public TestSummaryViewModel(ITestSummaryListView view, IRegionManager regionManager, IEventAggregator eventAggregator,
IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
TestSummaryListView = view;
TestSummaryListView.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
UnityContainer = unityContainer;
_regionManager = regionManager;
_eventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
_eventAggregator.GetEvent<DataFolderChangedEvent>().Subscribe(OnDataFolderChanged);
}
#region Methods
public override void Initialize()
{
}
public override void Initialize(object parameter)
{
Parent = (IBaseWindowModel)parameter;
}
private void OnDataFolderChanged(string path)
{
if (String.IsNullOrEmpty(path)) return;
IsBusy = true;
_eventAggregator.GetEvent<ShowStatus>().Publish(new StatusInfo(StatusInfo.StatusState.Busy, "Please wait..."));
var td = new TestSummaryModel { Parent = this, _eventAggregator = _eventAggregator };
td.GetTestSummary(path);
}
/// <summary>
/// Private Event handler for RaiseNotification event.
/// </summary>
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
{
// Notification object expects a NotificationContentEventArgsWithoutTitle object and a Title string.
var eventArgsWithoutTitle = new NotificationContentEventArgs(eventArgsWithTitle.Message, eventArgsWithTitle.MessageDetails, eventArgsWithTitle.Image);
NotificationRequest.Raise(new Notification
{
Content = eventArgsWithoutTitle,
Title = eventArgsWithTitle.Title
});
}
public override void Activated()
{
throw new NotImplementedException();
}
public override void Cleanup()
{
throw new NotImplementedException();
}
public new Task CleanupAsync()
{
throw new NotImplementedException();
}
public override Task InitializeAsync()
{
throw new NotImplementedException();
}
public override Task InitializeAsync(object parameter)
{
throw new NotImplementedException();
}
public void PublishSelectedTestSummaryList()
{
_eventAggregator.GetEvent<TestSummaryChangeNotification>().Publish(SelectedTestSummaryList);
_eventAggregator.GetEvent<TestSelectedChangedEvent>().Publish(SelectedTestSummaryList.Count);
}
#endregion
#region ContextRegion
public object ContextNavigationRegion
{
get => ((TestSummaryView)TestSummaryListView).TestListRegion.Content;
set
{
((TestSummaryView)TestSummaryListView).TestListRegion.Content = value;
OnPropertyChanged("ContextNavigationRegion");
}
}
#endregion
#region Properties
private TestSummary _selectedTestSummary = new TestSummary();
public TestSummary SelectedTestSummary
{
get => _selectedTestSummary;
set { _selectedTestSummary = value; OnPropertyChanged("SelectedTestSummary"); }
}
private List<ITestSummary> _selectedTestSummaryList = new List<ITestSummary>();
public List<ITestSummary> SelectedTestSummaryList
{
get => _selectedTestSummaryList;
set { _selectedTestSummaryList = value; OnPropertyChanged("SelectedTestSummaryList"); }
}
private ObservableCollection<ITestSummary> _testSummaryList = new ObservableCollection<ITestSummary>();
public ObservableCollection<ITestSummary> TestSummaryList
{
get => _testSummaryList;
set { _testSummaryList = value; OnPropertyChanged("TestSummaryList"); }
}
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo => "TestSummaryRegion";
private bool _isBusy = false;
public new bool IsBusy
{
get => _isBusy;
set { _isBusy = value; OnPropertyChanged("IsBusy"); }
}
private bool _isDirty;
public new bool IsDirty
{
get => _isDirty;
set => _isDirty = value;
}
private bool _isNavigationIncluded;
public new bool IsNavigationIncluded
{
get => _isNavigationIncluded;
set => _isNavigationIncluded = value;
}
#endregion
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = "")]

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]