init
This commit is contained in:
@@ -0,0 +1,207 @@
|
||||
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 Prism.Events;
|
||||
using Prism.Ioc;
|
||||
|
||||
namespace DTS.Common.Controls
|
||||
{
|
||||
/// <inheritdoc cref="IBasePropertyChanged" />
|
||||
/// <summary>
|
||||
/// Interaction logic for GridViewColumnHeaderSelectable.xaml
|
||||
/// </summary>
|
||||
public partial class GridViewColumnHeaderSelectable : 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 GridViewColumnHeaderSelectable()
|
||||
{
|
||||
InitializeComponent();
|
||||
var eventAggregator = ContainerLocator.Container.Resolve<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(GridViewColumnHeaderSelectable), 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(GridViewColumnHeaderSelectable), // 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 GridViewColumnHeaderSelectable 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 static readonly DependencyProperty HeaderIsCheckedProperty =
|
||||
DependencyProperty.Register(
|
||||
"ToggleButtonIsChecked",
|
||||
typeof(bool),
|
||||
typeof(GridViewColumnHeaderSelectable),
|
||||
new PropertyMetadata(
|
||||
false,
|
||||
OnHeaderIsOpenChanged
|
||||
)
|
||||
);
|
||||
|
||||
private static void OnHeaderIsOpenChanged(
|
||||
DependencyObject d,
|
||||
DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is GridViewColumnHeaderSelectable 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(GridViewColumnHeaderSelectable));
|
||||
|
||||
// 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(GridViewColumnHeaderSelectable));
|
||||
|
||||
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)
|
||||
{
|
||||
RaiseSelectAllEvent(true);
|
||||
}
|
||||
private void ClearAllButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RaiseSelectAllEvent(false);
|
||||
}
|
||||
|
||||
// Create a custom routed event by first registering a RoutedEventID
|
||||
// This event uses the bubbling routing strategy
|
||||
public static readonly RoutedEvent SelectAllEvent = EventManager.RegisterRoutedEvent(
|
||||
"SelectAll", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(GridViewColumnHeaderSelectable));
|
||||
|
||||
// Provide CLR accessors for the event
|
||||
public event RoutedEventHandler SelectAll
|
||||
{
|
||||
add => AddHandler(SelectAllEvent, value);
|
||||
remove => RemoveHandler(SelectAllEvent, value);
|
||||
}
|
||||
|
||||
// This method raises the Tap event
|
||||
private void RaiseSelectAllEvent(bool selectAll)
|
||||
{
|
||||
var newEventArgs = new RoutedEventArgs(SelectAllEvent, selectAll);
|
||||
RaiseEvent(newEventArgs);
|
||||
OnPropertyChanged("ToggleIconGeometry");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common.Interface.Groups.GroupTemplateList
|
||||
{
|
||||
public interface IGroupListView : IBaseView { }
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DTS.Common.Converters
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Represents the converter that converts Boolean values to Opacity value.
|
||||
/// Use the BooleanToOpacityConverter class to convert a Boolean to Opacity value to provide visual feedback to the user if control enable or disable.
|
||||
/// </summary>
|
||||
public class BooleanToOpacityConverter : IValueConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a Boolean value to a Opacity to show user control enable/disable.
|
||||
/// </summary>
|
||||
/// <param name="value">The Boolean value to convert. This value can be a standard Boolean value or a nullable Boolean value.</param>
|
||||
/// <param name="targetType">This parameter is not used.</param>
|
||||
/// <param name="parameter">The converter parameter to use.</param>
|
||||
/// <param name="culture">This parameter is not used.</param>
|
||||
/// <returns>The value to be passed to the target dependency property.</returns>
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
|
||||
if (value != null && (bool)value)
|
||||
return 0.5;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 865 B |
@@ -0,0 +1,27 @@
|
||||
using DTS.Common.Enums.Hardware;
|
||||
using DTS.Common.Interface.DataRecorders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DTS.Common.Interface.DASFactory.Diagnostics
|
||||
{
|
||||
public interface IISOHardware : IDASDBRecord
|
||||
{
|
||||
void GetChannelsString(out int analog, out int digitalIn, out int digitalOut, out int squib, out int uart, out int streamOut, out int streamIn);
|
||||
HardwareTypes DASTypeEnum { get; set; }
|
||||
string IPAddress { get; set; }
|
||||
//Pseudo racks are racks are collections of hardware that associated with each
|
||||
//other but aren't racks, this includes SLICE slabs and SLICE6 with S6DB
|
||||
//this just indicates whether it's capable, not whether it's serving that role
|
||||
bool IsPseudoRackModule();
|
||||
bool IsTSRAIR();
|
||||
bool ValidateSerialNumber(ref List<string> errors);
|
||||
bool ValidateIPAddress(ref List<string> errors);
|
||||
void Insert();
|
||||
void Update();
|
||||
/// <summary>
|
||||
/// remove this hardware from the database
|
||||
/// </summary>
|
||||
void Delete();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user