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,109 @@
<?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>{486AF003-0DEC-4B05-A7A5-39E6CA9EC629}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DTS.Viewer.PSDReportResults</RootNamespace>
<AssemblyName>DTS.Viewer.PSDReportResults</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
</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.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Common\DTS.Common\lib\System.Windows.Interactivity.dll</HintPath>
</Reference>
<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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PSDReportResultsModule.cs" />
<Compile Include="Resources\StringResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>StringResources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\TranslateExtension.cs" />
<Compile Include="ViewModel\PSDReportResultsViewModel.cs" />
<Compile Include="View\PSDReportResultsView.xaml.cs">
<DependentUpon>PSDReportResultsView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\StringResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Page Include="View\PSDReportResultsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\DTS.Common\DTS.Common.csproj">
<Project>{f7a0804f-61a4-40ae-83d0-f1137622b592}</Project>
<Name>DTS.Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,127 @@
using System;
using System.Windows.Media.Imaging;
using DTS.Common;
using DTS.Common.Interface;
using DTS.Viewer.PSDReportResults;
using Prism.Ioc;
using Prism.Modularity;
using Unity;
[assembly: PSDReportResultsModuleName()]
[assembly: PSDReportResultsModuleImageAttribute()]
namespace DTS.Viewer.PSDReportResults
{
[Module(ModuleName = "PSDReportResults")]
public class PSDReportResultsModule : IModule
{
/// <summary>
/// Injected unity container
/// </summary>
private readonly IUnityContainer _unityContainer;
public PSDReportResultsModule(IUnityContainer unityContainer)
{
_unityContainer = unityContainer;
}
public void Initialize()
{
_unityContainer.RegisterType<IPSDReportResultsViewModel, PSDReportResultsViewModel>();
_unityContainer.RegisterType<IPSDReportResultsView, PSDReportResultsView>();
}
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 PSDReportResultsModuleNameAttribute : TextAttribute
{
public PSDReportResultsModuleNameAttribute() : this(null) { }
public PSDReportResultsModuleNameAttribute(string s)
{
AssemblyName = AssemblyNames.PSDReportResults.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 PSDReportResultsModuleImageAttribute : ImageAttribute
{
private BitmapImage _img;
public PSDReportResultsModuleImageAttribute() : this(null) { }
public override BitmapImage AssemblyImage
{
get { _img = AssemblyInfo.GetImage(AssemblyNames.PSDReportResults.ToString()); return _img; }
}
public PSDReportResultsModuleImageAttribute(string s)
{
_img = AssemblyInfo.GetImage(AssemblyNames.PSDReportResults.ToString());
}
public override Type GetAttributeType()
{
return typeof(ImageAttribute);
}
public override BitmapImage GetAssemblyImage()
{
return AssemblyImage;
}
private string _name;
public override string AssemblyName
{
get { _name = AssemblyNames.PSDReportResults.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.PSDReportResultsRegion; return _region; }
}
public override eAssemblyRegion GetAssemblyRegion()
{
return AssemblyRegion;
}
}
}

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.PSDReportResults")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DTS.Viewer.PSDReportResults")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[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("486af003-0dec-4b05-a7a5-39e6ca9ec629")]
// 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,126 @@
//------------------------------------------------------------------------------
// <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.PSDReportResults.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.PSDReportResults.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 Name.
/// </summary>
internal static string ChannelName {
get {
return ResourceManager.GetString("ChannelName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export.
/// </summary>
internal static string ExportPSDHeader {
get {
return ResourceManager.GetString("ExportPSDHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export PSD to CSV.
/// </summary>
internal static string ExportPSDtoCSV {
get {
return ResourceManager.GetString("ExportPSDtoCSV", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export PSD to PDF.
/// </summary>
internal static string ExportPSDtoPDF {
get {
return ResourceManager.GetString("ExportPSDtoPDF", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to GRMS.
/// </summary>
internal static string GRMS {
get {
return ResourceManager.GetString("GRMS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Results.
/// </summary>
internal static string PSDResultsHeader {
get {
return ResourceManager.GetString("PSDResultsHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sample Rate.
/// </summary>
internal static string SampleRate {
get {
return ResourceManager.GetString("SampleRate", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,141 @@
<?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="ChannelName" xml:space="preserve">
<value>Name</value>
</data>
<data name="ExportPSDHeader" xml:space="preserve">
<value>Export</value>
</data>
<data name="ExportPSDtoCSV" xml:space="preserve">
<value>Export PSD to CSV</value>
</data>
<data name="ExportPSDtoPDF" xml:space="preserve">
<value>Export PSD to PDF</value>
</data>
<data name="GRMS" xml:space="preserve">
<value>GRMS</value>
</data>
<data name="PSDResultsHeader" xml:space="preserve">
<value>Results</value>
</data>
<data name="SampleRate" xml:space="preserve">
<value>Sample Rate</value>
</data>
</root>

View File

@@ -0,0 +1,21 @@
using System;
using System.Windows.Markup;
using DTS.Viewer.PSDReportResults.Resources;
namespace DTS.Viewer.PSDReportResults
{
[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,61 @@
<base:BaseView x:Class="DTS.Viewer.PSDReportResults.PSDReportResultsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:strings="clr-namespace:DTS.Viewer.PSDReportResults"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common">
<base:BaseView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/DTS.Common;component/Themes/CommonStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<converters:IsGreaterThanConverter x:Key="IsGreaterThanConverter" />
</ResourceDictionary>
</base:BaseView.Resources>
<StackPanel>
<GroupBox Header="{strings:TranslateExtension ExportPSDHeader}" Margin="5,0,5,0" AutomationProperties.AutomationId="PSDExportGrpBx"
HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" IsEnabled="{Binding Results.Count, Converter={StaticResource IsGreaterThanConverter}, ConverterParameter=0}">
<Button Content="{strings:TranslateExtension ExportPSDtoPDF}" Margin="10" Padding="10, 5" Command="{Binding ExportToPDFCommand}" AutomationProperties.AutomationId="ExportToPDFBtn" />
<Button Content="{strings:TranslateExtension ExportPSDtoCSV}" Margin="10" Padding="10, 5" Command="{Binding ExportToCSVCommand}" AutomationProperties.AutomationId="ExportToCSVBtn" />
</StackPanel>
</GroupBox>
<GroupBox Header="{strings:TranslateExtension PSDResultsHeader}" Margin="5,0,5,0" AutomationProperties.AutomationId="PSDResultsGrpBx"
HorizontalAlignment="Stretch">
<ListView Grid.Row="1" HorizontalAlignment="Stretch" ItemsSource="{Binding Results, UpdateSourceTrigger=PropertyChanged}" AutomationProperties.AutomationId="ResultsListView" SelectionMode="Single" GridViewColumnHeader.Click="GridViewColumnHeader_OnClick">
<ListView.View>
<controls:AutoSizedGridView AutomationProperties.AutomationId="GRMSResultsGridView">
<GridViewColumn AutomationProperties.AutomationId="ChannelName">
<controls:GridViewColumnHeaderSearchable Tag="ChannelName" HeaderTitle="{strings:TranslateExtension ChannelName}" Search="GridViewColumnHeaderSearchable_OnSearch" ClickHandler="GridViewColumnHeader_OnClick" ListviewId="{Binding ListViewId}"/>
<GridViewColumn.CellTemplate>
<ItemContainerTemplate>
<TextBlock Text="{Binding ChannelName,FallbackValue='ChannelName'}" AutomationProperties.AutomationId="ChannelNameLbl"/>
</ItemContainerTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn AutomationProperties.AutomationId="SampleRate">
<controls:GridViewColumnHeaderSearchable Tag="SampleRate" HeaderTitle="{strings:TranslateExtension SampleRate}" Search="GridViewColumnHeaderSearchable_OnSearch" ClickHandler="GridViewColumnHeader_OnClick" ListviewId="{Binding ListViewId}"/>
<GridViewColumn.CellTemplate>
<ItemContainerTemplate>
<TextBlock Text="{Binding SampleRate,FallbackValue='SampleRate',StringFormat='N0', TargetNullValue='---'}" AutomationProperties.AutomationId="SampleRateLbl" />
</ItemContainerTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn AutomationProperties.AutomationId="GRMS">
<controls:GridViewColumnHeaderSearchable Tag="GRMS" HeaderTitle="{strings:TranslateExtension GRMS}" Search="GridViewColumnHeaderSearchable_OnSearch" ClickHandler="GridViewColumnHeader_OnClick" ListviewId="{Binding ListViewId}"/>
<GridViewColumn.CellTemplate>
<ItemContainerTemplate>
<TextBlock Text="{Binding GRMS,FallbackValue='GRMS'}" AutomationProperties.AutomationId="GRMSLbl" />
</ItemContainerTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</controls:AutoSizedGridView>
</ListView.View>
</ListView>
</GroupBox>
</StackPanel>
</base:BaseView>

View File

@@ -0,0 +1,25 @@
using DTS.Common.Interface;
namespace DTS.Viewer.PSDReportResults
{
/// <summary>
/// Interaction logic for PSDReportResultsView.xaml
/// </summary>
public partial class PSDReportResultsView : IPSDReportResultsView
{
public PSDReportResultsView()
{
InitializeComponent();
}
private void GridViewColumnHeader_OnClick(object sender, System.Windows.RoutedEventArgs e)
{
}
private void GridViewColumnHeaderSearchable_OnSearch(object sender, System.Windows.RoutedEventArgs e)
{
}
}
}

View File

@@ -0,0 +1,96 @@
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interactivity;
using DTS.Common.Interface;
using DTS.Common.Utils;
using Prism.Commands;
using Prism.Events;
using Prism.Regions;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Unity;
namespace DTS.Viewer.PSDReportResults
{
public class PSDReportResultsViewModel : BaseViewModel<IPSDReportResultsViewModel>, IPSDReportResultsViewModel
{
#region properties / fields
public IBaseView View { get; set; }
public IBaseViewModel Parent { get; set; }
public ObservableCollection<IChannelGRMSSummary> Results { get; set; }
private string Directory { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private new IRegionManager _regionManager { get; set; }
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
#endregion
/// <summary>
/// Creates a new instance of the MainViewModel.
/// </summary>
/// <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 Unity container.</param>
public PSDReportResultsViewModel(IPSDReportSettingsView 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;
_regionManager = regionManager;
}
public override void Initialize(object parameter)
{
Parent = (IBaseViewModel)parameter;
Results = new ObservableCollection<IChannelGRMSSummary>();
Subscribe();
}
private void Subscribe()
{
_eventAggregator.GetEvent<PSDReportGRMSValuesUpdatedEvent>().Subscribe(OnGRMSValuesUpdated, ThreadOption.UIThread);
_eventAggregator.GetEvent<GraphSelectedChannelsNotification>().Subscribe(OnGraphSelectedChannelsChanged);
}
private void OnGRMSValuesUpdated(PSDReportGRMSValuesUpdatedEventArg arg)
{
if (Parent != arg.ParentVM) return;
Results.Clear();
foreach (var val in arg.Values)
{
Results.Add(val);
}
}
private void OnGraphSelectedChannelsChanged(GraphSelectedChannelsNotificationArg arg)
{
if (Parent != arg?.ParentVM) return;
var channels = arg?.SelectedChannels ?? new System.Collections.Generic.List<ITestChannel>();
Directory = channels.Count > 0 ? channels[0].BinaryFilePath.ReplaceLast("Binary", "Reports") : string.Empty;
}
private DelegateCommand _exportToPDFCommand;
public DelegateCommand ExportToPDFCommand => _exportToPDFCommand ?? (_exportToPDFCommand = new DelegateCommand(ExportToPDFMethod));
private void ExportToPDFMethod()
{
_eventAggregator.GetEvent<SaveReportToPDFRequestedEvent>().Publish(new SaveReportToPDFRequestedEventArgs() { Directory = Directory, ParentVM = Parent });
}
private DelegateCommand _exportToCSVCommand;
public DelegateCommand ExportToCSVCommand => _exportToCSVCommand ?? (_exportToCSVCommand = new DelegateCommand(ExportToCSVMethod));
private void ExportToCSVMethod()
{
_eventAggregator.GetEvent<SaveReportToCSVRequestedEvent>().Publish(new SaveReportToCSVRequestedEventArgs() { Directory = Directory, ParentVM = Parent });
}
}
}

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")]