init
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,14 @@
|
||||
using DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile;
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
|
||||
namespace DTS.Common.Events
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The TTSImportSummaryImportEvent event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>This event is used by the Summary step to indicate that the Import button was clicked.</remarks>
|
||||
///
|
||||
public class TTSImportSummaryImportEvent : CompositePresentationEvent<ITTSSetup> { }
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
namespace DTS.Common.XMLUtils
|
||||
{
|
||||
[XmlRootAttribute("TestSetups")]
|
||||
public class TestSetupsXMLClass
|
||||
{
|
||||
[XmlElement("TestSetup")]
|
||||
public TestSetupXMLClass[] TestSetups { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class RibbonData : INotifyPropertyChanged
|
||||
{
|
||||
public ObservableCollection<TabData> TabDataCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_tabDataCollection != null) return _tabDataCollection;
|
||||
_tabDataCollection = new ObservableCollection<TabData>();
|
||||
for (int i = ViewModelData.TabCount, j = ViewModelData.ContextualTabGroupCount; i > 0; i--, j--)
|
||||
{
|
||||
if (j > 0)
|
||||
{
|
||||
var contextualTabGroupHeader = ContextualTabGroupDataCollection[j - 1].Header;
|
||||
_tabDataCollection.Insert(0, new TabData("Tab " + i) { ContextualTabGroupHeader = contextualTabGroupHeader });
|
||||
}
|
||||
else
|
||||
{
|
||||
_tabDataCollection.Insert(0, new TabData("Tab " + i));
|
||||
}
|
||||
}
|
||||
return _tabDataCollection;
|
||||
}
|
||||
}
|
||||
private ObservableCollection<TabData> _tabDataCollection;
|
||||
|
||||
public ObservableCollection<ContextualTabGroupData> ContextualTabGroupDataCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_contextualTabGroupDataCollection != null) return _contextualTabGroupDataCollection;
|
||||
_contextualTabGroupDataCollection = new ObservableCollection<ContextualTabGroupData>();
|
||||
for (var i = 0; i < ViewModelData.ContextualTabGroupCount; i++)
|
||||
{
|
||||
_contextualTabGroupDataCollection.Add(new ContextualTabGroupData("Grp " + i) { IsVisible = true });
|
||||
}
|
||||
return _contextualTabGroupDataCollection;
|
||||
}
|
||||
}
|
||||
private ObservableCollection<ContextualTabGroupData> _contextualTabGroupDataCollection;
|
||||
|
||||
public MenuButtonData ApplicationMenuData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_applicationMenuData != null) return _applicationMenuData;
|
||||
var smallImage = new Uri("/Common;component/RibbonControl/Images/Paste_16x16.png", UriKind.Relative);
|
||||
_applicationMenuData = new MenuButtonData(true)
|
||||
{
|
||||
Label = "AppMenu ",
|
||||
SmallImage = smallImage,
|
||||
ToolTipTitle = "ToolTip Title",
|
||||
ToolTipDescription = "ToolTip Description",
|
||||
ToolTipImage = smallImage
|
||||
};
|
||||
return _applicationMenuData;
|
||||
}
|
||||
}
|
||||
private MenuButtonData _applicationMenuData;
|
||||
|
||||
#region INotifyPropertyChanged Members
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected void OnPropertyChanged(PropertyChangedEventArgs e)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
PropertyChanged(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Events;
|
||||
using DTS.Common.Utilities.Logging;
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
using Microsoft.Practices.ServiceLocation;
|
||||
|
||||
namespace DTS.Common.Controls
|
||||
{
|
||||
/// <inheritdoc cref="IBasePropertyChanged" />
|
||||
/// <summary>
|
||||
/// Interaction logic for GridViewColumnHeaderSelectable.xaml
|
||||
/// </summary>
|
||||
public partial class GridViewColumnHeaderSearchableCheckBox : UserControl, IBasePropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public bool SetProperty<T>(ref T storage, T value, string propertyName = null)
|
||||
{
|
||||
if (Equals(storage, value)) return false;
|
||||
|
||||
storage = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnPropertyChanged(string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
public GridViewColumnHeaderSearchableCheckBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
var eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
|
||||
eventAggregator.GetEvent<ListViewStatusEvent>().Subscribe(OnListviewStatusEvent, ThreadOption.UIThread);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return HeaderTitle;
|
||||
}
|
||||
|
||||
private void OnListviewStatusEvent(ListViewStatusArg arg)
|
||||
{
|
||||
if (arg.Status != ListViewStatusArg.ListViewStatus.Unloaded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (arg.Id == ListviewId)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public string ListviewId
|
||||
{
|
||||
get => (string) GetValue(ListviewIdProperty);
|
||||
set => SetValue(ListviewIdProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ListviewIdProperty =
|
||||
DependencyProperty.Register(
|
||||
"ListviewId",
|
||||
typeof(string),
|
||||
typeof(GridViewColumnHeaderSearchableCheckBox), new PropertyMetadata(""));
|
||||
|
||||
public string HeaderTitle
|
||||
{
|
||||
get => (string) GetValue(HeaderTitleProperty);
|
||||
set => SetValue(HeaderTitleProperty, value);
|
||||
}
|
||||
|
||||
// Using a DependencyProperty enables animation, styling, binding, etc.
|
||||
public static readonly DependencyProperty HeaderTitleProperty =
|
||||
DependencyProperty.Register(
|
||||
"HeaderTitle", // The name of the DependencyProperty
|
||||
typeof(string), // The type of the DependencyProperty
|
||||
typeof(GridViewColumnHeaderSearchableCheckBox), // The type of the owner of the DependencyProperty
|
||||
new PropertyMetadata( // OnHeaderTitleChanged will be called when HeaderTitle changes
|
||||
"Awesome", // The default value of the DependencyProperty
|
||||
OnHeaderTitleChanged
|
||||
)
|
||||
);
|
||||
|
||||
private static void OnHeaderTitleChanged(
|
||||
DependencyObject d,
|
||||
DependencyPropertyChangedEventArgs e
|
||||
)
|
||||
{
|
||||
if (d is GridViewColumnHeaderSearchableCheckBox instance)
|
||||
{
|
||||
instance.HeaderTitle = (string) e.NewValue;
|
||||
}
|
||||
}
|
||||
|
||||
private bool _toggleButtonIsChecked = false;
|
||||
/// <summary>
|
||||
/// holds whether the toggle button is checked or not and controls whether the popup is open or not
|
||||
/// </summary>
|
||||
public bool ToggleButtonIsChecked
|
||||
{
|
||||
get => _toggleButtonIsChecked;
|
||||
set
|
||||
{
|
||||
if (value == _toggleButtonIsChecked) return;
|
||||
_toggleButtonIsChecked = value;
|
||||
OnPropertyChanged("ToggleButtonIsChecked");
|
||||
OnPropertyChanged("ToggleIconGeometry");
|
||||
RaiseOpenChangedEvent(value);
|
||||
}
|
||||
}
|
||||
public Geometry ToggleIconGeometry
|
||||
{
|
||||
get
|
||||
{
|
||||
if(string.IsNullOrEmpty(HeaderSearchTerm))
|
||||
{
|
||||
return (Geometry)dtsGridViewColumnHeader.FindResource("DownArrowIconGeometry");
|
||||
}
|
||||
return (Geometry)dtsGridViewColumnHeader.FindResource("FilterIconGeometry");
|
||||
}
|
||||
}
|
||||
public string HeaderSearchTerm
|
||||
{
|
||||
get => (string)GetValue(HeaderSearchTermProperty);
|
||||
set => SetValue(HeaderSearchTermProperty, value);
|
||||
}
|
||||
|
||||
// Using a DependencyProperty enables animation, styling, binding, etc.
|
||||
public static readonly DependencyProperty HeaderSearchTermProperty =
|
||||
DependencyProperty.Register(
|
||||
"HeaderSearchTerm", // The name of the DependencyProperty
|
||||
typeof(string), // The type of the DependencyProperty
|
||||
typeof(GridViewColumnHeaderSearchableCheckBox), // The type of the owner of the DependencyProperty
|
||||
new PropertyMetadata( // OnHeaderTitleChanged will be called when HeaderTitle changes
|
||||
"", // The default value of the DependencyProperty
|
||||
OnHeaderSearchTermChanged
|
||||
)
|
||||
);
|
||||
|
||||
private static void OnHeaderSearchTermChanged(
|
||||
DependencyObject d,
|
||||
DependencyPropertyChangedEventArgs e
|
||||
)
|
||||
{
|
||||
if (!(d is GridViewColumnHeaderSearchableCheckBox instance)) return;
|
||||
instance.HeaderSearchTerm = (string)e.NewValue;
|
||||
instance.RaiseSearchEvent((string)e.NewValue);
|
||||
}
|
||||
|
||||
// Create a custom routed event by first registering a RoutedEventID
|
||||
// This event uses the bubbling routing strategy
|
||||
public static readonly RoutedEvent SearchEvent = EventManager.RegisterRoutedEvent(
|
||||
"SearchCheckBox", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(GridViewColumnHeaderSearchableCheckBox));
|
||||
|
||||
// Provide CLR accessors for the event
|
||||
public event RoutedEventHandler Search
|
||||
{
|
||||
add => AddHandler(SearchEvent, value);
|
||||
remove => RemoveHandler(SearchEvent, value);
|
||||
}
|
||||
|
||||
// This method raises the Tap event
|
||||
private void RaiseSearchEvent(string searchTerm)
|
||||
{
|
||||
var newEventArgs = new RoutedEventArgs(SearchEvent, searchTerm);
|
||||
RaiseEvent(newEventArgs);
|
||||
OnPropertyChanged("ToggleIconGeometry");
|
||||
}
|
||||
public static readonly DependencyProperty HeaderIsCheckedProperty =
|
||||
DependencyProperty.Register(
|
||||
"ToggleButtonIsChecked",
|
||||
typeof(bool),
|
||||
typeof(GridViewColumnHeaderSearchableCheckBox),
|
||||
new PropertyMetadata(
|
||||
false,
|
||||
OnHeaderIsOpenChanged
|
||||
)
|
||||
);
|
||||
|
||||
private static void OnHeaderIsOpenChanged(
|
||||
DependencyObject d,
|
||||
DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is GridViewColumnHeaderSearchableCheckBox instance)) return;
|
||||
instance.ToggleButtonIsChecked = (bool)e.NewValue;
|
||||
var isOpen = instance.ToggleButtonIsChecked;
|
||||
instance.RaiseOpenChangedEvent(isOpen);
|
||||
}
|
||||
|
||||
// Create a custom routed event by first registering a RoutedEventID
|
||||
// This event uses the bubbling routing strategy
|
||||
public static readonly RoutedEvent OpenChangedEvent = EventManager.RegisterRoutedEvent(
|
||||
"OpenChanged", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(GridViewColumnHeaderSearchableCheckBox));
|
||||
|
||||
// Provide CLR accessors for the event
|
||||
public event RoutedEventHandler OpenChanged
|
||||
{
|
||||
add => AddHandler(OpenChangedEvent, value);
|
||||
remove => RemoveHandler(OpenChangedEvent, value);
|
||||
}
|
||||
|
||||
// This method raises the Tap event
|
||||
private void RaiseOpenChangedEvent(bool isOpen)
|
||||
{
|
||||
var newEventArgs = new RoutedEventArgs(OpenChangedEvent, isOpen);
|
||||
RaiseEvent(newEventArgs);
|
||||
}
|
||||
|
||||
public static readonly RoutedEvent ClickEvent = EventManager.RegisterRoutedEvent(
|
||||
"ClickHandler", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(GridViewColumnHeaderSearchableCheckBox));
|
||||
|
||||
public event RoutedEventHandler ClickHandler
|
||||
{
|
||||
add => AddHandler(ClickEvent, value);
|
||||
remove => RemoveHandler(ClickEvent, value);
|
||||
}
|
||||
|
||||
private void RaiseClickEvent(object tag)
|
||||
{
|
||||
var newEventArgs = new RoutedEventArgs(ClickEvent, tag);
|
||||
RaiseEvent(newEventArgs);
|
||||
}
|
||||
|
||||
private void PreviewLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
RaiseClickEvent(Tag);
|
||||
}
|
||||
|
||||
private void SelectAllButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RaiseFilterEvent(@"All");
|
||||
}
|
||||
private void TrueButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RaiseFilterEvent("True");
|
||||
}
|
||||
|
||||
private void FalseButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RaiseFilterEvent("False");
|
||||
}
|
||||
|
||||
// Create a custom routed event by first registering a RoutedEventID
|
||||
// This event uses the bubbling routing strategy
|
||||
public static readonly RoutedEvent FilterEvent = EventManager.RegisterRoutedEvent(
|
||||
"Filter", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(GridViewColumnHeaderSearchableCheckBox));
|
||||
|
||||
// Provide CLR accessors for the event
|
||||
public event RoutedEventHandler Filter
|
||||
{
|
||||
add => AddHandler(FilterEvent, value);
|
||||
remove => RemoveHandler(FilterEvent, value);
|
||||
}
|
||||
|
||||
// This method raises the Tap event
|
||||
private void RaiseFilterEvent(string filter)
|
||||
{
|
||||
var newEventArgs = new RoutedEventArgs(FilterEvent, filter);
|
||||
RaiseEvent(newEventArgs);
|
||||
OnPropertyChanged("ToggleIconGeometry");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user