inital
This commit is contained in:
16
F4SD-AdaptableIcon/AdaptableIcon.xaml
Normal file
16
F4SD-AdaptableIcon/AdaptableIcon.xaml
Normal file
@@ -0,0 +1,16 @@
|
||||
<UserControl x:Class="FasdDesktopUi.Basics.UserControls.AdaptableIcon.AdaptableIcon"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
|
||||
<Border x:Name="IconBorder">
|
||||
|
||||
<Grid x:Name="MainGrid"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"/>
|
||||
|
||||
</Border>
|
||||
</UserControl>
|
||||
373
F4SD-AdaptableIcon/AdaptableIcon.xaml.cs
Normal file
373
F4SD-AdaptableIcon/AdaptableIcon.xaml.cs
Normal file
@@ -0,0 +1,373 @@
|
||||
using F4SD_AdaptableIcon.Enums;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using static C4IT.Logging.cLogManager;
|
||||
|
||||
namespace FasdDesktopUi.Basics.UserControls.AdaptableIcon
|
||||
{
|
||||
public partial class AdaptableIcon : UserControl, ICommandSource
|
||||
{
|
||||
private readonly cIconPainter.cIconInformation iconInformation = new cIconPainter.cIconInformation();
|
||||
|
||||
#region Properties
|
||||
|
||||
#region Command Properties
|
||||
|
||||
public ICommand Command
|
||||
{
|
||||
get { return (ICommand)GetValue(CommandProperty); }
|
||||
set { SetValue(CommandProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty CommandProperty =
|
||||
DependencyProperty.Register("Command", typeof(ICommand), typeof(AdaptableIcon), new PropertyMetadata(null));
|
||||
|
||||
|
||||
public object CommandParameter
|
||||
{
|
||||
get { return (object)GetValue(CommandParameterProperty); }
|
||||
set { SetValue(CommandParameterProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty CommandParameterProperty =
|
||||
DependencyProperty.Register("CommandParameter", typeof(object), typeof(AdaptableIcon), new PropertyMetadata(null));
|
||||
|
||||
|
||||
public IInputElement CommandTarget
|
||||
{
|
||||
get { return (IInputElement)GetValue(CommandTargetProperty); }
|
||||
set { SetValue(CommandTargetProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty CommandTargetProperty =
|
||||
DependencyProperty.Register("CommandTarget", typeof(IInputElement), typeof(AdaptableIcon), new PropertyMetadata(null));
|
||||
|
||||
|
||||
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonUp(e);
|
||||
|
||||
try
|
||||
{
|
||||
if (Command is null)
|
||||
return;
|
||||
|
||||
if (!Command.CanExecute(CommandParameter))
|
||||
return;
|
||||
|
||||
if (Command is RoutedCommand routedCommand)
|
||||
routedCommand.Execute(CommandParameter, CommandTarget);
|
||||
else
|
||||
Command.Execute(CommandParameter);
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTouchDown(TouchEventArgs e)
|
||||
{
|
||||
base.OnTouchDown(e);
|
||||
|
||||
try
|
||||
{
|
||||
if (Command is null)
|
||||
return;
|
||||
|
||||
if (!Command.CanExecute(CommandParameter))
|
||||
return;
|
||||
|
||||
if (Command is RoutedCommand routedCommand)
|
||||
routedCommand.Execute(CommandParameter, CommandTarget);
|
||||
else
|
||||
Command.Execute(CommandParameter);
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public string IconName { get => iconInformation?.IconName; }
|
||||
|
||||
#region IconBackgroundColor DP
|
||||
|
||||
public static readonly DependencyProperty IconBackgroundColorProperty =
|
||||
DependencyProperty.Register("IconBackgroundColor", typeof(Brush), typeof(AdaptableIcon), new PropertyMetadata(Brushes.Transparent, new PropertyChangedCallback(IconInformationChanged)));
|
||||
|
||||
public Brush IconBackgroundColor
|
||||
{
|
||||
get { return (Brush)GetValue(IconBackgroundColorProperty); }
|
||||
set { SetValue(IconBackgroundColorProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IconHeight DP
|
||||
|
||||
public static readonly DependencyProperty IconHeightProperty =
|
||||
DependencyProperty.Register("IconHeight", typeof(double), typeof(AdaptableIcon), new PropertyMetadata(30.0, new PropertyChangedCallback(IconInformationChanged)));
|
||||
public double IconHeight
|
||||
{
|
||||
get { return (double)GetValue(IconHeightProperty); }
|
||||
set { SetValue(IconHeightProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IconWidth DP
|
||||
|
||||
public static readonly DependencyProperty IconWidthProperty =
|
||||
DependencyProperty.Register("IconWidth", typeof(double), typeof(AdaptableIcon), new PropertyMetadata(30.0, new PropertyChangedCallback(IconInformationChanged)));
|
||||
public double IconWidth
|
||||
{
|
||||
get { return (double)GetValue(IconWidthProperty); }
|
||||
set { SetValue(IconWidthProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region BorderPadding DP
|
||||
|
||||
public static readonly DependencyProperty BorderPaddingProperty =
|
||||
DependencyProperty.Register("BorderPadding", typeof(Thickness), typeof(AdaptableIcon), new PropertyMetadata(new Thickness(7.5), new PropertyChangedCallback(IconInformationChanged)));
|
||||
public Thickness BorderPadding
|
||||
{
|
||||
get { return (Thickness)GetValue(BorderPaddingProperty); }
|
||||
set { SetValue(BorderPaddingProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IconCornerRadius DP
|
||||
|
||||
public static readonly DependencyProperty IconCornerRadiusProperty =
|
||||
DependencyProperty.Register("IconCornerRadius", typeof(CornerRadius), typeof(AdaptableIcon), new PropertyMetadata(new CornerRadius(5), new PropertyChangedCallback(IconInformationChanged)));
|
||||
public CornerRadius IconCornerRadius
|
||||
{
|
||||
get { return (CornerRadius)GetValue(IconCornerRadiusProperty); }
|
||||
set { SetValue(IconCornerRadiusProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PrimaryIconColor DP
|
||||
|
||||
public static readonly DependencyProperty PrimaryIconColorProperty =
|
||||
DependencyProperty.Register("PrimaryIconColor", typeof(SolidColorBrush), typeof(AdaptableIcon), new PropertyMetadata(Brushes.Black, new PropertyChangedCallback(IconInformationChanged)));
|
||||
public SolidColorBrush PrimaryIconColor
|
||||
{
|
||||
get { return (SolidColorBrush)GetValue(PrimaryIconColorProperty); }
|
||||
set { SetValue(PrimaryIconColorProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SecondaryIconColor DP
|
||||
|
||||
public static readonly DependencyProperty SecondaryIconColorProperty =
|
||||
DependencyProperty.Register("SecondaryIconColor", typeof(Brush), typeof(AdaptableIcon), new PropertyMetadata(Brushes.White, new PropertyChangedCallback(IconInformationChanged)));
|
||||
public Brush SecondaryIconColor
|
||||
{
|
||||
get { return (Brush)GetValue(SecondaryIconColorProperty); }
|
||||
set { SetValue(SecondaryIconColorProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SelectedInternIcon
|
||||
|
||||
public enumInternIcons? SelectedInternIcon
|
||||
{
|
||||
get { return (enumInternIcons?)GetValue(SelectedInternIconProperty); }
|
||||
set { SetValue(SelectedInternIconProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SelectedInternIconProperty =
|
||||
DependencyProperty.Register("SelectedInternIcon", typeof(enumInternIcons?), typeof(AdaptableIcon), new PropertyMetadata(null, new PropertyChangedCallback(SelectedIconChanged)), ValidateInternIcon);
|
||||
|
||||
private static bool ValidateInternIcon(object o)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SelectedInternGif
|
||||
|
||||
public static readonly DependencyProperty SelectedInternGifProperty =
|
||||
DependencyProperty.Register("SelectedInternGif", typeof(enumInternGif?), typeof(AdaptableIcon), new PropertyMetadata(null, new PropertyChangedCallback(SelectedIconChanged)));
|
||||
|
||||
public enumInternGif? SelectedInternGif
|
||||
{
|
||||
get { return (enumInternGif?)GetValue(SelectedInternGifProperty); }
|
||||
set { SetValue(SelectedInternGifProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SelectedMaterialIcon
|
||||
|
||||
public MaterialIcons.MaterialIconType? SelectedMaterialIcon
|
||||
{
|
||||
get { return (MaterialIcons.MaterialIconType?)GetValue(SelectedMaterialIconProperty); }
|
||||
set { SetValue(SelectedMaterialIconProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SelectedMaterialIconProperty =
|
||||
DependencyProperty.Register("SelectedMaterialIcon", typeof(MaterialIcons.MaterialIconType?), typeof(AdaptableIcon), new PropertyMetadata(null, new PropertyChangedCallback(SelectedIconChanged)));
|
||||
|
||||
#endregion
|
||||
|
||||
#region SelectedCountryCode
|
||||
|
||||
public enumCountryCode? SelectedCountryCode
|
||||
{
|
||||
get { return (enumCountryCode?)GetValue(SelectedCountryCodeProperty); }
|
||||
set { SetValue(SelectedCountryCodeProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SelectedCountryCodeProperty =
|
||||
DependencyProperty.Register("SelectedCountryCode", typeof(enumCountryCode?), typeof(AdaptableIcon), new PropertyMetadata(null, new PropertyChangedCallback(SelectedIconChanged)));
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private static void IconInformationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (d is AdaptableIcon _me)
|
||||
_me.UpdateIconInformation();
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SelectedIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(d))
|
||||
return;
|
||||
|
||||
if (!(d is AdaptableIcon _me))
|
||||
return;
|
||||
|
||||
if (e.NewValue is null)
|
||||
return;
|
||||
|
||||
if (e.NewValue is enumInternIcons selectedInternIcon)
|
||||
_me.iconInformation.UpdateIconInformation(selectedInternIcon);
|
||||
|
||||
if (e.NewValue is enumInternGif selectedInternGif)
|
||||
_me.iconInformation.UpdateIconInformation(selectedInternGif);
|
||||
|
||||
if (e.NewValue is MaterialIcons.MaterialIconType selectedMaterialIcon)
|
||||
_me.iconInformation.UpdateIconInformation(selectedMaterialIcon);
|
||||
|
||||
if (e.NewValue is enumCountryCode selectedCountryCode)
|
||||
_me.iconInformation.UpdateIconInformation(selectedCountryCode);
|
||||
|
||||
_me.UpdateIconInformation();
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public AdaptableIcon()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnInitialized(EventArgs e)
|
||||
{
|
||||
base.OnInitialized(e);
|
||||
UpdateIconInformation();
|
||||
}
|
||||
|
||||
public (enumInternIcons?, enumInternGif?, MaterialIcons.MaterialIconType?, enumCountryCode?) GetCurrentIcon()
|
||||
{
|
||||
return (SelectedInternIcon, SelectedInternGif, SelectedMaterialIcon, SelectedCountryCode);
|
||||
}
|
||||
|
||||
public void SetIcon((enumInternIcons? InternIcon, enumInternGif? InternGif, MaterialIcons.MaterialIconType? MaterialIcon, enumCountryCode? CountryCode) IconValues)
|
||||
{
|
||||
try
|
||||
{
|
||||
SelectedInternIcon = IconValues.InternIcon;
|
||||
SelectedInternGif = IconValues.InternGif;
|
||||
SelectedMaterialIcon = IconValues.MaterialIcon;
|
||||
SelectedCountryCode = IconValues.CountryCode;
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateIconInformation()
|
||||
{
|
||||
try
|
||||
{
|
||||
iconInformation.IconHeightInPx = IconHeight;
|
||||
iconInformation.IconWidthInPx = IconWidth;
|
||||
iconInformation.PrimaryIconColor = PrimaryIconColor;
|
||||
iconInformation.SecondaryIconColor = SecondaryIconColor;
|
||||
|
||||
UpdateIcon();
|
||||
UpdateIconBorder();
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateIcon()
|
||||
{
|
||||
try
|
||||
{
|
||||
MainGrid.Children.Clear();
|
||||
|
||||
var newIcon = cIconPainter.GetIcon(iconInformation);
|
||||
|
||||
if (newIcon != null)
|
||||
MainGrid.Children.Add(newIcon);
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateIconBorder()
|
||||
{
|
||||
try
|
||||
{
|
||||
IconBorder.Background = IconBackgroundColor;
|
||||
IconBorder.Height = IconHeight;
|
||||
IconBorder.Width = IconWidth;
|
||||
IconBorder.CornerRadius = IconCornerRadius;
|
||||
IconBorder.Padding = BorderPadding;
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
255
F4SD-AdaptableIcon/Enums/CountryCode.cs
Normal file
255
F4SD-AdaptableIcon/Enums/CountryCode.cs
Normal file
@@ -0,0 +1,255 @@
|
||||
namespace F4SD_AdaptableIcon.Enums
|
||||
{
|
||||
public enum enumCountryCode //Reference: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
|
||||
{
|
||||
AF,
|
||||
AX,
|
||||
AL,
|
||||
DZ,
|
||||
AS,
|
||||
AD,
|
||||
AO,
|
||||
AI,
|
||||
AQ,
|
||||
AG,
|
||||
AR,
|
||||
AM,
|
||||
AW,
|
||||
AU,
|
||||
AT,
|
||||
AZ,
|
||||
BS,
|
||||
BH,
|
||||
BD,
|
||||
BB,
|
||||
BY,
|
||||
BE,
|
||||
BZ,
|
||||
BJ,
|
||||
BM,
|
||||
BT,
|
||||
BO,
|
||||
BQ,
|
||||
BA,
|
||||
BW,
|
||||
BV,
|
||||
BR,
|
||||
IO,
|
||||
BN,
|
||||
BG,
|
||||
BF,
|
||||
BI,
|
||||
CV,
|
||||
KH,
|
||||
CM,
|
||||
CA,
|
||||
KY,
|
||||
CF,
|
||||
TD,
|
||||
CL,
|
||||
CN,
|
||||
CX,
|
||||
CC,
|
||||
CO,
|
||||
KM,
|
||||
CD,
|
||||
CG,
|
||||
CK,
|
||||
CR,
|
||||
CI,
|
||||
HR,
|
||||
CU,
|
||||
CW,
|
||||
CY,
|
||||
CZ,
|
||||
DK,
|
||||
DJ,
|
||||
DM,
|
||||
DO,
|
||||
EC,
|
||||
EG,
|
||||
SV,
|
||||
GQ,
|
||||
ER,
|
||||
EE,
|
||||
SZ,
|
||||
ET,
|
||||
FK,
|
||||
FO,
|
||||
FJ,
|
||||
FI,
|
||||
FR,
|
||||
GF,
|
||||
PF,
|
||||
TF,
|
||||
GA,
|
||||
GM,
|
||||
GE,
|
||||
DE,
|
||||
GH,
|
||||
GI,
|
||||
GR,
|
||||
GL,
|
||||
GD,
|
||||
GP,
|
||||
GU,
|
||||
GT,
|
||||
GG,
|
||||
GN,
|
||||
GW,
|
||||
GY,
|
||||
HT,
|
||||
HM,
|
||||
VA,
|
||||
HN,
|
||||
HK,
|
||||
HU,
|
||||
IS,
|
||||
IN,
|
||||
ID,
|
||||
IR,
|
||||
IQ,
|
||||
IE,
|
||||
IM,
|
||||
IL,
|
||||
IT,
|
||||
JM,
|
||||
JP,
|
||||
JE,
|
||||
JO,
|
||||
KZ,
|
||||
KE,
|
||||
KI,
|
||||
KP,
|
||||
KR,
|
||||
KW,
|
||||
KG,
|
||||
LA,
|
||||
LV,
|
||||
LB,
|
||||
LS,
|
||||
LR,
|
||||
LY,
|
||||
LI,
|
||||
LT,
|
||||
LU,
|
||||
MO,
|
||||
MK,
|
||||
MG,
|
||||
MW,
|
||||
MY,
|
||||
MV,
|
||||
ML,
|
||||
MT,
|
||||
MH,
|
||||
MQ,
|
||||
MR,
|
||||
MU,
|
||||
YT,
|
||||
MX,
|
||||
FM,
|
||||
MD,
|
||||
MC,
|
||||
MN,
|
||||
ME,
|
||||
MS,
|
||||
MA,
|
||||
MZ,
|
||||
MM,
|
||||
NA,
|
||||
NR,
|
||||
NP,
|
||||
NL,
|
||||
NC,
|
||||
NZ,
|
||||
NI,
|
||||
NE,
|
||||
NG,
|
||||
NU,
|
||||
NF,
|
||||
MP,
|
||||
NO,
|
||||
OM,
|
||||
PK,
|
||||
PW,
|
||||
PS,
|
||||
PA,
|
||||
PG,
|
||||
PY,
|
||||
PE,
|
||||
PH,
|
||||
PN,
|
||||
PL,
|
||||
PT,
|
||||
PR,
|
||||
QA,
|
||||
RE,
|
||||
RO,
|
||||
RU,
|
||||
RW,
|
||||
BL,
|
||||
SH,
|
||||
KN,
|
||||
LC,
|
||||
MF,
|
||||
PM,
|
||||
VC,
|
||||
WS,
|
||||
SM,
|
||||
ST,
|
||||
SA,
|
||||
SN,
|
||||
RS,
|
||||
SC,
|
||||
SL,
|
||||
SG,
|
||||
SX,
|
||||
SK,
|
||||
SI,
|
||||
SB,
|
||||
SO,
|
||||
ZA,
|
||||
GS,
|
||||
SS,
|
||||
ES,
|
||||
LK,
|
||||
SD,
|
||||
SR,
|
||||
SJ,
|
||||
SE,
|
||||
CH,
|
||||
SY,
|
||||
TW,
|
||||
TJ,
|
||||
TZ,
|
||||
TH,
|
||||
TL,
|
||||
TG,
|
||||
TK,
|
||||
TO,
|
||||
TT,
|
||||
TN,
|
||||
TR,
|
||||
TM,
|
||||
TC,
|
||||
TV,
|
||||
UG,
|
||||
UA,
|
||||
AE,
|
||||
GB,
|
||||
UM,
|
||||
US,
|
||||
UY,
|
||||
UZ,
|
||||
VU,
|
||||
VE,
|
||||
VN,
|
||||
VG,
|
||||
VI,
|
||||
WF,
|
||||
EH,
|
||||
YE,
|
||||
ZM,
|
||||
ZW
|
||||
}
|
||||
}
|
||||
17
F4SD-AdaptableIcon/Enums/IconType.cs
Normal file
17
F4SD-AdaptableIcon/Enums/IconType.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace F4SD_AdaptableIcon.Enums
|
||||
{
|
||||
public enum enumIconTypes
|
||||
{
|
||||
intern = 0,
|
||||
material,
|
||||
byImage,
|
||||
gif,
|
||||
flag
|
||||
}
|
||||
}
|
||||
93
F4SD-AdaptableIcon/Enums/InternIcon.cs
Normal file
93
F4SD-AdaptableIcon/Enums/InternIcon.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace F4SD_AdaptableIcon.Enums
|
||||
{
|
||||
public enum enumInternIcons
|
||||
{
|
||||
none = 0,
|
||||
fasd,
|
||||
f4sd,
|
||||
f4sd_outline,
|
||||
f4sd_speedo,
|
||||
f4sd_product_logo,
|
||||
|
||||
//Lock
|
||||
lock_closed,
|
||||
lock_closedHover,
|
||||
lock_open,
|
||||
lock_openHover,
|
||||
|
||||
//MenuBar
|
||||
menuBar_copy,
|
||||
menuBar_details,
|
||||
menuBar_mail,
|
||||
menuBar_more,
|
||||
menuBar_nexThink,
|
||||
menuBar_refresh,
|
||||
menuBar_refresh_request,
|
||||
menuBar_remote,
|
||||
menuBar_screenShot,
|
||||
menuBar_search,
|
||||
menuBar_search_noResults,
|
||||
menuBar_settings,
|
||||
|
||||
//miscellaneous
|
||||
misc_pin,
|
||||
misc_pinned,
|
||||
misc_copy_bolt,
|
||||
misc_chevron_left,
|
||||
misc_chevron_right,
|
||||
misc_chevron_mid,
|
||||
misc_chevron_down,
|
||||
misc_check,
|
||||
misc_computer,
|
||||
misc_computer_disabled,
|
||||
misc_directConnection,
|
||||
misc_dot,
|
||||
misc_functionMarker,
|
||||
misc_functionBolt,
|
||||
misc_heart,
|
||||
misc_play,
|
||||
misc_plus,
|
||||
misc_screwdriver,
|
||||
misc_ticket,
|
||||
misc_time,
|
||||
misc_tool,
|
||||
misc_user,
|
||||
misc_user_disabled,
|
||||
|
||||
//StatusIcons
|
||||
status_bad,
|
||||
status_danger,
|
||||
status_empty,
|
||||
status_good,
|
||||
status_info,
|
||||
|
||||
//Style
|
||||
style_moon,
|
||||
style_moonFilled,
|
||||
style_sun,
|
||||
style_sunFilled,
|
||||
|
||||
//Window
|
||||
window_close,
|
||||
window_dock_left,
|
||||
window_dock_right,
|
||||
window_fullscreen,
|
||||
window_fullscreenExit,
|
||||
window_minimize,
|
||||
window_toSlim
|
||||
}
|
||||
|
||||
public enum enumInternGif
|
||||
{
|
||||
none,
|
||||
partyPopper,
|
||||
loadingSpinner,
|
||||
loadingPoints
|
||||
}
|
||||
}
|
||||
121
F4SD-AdaptableIcon/F4SD-AdaptableIcon.csproj
Normal file
121
F4SD-AdaptableIcon/F4SD-AdaptableIcon.csproj
Normal file
@@ -0,0 +1,121 @@
|
||||
<?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>{BAB63A6A-1524-435D-9F96-7A30B6EE0624}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>F4SD_AdaptableIcon</RootNamespace>
|
||||
<AssemblyName>F4SD-AdaptableIcon</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>false</Deterministic>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Demo%28Debug%29|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Demo%28Debug%29\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NewFeatures%28Debug%29|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\NewFeatures%28Debug%29\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MaterialIcons, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MaterialIcons.1.0.3\lib\MaterialIcons.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<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="WindowsBase" />
|
||||
<Reference Include="WpfAnimatedGif, Version=2.0.0.0, Culture=neutral, PublicKeyToken=9e7cd3b544a090dc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\WpfAnimatedGif.2.0.2\lib\net40\WpfAnimatedGif.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="AdaptableIcon.xaml.cs">
|
||||
<DependentUpon>AdaptableIcon.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Enums\CountryCode.cs" />
|
||||
<Compile Include="Enums\IconType.cs" />
|
||||
<Compile Include="Enums\InternIcon.cs" />
|
||||
<Compile Include="Flags\DE.xaml.cs">
|
||||
<DependentUpon>DE.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Flags\GB.xaml.cs">
|
||||
<DependentUpon>GB.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="IconData.cs" />
|
||||
<Compile Include="IconPainter.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\F4SD-Logging\F4SD-Logging.csproj">
|
||||
<Project>{7793f281-b226-4e20-b6f6-5d53d70f1dc1}</Project>
|
||||
<Name>F4SD-Logging</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="AdaptableIcon.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Flags\DE.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Flags\GB.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
10
F4SD-AdaptableIcon/F4SD-AdaptableIcon.csproj.vspscc
Normal file
10
F4SD-AdaptableIcon/F4SD-AdaptableIcon.csproj.vspscc
Normal file
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
53
F4SD-AdaptableIcon/Flags/DE.xaml
Normal file
53
F4SD-AdaptableIcon/Flags/DE.xaml
Normal file
@@ -0,0 +1,53 @@
|
||||
<UserControl x:Class="F4SD_AdaptableIcon.Flags.DE"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:F4SD_AdaptableIcon.Flags"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="140"
|
||||
d:DesignWidth="140">
|
||||
|
||||
<!--Reference Document-Size in Expression Design: 100px x 100px and 72 DPI => Canvas Size 133.333x133.333 -->
|
||||
|
||||
<Viewbox ClipToBounds="True">
|
||||
<Canvas x:Name="Germany"
|
||||
Width="133.333"
|
||||
Height="133.333"
|
||||
Canvas.Left="0"
|
||||
Canvas.Top="0">
|
||||
<Path x:Name="Path"
|
||||
Width="133.395"
|
||||
Height="44.4648"
|
||||
Canvas.Left="0"
|
||||
Canvas.Top="88.8685"
|
||||
Stretch="Fill"
|
||||
Fill="#FFFECD00"
|
||||
Data="F1 M 0,111.101L 0,88.8685L 133.395,88.8685L 133.395,133.333L 0,133.333" />
|
||||
<Path x:Name="Path_1"
|
||||
Width="133.395"
|
||||
Height="44.4648"
|
||||
Canvas.Left="0"
|
||||
Canvas.Top="44.4036"
|
||||
Stretch="Fill"
|
||||
Fill="#FFDC0000"
|
||||
Data="F1 M 0,66.6363L 0,44.4036L 133.395,44.4036L 133.395,88.8685L 0,88.8685" />
|
||||
<Path x:Name="Path_2"
|
||||
Width="133.395"
|
||||
Height="44.4648"
|
||||
Canvas.Left="0"
|
||||
Canvas.Top="-0.0611877"
|
||||
Stretch="Fill"
|
||||
Fill="#FF000000"
|
||||
Data="F1 M 0,22.1715L 0,-0.0611877L 133.395,-0.0611877L 133.395,44.4036L 0,44.4036" />
|
||||
|
||||
<Canvas.Clip>
|
||||
<RectangleGeometry Rect="0 0 133.333 133.333"
|
||||
RadiusX="15"
|
||||
RadiusY="15" />
|
||||
</Canvas.Clip>
|
||||
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
|
||||
</UserControl>
|
||||
28
F4SD-AdaptableIcon/Flags/DE.xaml.cs
Normal file
28
F4SD-AdaptableIcon/Flags/DE.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace F4SD_AdaptableIcon.Flags
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for DE.xaml
|
||||
/// </summary>
|
||||
public partial class DE : UserControl
|
||||
{
|
||||
public DE()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
81
F4SD-AdaptableIcon/Flags/GB.xaml
Normal file
81
F4SD-AdaptableIcon/Flags/GB.xaml
Normal file
@@ -0,0 +1,81 @@
|
||||
<UserControl x:Class="F4SD_AdaptableIcon.Flags.GB"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:F4SD_AdaptableIcon.Flags"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="140"
|
||||
d:DesignWidth="140">
|
||||
|
||||
<!--Reference Document-Size in Expression Design: 100px x 100px and 72 DPI => Canvas Size 133.333x133.333 -->
|
||||
|
||||
<Viewbox ClipToBounds="True">
|
||||
|
||||
<Canvas x:Name="United_Kingdom"
|
||||
Width="133.333"
|
||||
Height="133.333"
|
||||
Canvas.Left="0"
|
||||
Canvas.Top="0">
|
||||
<Rectangle x:Name="Rectangle"
|
||||
Width="153.542"
|
||||
Height="136.16"
|
||||
Canvas.Left="-10.0868"
|
||||
Canvas.Top="-1.47615"
|
||||
Stretch="Fill"
|
||||
Fill="#FF012169" />
|
||||
<Path x:Name="Path"
|
||||
Width="160.409"
|
||||
Height="160.517"
|
||||
Canvas.Left="-13.5201"
|
||||
Canvas.Top="-13.6547"
|
||||
Stretch="Fill"
|
||||
Fill="#FFFFFFFF"
|
||||
Data="F1 M -6.65351,-13.6547L -13.5201,10.7024L 140.022,146.863L 146.889,122.506M 146.889,10.7024L 140.022,-13.6547L -13.5201,122.506L -6.65351,146.863L 146.889,10.7024 Z " />
|
||||
<Viewbox x:Name="Group"
|
||||
Width="158.12"
|
||||
Height="152.398"
|
||||
Canvas.Left="-12.3757"
|
||||
Canvas.Top="-9.59518">
|
||||
<Canvas Width="158.12"
|
||||
Height="152.398">
|
||||
<Canvas Width="133.333"
|
||||
Height="133.333"
|
||||
Clip="F1 M 79.0601,76.1991L 155.831,76.1991L 155.831,144.279M 79.0601,76.1991L 79.0601,144.279L 2.28887,144.279M 79.0601,76.1991L 2.28887,76.1991L 2.28887,8.11903M 79.0601,76.1991L 79.0601,8.11903L 155.831,8.11903L 79.0601,76.1991 Z ">
|
||||
<Path x:Name="Path_0"
|
||||
Width="158.12"
|
||||
Height="152.398"
|
||||
Canvas.Left="0"
|
||||
Canvas.Top="0"
|
||||
Stretch="Fill"
|
||||
Fill="#FFC8102E"
|
||||
Data="F1 M 4.57775,0L 0,16.2381L 153.542,152.398L 158.12,136.16M 158.12,16.2381L 153.542,0L 0,136.16L 4.57775,152.398L 158.12,16.2381 Z " />
|
||||
</Canvas>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
<Path x:Name="Path_1"
|
||||
Width="153.542"
|
||||
Height="136.16"
|
||||
Canvas.Left="-10.0868"
|
||||
Canvas.Top="-1.47615"
|
||||
Stretch="Fill"
|
||||
Fill="#FFFFFFFF"
|
||||
Data="F1 M 79.4796,-1.47615L 53.8892,-1.47615L 53.8892,134.684L 79.4796,134.684M -10.0868,43.9106L -10.0868,89.2973L 143.456,89.2973L 143.456,43.9106L -10.0868,43.9106 Z " />
|
||||
<Path x:Name="Path_2"
|
||||
Width="153.542"
|
||||
Height="136.16"
|
||||
Canvas.Left="-10.0868"
|
||||
Canvas.Top="-1.47615"
|
||||
Stretch="Fill"
|
||||
Fill="#FFC8102E"
|
||||
Data="F1 M 74.3615,-1.47615L 59.0072,-1.47615L 59.0072,134.684L 74.3615,134.684M -10.0868,52.9879L -10.0868,80.22L 143.456,80.22L 143.456,52.9879L -10.0868,52.9879 Z " />
|
||||
<Canvas.Clip>
|
||||
<RectangleGeometry Rect="0 0 133.333 133.333"
|
||||
RadiusX="15"
|
||||
RadiusY="15" />
|
||||
</Canvas.Clip>
|
||||
|
||||
</Canvas>
|
||||
|
||||
</Viewbox>
|
||||
</UserControl>
|
||||
28
F4SD-AdaptableIcon/Flags/GB.xaml.cs
Normal file
28
F4SD-AdaptableIcon/Flags/GB.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace F4SD_AdaptableIcon.Flags
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for GB.xaml
|
||||
/// </summary>
|
||||
public partial class GB : UserControl
|
||||
{
|
||||
public GB()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
37
F4SD-AdaptableIcon/IconData.cs
Normal file
37
F4SD-AdaptableIcon/IconData.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using F4SD_AdaptableIcon.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace F4SD_AdaptableIcon
|
||||
{
|
||||
public readonly struct IconData
|
||||
{
|
||||
public IconData(enumInternIcons intern)
|
||||
{
|
||||
Intern = intern;
|
||||
Gif = null;
|
||||
Material = null;
|
||||
}
|
||||
|
||||
public IconData(enumInternGif gif)
|
||||
{
|
||||
Intern = null;
|
||||
Gif = gif;
|
||||
Material = null;
|
||||
}
|
||||
|
||||
public IconData(MaterialIcons.MaterialIconType material)
|
||||
{
|
||||
Intern = null;
|
||||
Gif = null;
|
||||
Material = material;
|
||||
}
|
||||
|
||||
public enumInternIcons? Intern { get; }
|
||||
public enumInternGif? Gif { get; }
|
||||
public MaterialIcons.MaterialIconType? Material { get; }
|
||||
}
|
||||
}
|
||||
694
F4SD-AdaptableIcon/IconPainter.cs
Normal file
694
F4SD-AdaptableIcon/IconPainter.cs
Normal file
File diff suppressed because one or more lines are too long
11
F4SD-AdaptableIcon/Properties/AssemblyInfo.cs
Normal file
11
F4SD-AdaptableIcon/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("F4SD Cockpit Client")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("bab63a6a-1524-435d-9f96-7a30b6ee0624")]
|
||||
5
F4SD-AdaptableIcon/packages.config
Normal file
5
F4SD-AdaptableIcon/packages.config
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MaterialIcons" version="1.0.3" targetFramework="net472" />
|
||||
<package id="WpfAnimatedGif" version="2.0.2" targetFramework="net472" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user