inital
This commit is contained in:
10
.editorconfig
Normal file
10
.editorconfig
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[*.cs]
|
||||||
|
|
||||||
|
# IDE1006: Naming Styles
|
||||||
|
dotnet_diagnostic.IDE1006.severity = silent
|
||||||
|
|
||||||
|
# IDE0052: Remove unread private members
|
||||||
|
dotnet_diagnostic.IDE0052.severity = silent
|
||||||
|
|
||||||
|
# IDE0059: Unnecessary assignment of a value
|
||||||
|
dotnet_diagnostic.IDE0059.severity = silent
|
||||||
103
.gitignore
vendored
Normal file
103
.gitignore
vendored
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
# OS generated files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
Icon?
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
# Logs and temporary files
|
||||||
|
*.log
|
||||||
|
*.tmp
|
||||||
|
*.temp
|
||||||
|
*.cache
|
||||||
|
*.bak
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*.orig
|
||||||
|
~$*
|
||||||
|
|
||||||
|
# Package artifacts
|
||||||
|
node_modules/
|
||||||
|
packages/
|
||||||
|
*.nupkg
|
||||||
|
*.snupkg
|
||||||
|
*.tgz
|
||||||
|
*.tar
|
||||||
|
*.tar.gz
|
||||||
|
*.zip
|
||||||
|
*.7z
|
||||||
|
*.pkg
|
||||||
|
*.deb
|
||||||
|
*.rpm
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# TFS specific files and folders
|
||||||
|
$tf/
|
||||||
|
[Tt][Ff][Ss]*/
|
||||||
|
*.tfs
|
||||||
|
*.tfsconfig
|
||||||
|
|
||||||
|
# Visual Studio / .NET build outputs
|
||||||
|
.vs/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
[Tt]est[Rr]esults/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
[Dd]ebug*/
|
||||||
|
[Rr]elease*/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
bld/
|
||||||
|
ipch/
|
||||||
|
_ReSharper*/
|
||||||
|
*.opendb
|
||||||
|
*.pdb
|
||||||
|
*.obj
|
||||||
|
*.idb
|
||||||
|
*.ilk
|
||||||
|
|
||||||
|
# Visual Studio user-specific files
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.suo
|
||||||
|
*.vcxproj.user
|
||||||
|
*.rsuser
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# NuGet & MSBuild artifacts
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
.nuget/
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msixupload
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
|
||||||
|
# Coverage reports
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
coverage/
|
||||||
|
|
||||||
|
# Python helper scripts
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Misc tooling
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
.terraform/
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
|
||||||
6
F4SD-AdaptableIcon-Export/App.config
Normal file
6
F4SD-AdaptableIcon-Export/App.config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
14
F4SD-AdaptableIcon-Export/App.xaml
Normal file
14
F4SD-AdaptableIcon-Export/App.xaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<Application x:Class="F4SD_AdaptableIcon_Export.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:F4SD_AdaptableIcon_Export"
|
||||||
|
StartupUri="MainWindow.xaml">
|
||||||
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<!--Dark/LightMode-->
|
||||||
|
<ResourceDictionary Source="ResourcesLightMode.xaml"/>
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
17
F4SD-AdaptableIcon-Export/App.xaml.cs
Normal file
17
F4SD-AdaptableIcon-Export/App.xaml.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace F4SD_AdaptableIcon_Export
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for App.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
135
F4SD-AdaptableIcon-Export/F4SD-AdaptableIcon-Export.csproj
Normal file
135
F4SD-AdaptableIcon-Export/F4SD-AdaptableIcon-Export.csproj
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
<?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>{7B904A36-74D7-44A0-9659-6B1B091A44E0}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>F4SD_AdaptableIcon_Export</RootNamespace>
|
||||||
|
<AssemblyName>F4SD-AdaptableIcon-Export</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<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' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</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="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xaml">
|
||||||
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
<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>
|
||||||
|
<ApplicationDefinition Include="App.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</ApplicationDefinition>
|
||||||
|
<Compile Include="User Controls\IconGrid.xaml.cs">
|
||||||
|
<DependentUpon>IconGrid.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Page Include="MainWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Compile Include="App.xaml.cs">
|
||||||
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MainWindow.xaml.cs">
|
||||||
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Page Include="ResourcesLightMode.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="User Controls\IconGrid.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Models\AdvancedIconInformation.cs" />
|
||||||
|
<Compile Include="Models\IconCollectionUserControl.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\F4SD-AdaptableIcon\F4SD-AdaptableIcon.csproj">
|
||||||
|
<Project>{bab63a6a-1524-435d-9f96-7a30b6ee0624}</Project>
|
||||||
|
<Name>F4SD-AdaptableIcon</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\F4SD-Logging\F4SD-Logging.csproj">
|
||||||
|
<Project>{7793f281-b226-4e20-b6f6-5d53d70f1dc1}</Project>
|
||||||
|
<Name>F4SD-Logging</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
55
F4SD-AdaptableIcon-Export/MainWindow.xaml
Normal file
55
F4SD-AdaptableIcon-Export/MainWindow.xaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<Window x:Class="F4SD_AdaptableIcon_Export.MainWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:F4SD_AdaptableIcon_Export"
|
||||||
|
xmlns:mi="clr-namespace:MaterialIcons;assembly=MaterialIcons"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
xmlns:uc="clr-namespace:F4SD_AdaptableIcon_Export.User_Controls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="F4SD-AdaptableIcon-Export" Height="500" Width="600">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="120"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="50"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.Resources>
|
||||||
|
<Style TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color3D3C3C}"/>
|
||||||
|
<Setter Property="IconHeight" Value="50"/>
|
||||||
|
<Setter Property="IconWidth" Value="50"/>
|
||||||
|
<Setter Property="BorderPadding" Value="5"/>
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
</Grid.Resources>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="40"/>
|
||||||
|
<RowDefinition Height="40"/>
|
||||||
|
<RowDefinition Height="40"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="Select path for icon export:" Height="20" Margin="5,0,0,0"/>
|
||||||
|
<TextBox x:Name="folderPathTextBox" x:FieldModifier="private" Text="" Grid.Row="1" Grid.Column="0" Height="20" Margin="5,0,0,0" TextChanged="folderPathTextBox_TextChanged"/>
|
||||||
|
<Button x:Name="folderPathButton" Grid.Row="1" Grid.Column="1" Content="..." Height="20" Width="40" Click="folderPathButton_Click"/>
|
||||||
|
<Slider x:Name="pixSize" Grid.Row="2" Minimum="32" Maximum="256" VerticalAlignment="Center" Margin="10,0" Value="64" ValueChanged="pixSize_ValueChanged" />
|
||||||
|
<TextBlock x:Name="txtSize" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Text="64"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Row="1" x:Name="exampleIcon" SelectedInternIcon="f4sd" HorizontalAlignment="Center" VerticalAlignment="Center" IconWidth="64" IconHeight="64" Margin="0" Padding="0"/>
|
||||||
|
|
||||||
|
<Grid Grid.Row="2">
|
||||||
|
<Button x:Name="exportButton" Height="30" Width="100" Content="Export" Click="exportButton_Click" IsEnabled="False"/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
171
F4SD-AdaptableIcon-Export/MainWindow.xaml.cs
Normal file
171
F4SD-AdaptableIcon-Export/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
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;
|
||||||
|
using MaterialIcons;
|
||||||
|
using F4SD_AdaptableIcon.Enums;
|
||||||
|
using C4IT.Logging;
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace F4SD_AdaptableIcon_Export
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for MainWindow.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class MainWindow : Window
|
||||||
|
{
|
||||||
|
|
||||||
|
private List<cAdvancedIconInformation> iconInformation = new List<cAdvancedIconInformation>();
|
||||||
|
public MainWindow() => InitializeComponent();
|
||||||
|
|
||||||
|
protected override void OnInitialized(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnInitialized(e);
|
||||||
|
InstantiateIconInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InstantiateIconInformation()
|
||||||
|
{
|
||||||
|
|
||||||
|
List<cAdvancedIconInformation> IconInformation = new List<cAdvancedIconInformation>();
|
||||||
|
|
||||||
|
foreach (enumInternIcons internIcon in Enum.GetValues(typeof(enumInternIcons)))
|
||||||
|
{
|
||||||
|
cAdvancedIconInformation tempIconInformation = new cAdvancedIconInformation() { IsVisible = true };
|
||||||
|
tempIconInformation.UpdateIconInformation(internIcon);
|
||||||
|
IconInformation.Add(tempIconInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (MaterialIconType materialIcon in Enum.GetValues(typeof(MaterialIconType)))
|
||||||
|
{
|
||||||
|
cAdvancedIconInformation tempIconInformation = new cAdvancedIconInformation() { IsVisible = true };
|
||||||
|
tempIconInformation.UpdateIconInformation(materialIcon);
|
||||||
|
IconInformation.Add(tempIconInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
iconInformation = IconInformation;
|
||||||
|
//IconListUC.IconInformation = IconInformation;
|
||||||
|
//IconGridUC.IconInformation = IconInformation;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void folderPathButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var openFileDlg = new System.Windows.Forms.OpenFileDialog();
|
||||||
|
openFileDlg.FileName = folderPathTextBox.Text;
|
||||||
|
openFileDlg.ValidateNames = false;
|
||||||
|
openFileDlg.CheckFileExists = false;
|
||||||
|
openFileDlg.CheckPathExists = true;
|
||||||
|
openFileDlg.FileName = "select a folder.";
|
||||||
|
var result = openFileDlg.ShowDialog();
|
||||||
|
if (result is System.Windows.Forms.DialogResult.OK)
|
||||||
|
{
|
||||||
|
var _path = openFileDlg.FileName;
|
||||||
|
_path = System.IO.Path.GetDirectoryName(_path);
|
||||||
|
if (System.IO.Directory.Exists(_path))
|
||||||
|
folderPathTextBox.Text = _path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void WriteToPng(UIElement element, string filename)
|
||||||
|
{
|
||||||
|
var rect = new Rect(element.RenderSize);
|
||||||
|
var visual = new DrawingVisual();
|
||||||
|
|
||||||
|
using (var dc = visual.RenderOpen())
|
||||||
|
{
|
||||||
|
dc.DrawRectangle(new VisualBrush(element), null, rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
var bitmap = new RenderTargetBitmap(
|
||||||
|
(int)rect.Width, (int)rect.Height, 96, 96, PixelFormats.Default);
|
||||||
|
bitmap.Render(visual);
|
||||||
|
|
||||||
|
var encoder = new PngBitmapEncoder();
|
||||||
|
encoder.Frames.Add(BitmapFrame.Create(bitmap));
|
||||||
|
|
||||||
|
string directoryPath = System.IO.Path.GetDirectoryName(filename);
|
||||||
|
Directory.CreateDirectory(directoryPath);
|
||||||
|
|
||||||
|
using (var file = File.OpenWrite(filename))
|
||||||
|
{
|
||||||
|
encoder.Save(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void exportButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (cAdvancedIconInformation icon in iconInformation)
|
||||||
|
{
|
||||||
|
exampleIcon.Visibility = Visibility.Collapsed;
|
||||||
|
string strFolder = "";
|
||||||
|
if (icon.InternIcon != null)
|
||||||
|
{
|
||||||
|
exampleIcon.SelectedMaterialIcon = null;
|
||||||
|
exampleIcon.SelectedInternIcon = icon.InternIcon;
|
||||||
|
strFolder = @folderPathTextBox.Text + "\\" + txtSize.Text + "x" + txtSize.Text + "\\intern\\" + exampleIcon.SelectedInternIcon.ToString() + ".png";
|
||||||
|
}
|
||||||
|
else if (icon.MaterialIcon != null)
|
||||||
|
{
|
||||||
|
exampleIcon.SelectedInternIcon = null;
|
||||||
|
exampleIcon.SelectedMaterialIcon = icon.MaterialIcon;
|
||||||
|
strFolder = @folderPathTextBox.Text + "\\" + txtSize.Text + "x" + txtSize.Text + "\\material\\" + exampleIcon.SelectedMaterialIcon.ToString() + ".png";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
|
||||||
|
exampleIcon.Visibility = Visibility.Visible;
|
||||||
|
await Task.Delay(100);
|
||||||
|
|
||||||
|
WriteToPng(this.exampleIcon, strFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pixSize_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||||
|
{
|
||||||
|
var size = (int)e.NewValue;
|
||||||
|
if (txtSize != null)
|
||||||
|
txtSize.Text = size.ToString();
|
||||||
|
|
||||||
|
if (exampleIcon != null)
|
||||||
|
{
|
||||||
|
exampleIcon.IconWidth = size;
|
||||||
|
exampleIcon.IconHeight = size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void folderPathTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (folderPathTextBox.Text != String.Empty)
|
||||||
|
{
|
||||||
|
exportButton.IsEnabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
exportButton.IsEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
F4SD-AdaptableIcon-Export/Models/AdvancedIconInformation.cs
Normal file
31
F4SD-AdaptableIcon-Export/Models/AdvancedIconInformation.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static FasdDesktopUi.Basics.UserControls.AdaptableIcon.cIconPainter;
|
||||||
|
|
||||||
|
namespace F4SD_AdaptableIcon_Export
|
||||||
|
{
|
||||||
|
public class cAdvancedIconInformation : cIconInformation, INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
private bool isVisible;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsVisible
|
||||||
|
{
|
||||||
|
get { return isVisible; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isVisible = value;
|
||||||
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsVisible)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static FasdDesktopUi.Basics.UserControls.AdaptableIcon.cIconPainter;
|
||||||
|
|
||||||
|
namespace F4SD_AdaptableIcon_Export.Models
|
||||||
|
{
|
||||||
|
public class cAdvancedIconInformation : cIconInformation, INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
private bool isVisible;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsVisible
|
||||||
|
{
|
||||||
|
get { return isVisible; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isVisible = value;
|
||||||
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsVisible)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
52
F4SD-AdaptableIcon-Export/Properties/AssemblyInfo.cs
Normal file
52
F4SD-AdaptableIcon-Export/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Resources;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
// 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("F4SD-AdaptableIcon-Export")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("F4SD-AdaptableIcon-Export")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||||
|
[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)]
|
||||||
|
|
||||||
|
//In order to begin building localizable applications, set
|
||||||
|
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||||
|
//inside a <PropertyGroup>. For example, if you are using US english
|
||||||
|
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||||
|
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||||
|
//the line below to match the UICulture setting in the project file.
|
||||||
|
|
||||||
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
|
|
||||||
|
[assembly: ThemeInfo(
|
||||||
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// or application resource dictionaries)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// app, or any theme specific resource dictionaries)
|
||||||
|
)]
|
||||||
|
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
71
F4SD-AdaptableIcon-Export/Properties/Resources.Designer.cs
generated
Normal file
71
F4SD-AdaptableIcon-Export/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 F4SD_AdaptableIcon_Export.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <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", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <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 ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("F4SD_AdaptableIcon_Export.Properties.Resources", typeof(Resources).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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
F4SD-AdaptableIcon-Export/Properties/Resources.resx
Normal file
117
F4SD-AdaptableIcon-Export/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?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.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: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" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</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" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
30
F4SD-AdaptableIcon-Export/Properties/Settings.Designer.cs
generated
Normal file
30
F4SD-AdaptableIcon-Export/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 F4SD_AdaptableIcon_Export.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
F4SD-AdaptableIcon-Export/Properties/Settings.settings
Normal file
7
F4SD-AdaptableIcon-Export/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
52
F4SD-AdaptableIcon-Export/ResourcesLightMode.xaml
Normal file
52
F4SD-AdaptableIcon-Export/ResourcesLightMode.xaml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon">
|
||||||
|
|
||||||
|
<SolidColorBrush x:Key="colorE9E9E9" Color="#E9E9E9"/>
|
||||||
|
<SolidColorBrush x:Key="colorF7FAFA" Color="#F7FAFA"/>
|
||||||
|
<SolidColorBrush x:Key="color3D3C3C" Color="#3D3C3C"/>
|
||||||
|
<SolidColorBrush x:Key="color1F92EE" Color="#1F92EE"/>
|
||||||
|
<SolidColorBrush x:Key="colorF2F2F2" Color="#F2F2F2"/>
|
||||||
|
<SolidColorBrush x:Key="color9A9B9B" Color="#9A9B9B"/>
|
||||||
|
|
||||||
|
|
||||||
|
<Color x:Key="ControlLightColor">#DBDBDB</Color>
|
||||||
|
<Color x:Key="ControlMediumColor">#DBDBDB</Color>
|
||||||
|
<Color x:Key="ControlDarkColor">#DBDBDB</Color>
|
||||||
|
<SolidColorBrush x:Key="Scrollbar.Track.Color">#F2F2F2</SolidColorBrush>
|
||||||
|
|
||||||
|
<Style TargetType="ico:AdaptableIcon" x:Key="GridIconStyle">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="#3D3C3C"/>
|
||||||
|
<Setter Property="SecondaryIconColor" Value="#F7FAFA"/>
|
||||||
|
<Setter Property="IconHeight" Value="55"/>
|
||||||
|
<Setter Property="IconWidth" Value="55" />
|
||||||
|
<Setter Property="BorderPadding" Value="7.5" />
|
||||||
|
<Setter Property="IconBackgroundColor" Value="#F7FAFA"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
<Setter Property="IconCornerRadius" Value="7.5"/>
|
||||||
|
<Setter Property="Margin" Value="5, 2.5, 0, 2.5" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="Border" x:Key="ListBorderIconStyle">
|
||||||
|
|
||||||
|
<Setter Property="Background" Value="#F7FAFA" />
|
||||||
|
<Setter Property="CornerRadius" Value="5"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="Margin" Value="10,3,10,0"/>
|
||||||
|
<Setter Property="Height" Value="30"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
|
||||||
|
|
||||||
|
<Style.Resources>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="#3D3C3C"/>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="#3D3C3C"/>
|
||||||
|
<Setter Property="SecondaryIconColor" Value="#F7FAFA"/>
|
||||||
|
</Style>
|
||||||
|
</Style.Resources>
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
35
F4SD-AdaptableIcon-Export/User Controls/IconGrid.xaml
Normal file
35
F4SD-AdaptableIcon-Export/User Controls/IconGrid.xaml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<UserControl x:Class="F4SD_AdaptableIcon_Export.User_Controls.IconGrid"
|
||||||
|
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:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
xmlns:local="clr-namespace:F4SD_AdaptableIcon_Export.User_Controls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
|
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||||
|
|
||||||
|
<UserControl.Resources>
|
||||||
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibility"/>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
<StackPanel x:Name="GridCollection">
|
||||||
|
|
||||||
|
<ItemsControl ItemsSource="{Binding IconInformation}">
|
||||||
|
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel/>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="adaptableIcon" ToolTip="{Binding IconName}" Tag="{Binding IconName}" SelectedInternIcon="{Binding InternIcon}" SelectedMaterialIcon="{Binding MaterialIcon}" Visibility="{Binding IsVisible, Converter = {StaticResource BooleanToVisibility}}" Style="{DynamicResource GridIconStyle}"/>
|
||||||
|
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</UserControl>
|
||||||
48
F4SD-AdaptableIcon-Export/User Controls/IconGrid.xaml.cs
Normal file
48
F4SD-AdaptableIcon-Export/User Controls/IconGrid.xaml.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using F4SD_AdaptableIcon.Enums;
|
||||||
|
using F4SD_AdaptableIcon_Export.Models;
|
||||||
|
using MaterialIcons;
|
||||||
|
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_Export.User_Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for IconGrid.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class IconGrid : UserControl
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<cAdvancedIconInformation> IconInformation
|
||||||
|
{
|
||||||
|
get { return (List<cAdvancedIconInformation>)GetValue(IconInformationProperty); }
|
||||||
|
set { SetValue(IconInformationProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a DependencyProperty as the backing store for IconInformation. This enables animation, styling, binding, etc...
|
||||||
|
public static readonly DependencyProperty IconInformationProperty =
|
||||||
|
DependencyProperty.Register("IconInformation", typeof(List<cAdvancedIconInformation>), typeof(IconGrid), new PropertyMetadata(null));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public IconGrid()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
5
F4SD-AdaptableIcon-Export/packages.config
Normal file
5
F4SD-AdaptableIcon-Export/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>
|
||||||
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>
|
||||||
92
F4SD-Cockpit-Client-Intro/F4SD-Cockpit-Client-Intro.csproj
Normal file
92
F4SD-Cockpit-Client-Intro/F4SD-Cockpit-Client-Intro.csproj
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<?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>{3320C211-B5F5-4466-B9B5-C860F76B9459}</ProjectGuid>
|
||||||
|
<OutputType>library</OutputType>
|
||||||
|
<RootNamespace>F4SD_Cockpit_Client_Intro</RootNamespace>
|
||||||
|
<AssemblyName>F4SD-Cockpit-Client-Intro</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<Deterministic>true</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>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xaml">
|
||||||
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="IntroWindow.xaml.cs">
|
||||||
|
<DependentUpon>IntroWindow.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Include="IntroWindow.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Resources\F4SD Intro.mov">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
21
F4SD-Cockpit-Client-Intro/IntroWindow.xaml
Normal file
21
F4SD-Cockpit-Client-Intro/IntroWindow.xaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<Window x:Class="F4SD_Cockpit_Client_Intro.IntroWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:F4SD_Cockpit_Client_Intro"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="First Aid Service Desk"
|
||||||
|
d:Height="450"
|
||||||
|
d:Width="800"
|
||||||
|
WindowState="Maximized"
|
||||||
|
WindowStyle="None"
|
||||||
|
Background="#426199"
|
||||||
|
PreviewKeyDown="Window_PreviewKeyDown">
|
||||||
|
<Grid>
|
||||||
|
<MediaElement x:Name="videoPlayer"
|
||||||
|
Stretch="Fill"
|
||||||
|
Source="Resources/F4SD Intro.mov"
|
||||||
|
MediaEnded="videoPlayer_MediaEnded" />
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
38
F4SD-Cockpit-Client-Intro/IntroWindow.xaml.cs
Normal file
38
F4SD-Cockpit-Client-Intro/IntroWindow.xaml.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
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.Shapes;
|
||||||
|
|
||||||
|
namespace F4SD_Cockpit_Client_Intro
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for IntroWindow.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class IntroWindow : Window
|
||||||
|
{
|
||||||
|
public IntroWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void videoPlayer_MediaEnded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Escape)
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
F4SD-Cockpit-Client-Intro/Properties/AssemblyInfo.cs
Normal file
10
F4SD-Cockpit-Client-Intro/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("F4SD Cockpit Intro")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
[assembly: Guid("7E14E8E7-54F4-44F3-B7DE-F3370178D7B0")]
|
||||||
62
F4SD-Cockpit-Client-Intro/Properties/Resources.Designer.cs
generated
Normal file
62
F4SD-Cockpit-Client-Intro/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 F4SD_Cockpit_Client_Intro.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
/// <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", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <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 ((resourceMan == null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("F4SD_Cockpit_Client_Intro.Properties.Resources", typeof(Resources).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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
F4SD-Cockpit-Client-Intro/Properties/Resources.resx
Normal file
117
F4SD-Cockpit-Client-Intro/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?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.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: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" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</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" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
30
F4SD-Cockpit-Client-Intro/Properties/Settings.Designer.cs
generated
Normal file
30
F4SD-Cockpit-Client-Intro/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 F4SD_Cockpit_Client_Intro.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
F4SD-Cockpit-Client-Intro/Properties/Settings.settings
Normal file
7
F4SD-Cockpit-Client-Intro/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
BIN
F4SD-Cockpit-Client-Intro/Resources/F4SD Intro.mov
Normal file
BIN
F4SD-Cockpit-Client-Intro/Resources/F4SD Intro.mov
Normal file
Binary file not shown.
78
F4SD-Logging/F4SD-Logging.csproj
Normal file
78
F4SD-Logging/F4SD-Logging.csproj
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<?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>{7793F281-B226-4E20-B6F6-5D53D70F1DC1}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>F4SD_Logging</RootNamespace>
|
||||||
|
<AssemblyName>F4SD-Logging</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="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<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" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\..\Common Code\Logging\C4IT.Logging.LogManager.cs">
|
||||||
|
<Link>Common\C4IT.Logging.LogManager.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\CommonAssemblyAttributes.cs">
|
||||||
|
<Link>Common\CommonAssemblyAttributes.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
||||||
|
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
10
F4SD-Logging/F4SD-Logging.csproj.vspscc
Normal file
10
F4SD-Logging/F4SD-Logging.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"
|
||||||
|
}
|
||||||
11
F4SD-Logging/Properties/AssemblyInfo.cs
Normal file
11
F4SD-Logging/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("F4SD Logging")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
[assembly: Guid("7793f281-b226-4e20-b6f6-5d53d70f1dc1")]
|
||||||
6
F4SD-PhoneMonitor/App.config
Normal file
6
F4SD-PhoneMonitor/App.config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
259
F4SD-PhoneMonitor/CLMgrEvents.cs
Normal file
259
F4SD-PhoneMonitor/CLMgrEvents.cs
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using IpPbx.CLMgrLib;
|
||||||
|
|
||||||
|
using C4IT.Logging;
|
||||||
|
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
using System.Runtime.Remoting.Channels;
|
||||||
|
|
||||||
|
namespace F4SD_PhoneMonitor
|
||||||
|
{
|
||||||
|
public delegate void ActiveCallMessage(string phone, string name, bool isOutgoing);
|
||||||
|
|
||||||
|
public class cCLMgrEvents
|
||||||
|
{
|
||||||
|
public ActiveCallMessage ActiveCallHandler;
|
||||||
|
|
||||||
|
private ClientLineMgrClass pCLMgr = null;
|
||||||
|
private ClientSdkEventSink MyEventSink = null;
|
||||||
|
|
||||||
|
private PubCLMgrLineDetails lastChangedLineDetails;
|
||||||
|
|
||||||
|
public bool Initialize()
|
||||||
|
{
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
lastChangedLineDetails.m_sPeerName = null;
|
||||||
|
lastChangedLineDetails.m_sPeerNumber = null;
|
||||||
|
|
||||||
|
pCLMgr = new ClientLineMgrClass();
|
||||||
|
if (pCLMgr == null)
|
||||||
|
{
|
||||||
|
LogEntry("Error conntection SwyxIt client interface. Terminating...", LogLevels.Fatal);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
pCLMgr.GetVersion(out var Info);
|
||||||
|
if (Info.dwMajorVersion < 11)
|
||||||
|
{
|
||||||
|
LogEntry("Incompatible SwyxIt client version. Terminating...", LogLevels.Fatal);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
MyEventSink = new ClientSdkEventSink();
|
||||||
|
MyEventSink.Connect(pCLMgr, new LineManagerMessageHandler(OnLineManagerMessage));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnLineManagerMessage(ClientSdkEventArgs e)
|
||||||
|
{
|
||||||
|
var _msg = e.Msg.ToString();
|
||||||
|
if (int.TryParse(_msg, out _))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LogEntry($"Client event signaled {e.Msg.ToString()}", LogLevels.Debug);
|
||||||
|
|
||||||
|
switch (e.Msg)
|
||||||
|
{
|
||||||
|
case CLMgrMessage.CLMgrLineStateChangedMessage:
|
||||||
|
IClientLinePub changedLinePub = (IClientLinePub)pCLMgr.DispGetLine(e.Param);
|
||||||
|
PubCLMgrLineDetails changedLineDetails;
|
||||||
|
changedLinePub.PubGetDetails(out changedLineDetails);
|
||||||
|
lastChangedLineDetails = changedLineDetails;
|
||||||
|
break;
|
||||||
|
case CLMgrMessage.CLMgrLineStateChangedMessageEx:
|
||||||
|
//Get Line
|
||||||
|
int line = e.Param & 0xff;
|
||||||
|
int high = e.Param >> 8;
|
||||||
|
|
||||||
|
LineState NewLineState;
|
||||||
|
//Get the LineState
|
||||||
|
NewLineState = (LineState)high;
|
||||||
|
LogEntry($"New line state: {NewLineState}", LogLevels.Debug);
|
||||||
|
if (NewLineState == LineState.Active)
|
||||||
|
{
|
||||||
|
if (lastChangedLineDetails.m_sPeerNumber != null)
|
||||||
|
{
|
||||||
|
var IsOutgoing = lastChangedLineDetails.m_bIsOutgoing == 1;
|
||||||
|
var _strDir = IsOutgoing ? "to" : "from";
|
||||||
|
LogEntry($"Active call {_strDir}: phone={lastChangedLineDetails.m_sPeerNumber}, name={lastChangedLineDetails.m_sPeerName}", LogLevels.Debug);
|
||||||
|
if (ActiveCallHandler != null)
|
||||||
|
ActiveCallHandler.Invoke(lastChangedLineDetails.m_sPeerNumber, lastChangedLineDetails.m_sPeerName, IsOutgoing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Disconnect()
|
||||||
|
{
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (MyEventSink != null)
|
||||||
|
MyEventSink.Disconnect();
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ClientSdkEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public CLMgrMessage Msg;
|
||||||
|
public int Param;
|
||||||
|
|
||||||
|
public ClientSdkEventArgs(CLMgrMessage msg, int param)
|
||||||
|
{
|
||||||
|
Msg = msg;
|
||||||
|
Param = param;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public delegate void LineManagerMessageHandler(ClientSdkEventArgs e);
|
||||||
|
|
||||||
|
public class ClientSdkEventSink
|
||||||
|
{
|
||||||
|
private ClientLineMgrClass ConnectedLineManager;
|
||||||
|
private IClientLineMgrEventsPub_PubOnLineMgrNotificationEventHandler EventHandler;
|
||||||
|
private LineManagerMessageHandler LineManagerMessageDelegateOfForm;
|
||||||
|
|
||||||
|
public ClientSdkEventSink()
|
||||||
|
{
|
||||||
|
EventHandler = new IClientLineMgrEventsPub_PubOnLineMgrNotificationEventHandler(clmgr_EventSink);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Connect(ClientLineMgrClass lineManager, LineManagerMessageHandler lineManagerMessageDelegateOfForm)
|
||||||
|
{
|
||||||
|
ConnectedLineManager = lineManager;
|
||||||
|
LineManagerMessageDelegateOfForm = lineManagerMessageDelegateOfForm;
|
||||||
|
|
||||||
|
//add eventhandler for the PubOnlineMgrNotification Events
|
||||||
|
ConnectedLineManager.PubOnLineMgrNotification += EventHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Disconnect()
|
||||||
|
{
|
||||||
|
//remove eventhandler for the PubOnlineMgrNotification Events
|
||||||
|
ConnectedLineManager.PubOnLineMgrNotification -= EventHandler;
|
||||||
|
ConnectedLineManager = null;
|
||||||
|
LineManagerMessageDelegateOfForm = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clmgr_EventSink(int msg, int param)
|
||||||
|
{
|
||||||
|
//this method receives the COM events from the client line manger
|
||||||
|
if ((LineManagerMessageDelegateOfForm != null))
|
||||||
|
{
|
||||||
|
LineManagerMessageDelegateOfForm?.Invoke(new ClientSdkEventArgs((CLMgrMessage)msg, param));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum CLMgrMessage
|
||||||
|
{
|
||||||
|
CLMgrLineStateChangedMessage = 0, //state of at least one line has changed
|
||||||
|
CLMgrLineSelectionChangedMessage = 1, //line in focus has changed
|
||||||
|
CLMgrLineDetailsChangedMessage = 2, //details of at least one line have changed
|
||||||
|
CLMgrCallDetailsMessage = 4, //details of last call are available, post mortem for logging purpose
|
||||||
|
CLMgrServerDownMessage = 5, //server goes down, keep line manager, wait for ServerUp message
|
||||||
|
CLMgrServerUpMessage = 6, //server is up again, keep interfaces to line manger
|
||||||
|
CLMgrWaveDeviceChanged = 7, //speaker / micro has been switched on / off
|
||||||
|
CLMgrGroupCallNotificationMessage = 8, //notification about group call
|
||||||
|
CLMgrNumberOfLinesChangedMessage = 10, //the number of lines has changed
|
||||||
|
CLMgrClientShutDownRequest = 11, //Client Line Manager requests client to shutdown and release all interfaces
|
||||||
|
CLMgrLineStateChangedMessageEx = 28, //state of certain line has changed, lParam: LOWORD: line index of line that changed its state (starting with 0) HIWORD: new state of this line
|
||||||
|
CLMgrSIPRegistrationStateChanged = 30, //registration state of SIP account has changed
|
||||||
|
//lParam: LOBYTE: Account index
|
||||||
|
// HIBYTE: new state
|
||||||
|
CLMgrWaveFilePlayed = 31, //wave file playback finished
|
||||||
|
//lParam: line index;
|
||||||
|
//if -1, the message is related to a LineMgr function PlaySoundFile or PlayToRtp
|
||||||
|
//if >=0 the message is related to a line function PlaySoundFile of line with this index
|
||||||
|
PubCLMgrFirstDataReceived = 32 //first RTP data received on line, might be silence
|
||||||
|
//lParam: line index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum LineState
|
||||||
|
{
|
||||||
|
Inactive = 0, //line is inactive
|
||||||
|
HookOffInternal = 1, //off hook, internal dialtone
|
||||||
|
HookOffExternal = 2, //off hook, external dialtone
|
||||||
|
Ringing = 3, //incoming call, ringing
|
||||||
|
Dialing = 4, //outgoing call, we are dialing, no sound
|
||||||
|
Alerting = 5, //outgoing call, alerting = ringing on destination
|
||||||
|
Knocking = 6, //outgoing call, knocking = second call ringing on destination
|
||||||
|
Busy = 7, //outgoing call, destination is busy
|
||||||
|
Active = 8, //incoming / outgoing call, logical and physical connection is established
|
||||||
|
OnHold = 9, //incoming / outgoing call, logical connection is established, destination gets music on hold
|
||||||
|
ConferenceActive = 10, //incoming / outgoing conference, logical and physical connection is established
|
||||||
|
ConferenceOnHold = 11, //incoming / outgoing conference, logical connection is established, not physcically connected
|
||||||
|
Terminated = 12, //incoming / outgoing connection / call has been disconnected
|
||||||
|
Transferring = 13, //special LSOnHold, call is awaiting to be transferred, peer gets special music on hold
|
||||||
|
Disabled = 14 //special LSInactive: wrap up time
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum DisconnectReason
|
||||||
|
{
|
||||||
|
Normal = 0,
|
||||||
|
Busy = 1,
|
||||||
|
Rejected = 2,
|
||||||
|
Cancelled = 3,
|
||||||
|
Transferred = 4,
|
||||||
|
JoinedConference = 5,
|
||||||
|
NoAnswer = 6,
|
||||||
|
TooLate = 7,
|
||||||
|
DirectCallImpossible = 8,
|
||||||
|
WrongNumber = 9,
|
||||||
|
Unreachable = 10,
|
||||||
|
CallDiverted = 11,
|
||||||
|
CallRoutingFailed = 12,
|
||||||
|
PermissionDenied = 13,
|
||||||
|
NetworkCongestion = 14,
|
||||||
|
NoChannelAvailable = 15,
|
||||||
|
NumberChanged = 16,
|
||||||
|
IncompatibleDestination = 17
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
145
F4SD-PhoneMonitor/F4SD-PhoneMonitor.csproj
Normal file
145
F4SD-PhoneMonitor/F4SD-PhoneMonitor.csproj
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
<?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>{5721E81F-3C41-4C63-8EA0-EE8D1CE73778}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>F4SD_PhoneMonitor</RootNamespace>
|
||||||
|
<AssemblyName>F4SD-PhoneMonitor</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>false</Deterministic>
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
<ResolveComReferenceSilent>True</ResolveComReferenceSilent>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<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' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>logo_FASD.ico</ApplicationIcon>
|
||||||
|
</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>x86</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</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>x86</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Interop.CLMgr, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cf78dfa0a74454f8, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
|
<HintPath>.\Interop.CLMgr.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\..\C4IT FASD\_Common\C4IT.F4SD.TapiHelper.cs">
|
||||||
|
<Link>C4IT.F4SD.TapiHelper.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\FasdDesktopUi\Basics\NamedPipes.cs">
|
||||||
|
<Link>Common\NamedPipes.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
||||||
|
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="CLMgrEvents.cs" />
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Interop.CLMgr.dll">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="logo_FASD.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\F4SD-Logging\F4SD-Logging.csproj">
|
||||||
|
<Project>{7793f281-b226-4e20-b6f6-5d53d70f1dc1}</Project>
|
||||||
|
<Name>F4SD-Logging</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<COMReference Include="TAPI3Lib">
|
||||||
|
<Guid>{21D6D480-A88B-11D0-83DD-00AA003CCABD}</Guid>
|
||||||
|
<VersionMajor>1</VersionMajor>
|
||||||
|
<VersionMinor>0</VersionMinor>
|
||||||
|
<Lcid>0</Lcid>
|
||||||
|
<WrapperTool>tlbimp</WrapperTool>
|
||||||
|
<Isolated>False</Isolated>
|
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
|
</COMReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
10
F4SD-PhoneMonitor/F4SD-PhoneMonitor.csproj.vspscc
Normal file
10
F4SD-PhoneMonitor/F4SD-PhoneMonitor.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"
|
||||||
|
}
|
||||||
BIN
F4SD-PhoneMonitor/Interop.CLMgr.dll
Normal file
BIN
F4SD-PhoneMonitor/Interop.CLMgr.dll
Normal file
Binary file not shown.
414
F4SD-PhoneMonitor/Program.cs
Normal file
414
F4SD-PhoneMonitor/Program.cs
Normal file
@@ -0,0 +1,414 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.IO.Pipes;
|
||||||
|
using System.Text;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
using C4IT.Logging;
|
||||||
|
using C4IT.F4SD.TAPI;
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
|
using FasdDesktopUi.Basics;
|
||||||
|
|
||||||
|
namespace F4SD_PhoneMonitor
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
public static string sendPipeName = null;
|
||||||
|
public static string listenPipeName = null;
|
||||||
|
public static string tapiLine = null;
|
||||||
|
public static bool SignalOutgoingCall = false;
|
||||||
|
public static string ExternalCallPrefix = "";
|
||||||
|
public static bool IsSimulation = false;
|
||||||
|
|
||||||
|
public static int SendError = 0;
|
||||||
|
|
||||||
|
public static cCLMgrEvents lmg = null;
|
||||||
|
|
||||||
|
public static System.Timers.Timer timerPolling = new System.Timers.Timer(100);
|
||||||
|
|
||||||
|
public static cF4sdPipeServer pipeServer = null;
|
||||||
|
|
||||||
|
public static bool StopImmediate = false;
|
||||||
|
|
||||||
|
[STAThread]
|
||||||
|
static int Main(string[] args)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cLogManagerFile.CreateInstance(false, SubFolder: "Logs");
|
||||||
|
cLogManager.DefaultLogger.LogAssemblyInfo();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (args.Length < 3 || args.Length > 6)
|
||||||
|
{
|
||||||
|
LogEntry("No valid pipe names at command line. Terminating...", LogLevels.Fatal);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendPipeName = args[0];
|
||||||
|
listenPipeName = args[1];
|
||||||
|
tapiLine = args[2];
|
||||||
|
|
||||||
|
if (args.Length >= 4)
|
||||||
|
ExternalCallPrefix = args[3];
|
||||||
|
|
||||||
|
if (args.Length >= 5)
|
||||||
|
{
|
||||||
|
if (args[4] == "1")
|
||||||
|
SignalOutgoingCall = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.Length >= 6)
|
||||||
|
{
|
||||||
|
if (args[5] == "simulation")
|
||||||
|
IsSimulation = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tapiLine.ToLowerInvariant() == "swyxitnative")
|
||||||
|
{
|
||||||
|
if (!ConnectSwyxit())
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!ConnectTapi(tapiLine))
|
||||||
|
{
|
||||||
|
System.Environment.Exit(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
timerPolling.Elapsed += TimerPolling_Elapsed;
|
||||||
|
timerPolling.Start();
|
||||||
|
|
||||||
|
var SessionId = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SessionId = Process.GetCurrentProcess().SessionId;
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
pipeServer = new cF4sdPipeServer();
|
||||||
|
pipeServer.PipeMessage += PipeServer_PipeMessage;
|
||||||
|
pipeServer.Listen(listenPipeName, MaxSize: 255, LowerIntegrity: true);
|
||||||
|
LogEntry($"Start listening on named pipe '{listenPipeName}'...", LogLevels.Debug);
|
||||||
|
|
||||||
|
|
||||||
|
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||||
|
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.ApplicationExit += OnApplicationExit;
|
||||||
|
Application.Run();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool ConnectSwyxit()
|
||||||
|
{
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var regObj = Registry.GetValue("HKEY_CLASSES_ROOT\\CLSID\\{F8E552F8-4C00-11D3-80BC-00105A653379}\\VersionIndependentProgID", null, null);
|
||||||
|
if (!(regObj is string strObj) || strObj.ToLowerInvariant() != "clmgr.clientlinemgr")
|
||||||
|
{
|
||||||
|
LogEntry("SwyxIt client seems not to be installed. Terminating...", LogLevels.Fatal);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
lmg = new cCLMgrEvents();
|
||||||
|
if (!lmg.Initialize())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
lmg.ActiveCallHandler += ActiveCallMessage;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool ConnectTapi(string Line)
|
||||||
|
{
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
C4TapiHelper.Instance = new C4TapiHelper();
|
||||||
|
C4TapiHelper.Instance.Initialize(TapiMessageHandler);
|
||||||
|
C4TapiHelper.Instance.GetLines();
|
||||||
|
if (C4TapiHelper.Instance.ConnectLine(Line))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
|
||||||
|
{
|
||||||
|
LogEntry("User logout detected. Terminating...", LogLevels.Debug);
|
||||||
|
Application.Exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void TimerPolling_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
timerPolling.Stop();
|
||||||
|
if (StopImmediate)
|
||||||
|
{
|
||||||
|
Application.Exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
timerPolling.Interval = 10000;
|
||||||
|
bool res = false;
|
||||||
|
lock (sendPipeName)
|
||||||
|
{
|
||||||
|
res = Send("Hello", sendPipeName);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (res)
|
||||||
|
SendError = 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendError++;
|
||||||
|
if (SendError == 2)
|
||||||
|
Application.Exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
timerPolling.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
static private void OnApplicationExit(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
timerPolling.Stop();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (lmg != null)
|
||||||
|
{
|
||||||
|
lmg.ActiveCallHandler -= ActiveCallMessage;
|
||||||
|
lmg.Disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (C4TapiHelper.Instance != null)
|
||||||
|
{
|
||||||
|
C4TapiHelper.Instance.Dispose();
|
||||||
|
C4TapiHelper.Instance = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
if (pipeServer != null)
|
||||||
|
{
|
||||||
|
LogEntry("stopping pipe server...", LogLevels.Debug);
|
||||||
|
pipeServer.Stop();
|
||||||
|
pipeServer.Dispose();
|
||||||
|
pipeServer = null;
|
||||||
|
LogEntry("...finished.", LogLevels.Debug);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Application.ApplicationExit -= OnApplicationExit;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ActiveCallMessage(string phone, string name, bool isOutgoing)
|
||||||
|
{
|
||||||
|
if (isOutgoing && !SignalOutgoingCall)
|
||||||
|
{
|
||||||
|
LogEntry("An outgoing call is signaled but signaling outgoing calls is not enabled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sendPipeName == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(phone))
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
if (name == null)
|
||||||
|
name = "";
|
||||||
|
|
||||||
|
var phone2 = phone.Trim();
|
||||||
|
if (!string.IsNullOrEmpty(ExternalCallPrefix) && phone2.StartsWith(ExternalCallPrefix))
|
||||||
|
phone2 = phone2.Remove(0,ExternalCallPrefix.Length);
|
||||||
|
|
||||||
|
if (phone2.StartsWith("+"))
|
||||||
|
{
|
||||||
|
var _r = Math.Min(phone2.Length, 3);
|
||||||
|
phone2 = phone2.Remove(0, _r);
|
||||||
|
}
|
||||||
|
else if (phone2.StartsWith("00"))
|
||||||
|
{
|
||||||
|
var _r = Math.Min(phone2.Length, 4);
|
||||||
|
phone2 = phone2.Remove(0, _r);
|
||||||
|
}
|
||||||
|
if (phone2.StartsWith("0"))
|
||||||
|
phone2 = phone2.Remove(0, 1);
|
||||||
|
|
||||||
|
var phone3 = "";
|
||||||
|
foreach (var C in phone2)
|
||||||
|
if ((C >= '0') && (C <= '9'))
|
||||||
|
phone3 += C;
|
||||||
|
|
||||||
|
var name2 = name.Trim();
|
||||||
|
var _strDir = isOutgoing ? "outgoing" : "incoming";
|
||||||
|
LogEntry($"Signaling {_strDir} call: phone={phone2}, name={name2}", LogLevels.Debug);
|
||||||
|
|
||||||
|
var Info = JsonConvert.SerializeObject(new cPhoneSearchParameters() { phone = phone3, name = name2 });
|
||||||
|
lock (sendPipeName)
|
||||||
|
{
|
||||||
|
Send($"phonesearch: {Info}", sendPipeName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static public bool Send(string SendStr, string PipeName, int TimeOut = 1000)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (IsSimulation)
|
||||||
|
{
|
||||||
|
LogEntry($"simulatied pipe send: {SendStr}");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
NamedPipeClientStream pipeStream = new NamedPipeClientStream
|
||||||
|
(".", PipeName, PipeDirection.Out, PipeOptions.WriteThrough);
|
||||||
|
|
||||||
|
// The connect function will indefinitely wait for the pipe to become available
|
||||||
|
// If that is not acceptable specify a maximum waiting time (in ms)
|
||||||
|
pipeStream.Connect(TimeOut);
|
||||||
|
|
||||||
|
byte[] _buffer = Encoding.UTF8.GetBytes(SendStr);
|
||||||
|
pipeStream.Write(_buffer, 0, _buffer.Length);
|
||||||
|
pipeStream.Flush();
|
||||||
|
pipeStream.Close();
|
||||||
|
pipeStream.Dispose();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (TimeoutException oEX)
|
||||||
|
{
|
||||||
|
if (DefaultLogger.IsDebug)
|
||||||
|
cLogManager.DefaultLogger.LogException(oEX);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static private void PipeServer_PipeMessage(string Reply)
|
||||||
|
{
|
||||||
|
if (Reply.ToLowerInvariant() == "stop")
|
||||||
|
{
|
||||||
|
timerPolling.Stop();
|
||||||
|
StopImmediate = true;
|
||||||
|
timerPolling.Interval = 100;
|
||||||
|
timerPolling.Start();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void TapiMessageHandler(C4TapiHelper.C4TapiLineInfo lineInfo)
|
||||||
|
{
|
||||||
|
if (lineInfo.eventType == C4TapiHelper.eTapiEventType.connected)
|
||||||
|
{
|
||||||
|
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ActiveCallMessage(lineInfo.participantPhoneNumber, lineInfo.participantName, lineInfo.IsOutbound);
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class cPhoneSearchParameters
|
||||||
|
{
|
||||||
|
public string phone { get; set; }
|
||||||
|
public string name { get; set; } = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
F4SD-PhoneMonitor/Properties/AssemblyInfo.cs
Normal file
11
F4SD-PhoneMonitor/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("F4SD SwyxIt Phone call Monitor")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
[assembly: Guid("5721e81f-3c41-4c63-8ea0-ee8d1ce73778")]
|
||||||
63
F4SD-PhoneMonitor/Properties/Resources.Designer.cs
generated
Normal file
63
F4SD-PhoneMonitor/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 F4SD_PhoneMonitor.Properties {
|
||||||
|
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 Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <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("F4SD_PhoneMonitor.Properties.Resources", typeof(Resources).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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
F4SD-PhoneMonitor/Properties/Resources.resx
Normal file
117
F4SD-PhoneMonitor/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?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.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: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" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</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" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
26
F4SD-PhoneMonitor/Properties/Settings.Designer.cs
generated
Normal file
26
F4SD-PhoneMonitor/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 F4SD_PhoneMonitor.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
F4SD-PhoneMonitor/Properties/Settings.settings
Normal file
7
F4SD-PhoneMonitor/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
BIN
F4SD-PhoneMonitor/logo_FASD.ico
Normal file
BIN
F4SD-PhoneMonitor/logo_FASD.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
4
F4SD-PhoneMonitor/packages.config
Normal file
4
F4SD-PhoneMonitor/packages.config
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
using C4IT.FASD.Base;
|
||||||
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
|
using FasdDesktopUi.Basics.Services.RelationService;
|
||||||
|
using NSubstitute;
|
||||||
|
using ServiceUnderTest = FasdDesktopUi.Basics.Services.RelationService;
|
||||||
|
|
||||||
|
namespace F4SD.Cockpit.Client.Test.Basics.Sevices.RelationService;
|
||||||
|
|
||||||
|
public class RelationServiceTest
|
||||||
|
{
|
||||||
|
private readonly ServiceUnderTest.RelationService _relationService = new();
|
||||||
|
private readonly cFasdCockpitCommunicationBase _communication = Substitute.For<cFasdCockpitCommunicationBase>();
|
||||||
|
|
||||||
|
public RelationServiceTest()
|
||||||
|
{
|
||||||
|
cFasdCockpitCommunicationBase.Instance = _communication;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact(Timeout = 2_000)]
|
||||||
|
public async Task LoadedRelation_IsIn_GetLoadedRelations_Test()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
Guid taskGuid = Guid.NewGuid();
|
||||||
|
cF4sdApiSearchResultRelation mockRelation = new()
|
||||||
|
{
|
||||||
|
id = Guid.NewGuid(),
|
||||||
|
Type = enumF4sdSearchResultClass.User
|
||||||
|
};
|
||||||
|
|
||||||
|
_communication.StartGatheringRelations(Arg.Any<IEnumerable<cFasdApiSearchResultEntry>>(), Arg.Any<CancellationToken>())
|
||||||
|
.Returns(Task.FromResult(new cF4sdStagedSearchResultRelationTaskId() { Id = taskGuid }));
|
||||||
|
_communication.GetStagedRelations(taskGuid, Arg.Any<CancellationToken>())
|
||||||
|
.Returns(Task.FromResult(new cF4sdStagedSearchResultRelations()
|
||||||
|
{
|
||||||
|
PendingInformationClasses = [],
|
||||||
|
Relations = [mockRelation]
|
||||||
|
}));
|
||||||
|
|
||||||
|
TaskCompletionSource tcs = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
|
_relationService.RelationsFound += OnRelationsFound;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
await _relationService.LoadRelationsAsync(null, TestContext.Current.CancellationToken);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
await tcs.Task;
|
||||||
|
|
||||||
|
var actual = _relationService.GetLoadedRelations();
|
||||||
|
Assert.Contains(mockRelation, actual);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_relationService.RelationsFound -= OnRelationsFound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnRelationsFound(object? s, EventArgs e)
|
||||||
|
{
|
||||||
|
tcs.TrySetResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact(Timeout = 2_000)]
|
||||||
|
public async Task LoadRelations_Raises_RelationsFound()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
Guid taskGuid = Guid.NewGuid();
|
||||||
|
cF4sdApiSearchResultRelation mockRelation = new()
|
||||||
|
{
|
||||||
|
id = Guid.NewGuid(),
|
||||||
|
Type = enumF4sdSearchResultClass.User
|
||||||
|
};
|
||||||
|
|
||||||
|
_communication.StartGatheringRelations(Arg.Any<IEnumerable<cFasdApiSearchResultEntry>>(), Arg.Any<CancellationToken>())
|
||||||
|
.Returns(Task.FromResult(new cF4sdStagedSearchResultRelationTaskId() { Id = taskGuid }));
|
||||||
|
_communication.GetStagedRelations(taskGuid, Arg.Any<CancellationToken>())
|
||||||
|
.Returns(Task.FromResult(new cF4sdStagedSearchResultRelations()
|
||||||
|
{
|
||||||
|
PendingInformationClasses = [],
|
||||||
|
Relations = [mockRelation]
|
||||||
|
}));
|
||||||
|
|
||||||
|
TaskCompletionSource<StagedSearchResultRelationsEventArgs> tcs = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
|
_relationService.RelationsFound += OnRelationsFound;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _relationService.LoadRelationsAsync(null, TestContext.Current.CancellationToken);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
|
||||||
|
var eventResult = await tcs.Task;
|
||||||
|
|
||||||
|
Assert.NotNull(eventResult);
|
||||||
|
Assert.Contains(mockRelation, eventResult.StagedResultRelations.Relations);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_relationService.RelationsFound -= OnRelationsFound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnRelationsFound(object? sender, StagedSearchResultRelationsEventArgs e)
|
||||||
|
{
|
||||||
|
tcs.TrySetResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact(Timeout = 2_000)]
|
||||||
|
public async Task GetLoadedRelations_ContainsOnly_ActualRelations_Test()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
Guid taskGuid = Guid.NewGuid();
|
||||||
|
cF4sdApiSearchResultRelation mockRelation1 = new()
|
||||||
|
{
|
||||||
|
id = Guid.NewGuid(),
|
||||||
|
Type = enumF4sdSearchResultClass.User
|
||||||
|
};
|
||||||
|
|
||||||
|
cF4sdApiSearchResultRelation mockRelation2 = new()
|
||||||
|
{
|
||||||
|
id = Guid.NewGuid(),
|
||||||
|
Type = enumF4sdSearchResultClass.Computer
|
||||||
|
};
|
||||||
|
|
||||||
|
_communication.StartGatheringRelations(Arg.Any<IEnumerable<cFasdApiSearchResultEntry>>(), Arg.Any<CancellationToken>())
|
||||||
|
.Returns(Task.FromResult(new cF4sdStagedSearchResultRelationTaskId() { Id = taskGuid }));
|
||||||
|
|
||||||
|
TaskCompletionSource tcs = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
|
||||||
|
// load relations first time
|
||||||
|
_communication.GetStagedRelations(taskGuid, Arg.Any<CancellationToken>())
|
||||||
|
.Returns(Task.FromResult(new cF4sdStagedSearchResultRelations()
|
||||||
|
{
|
||||||
|
PendingInformationClasses = [],
|
||||||
|
Relations = [mockRelation1]
|
||||||
|
}));
|
||||||
|
|
||||||
|
_relationService.RelationsFound += OnRelationsFound;
|
||||||
|
|
||||||
|
await _relationService.LoadRelationsAsync(null, TestContext.Current.CancellationToken);
|
||||||
|
await tcs.Task;
|
||||||
|
|
||||||
|
// load relations second time
|
||||||
|
tcs = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
|
|
||||||
|
_communication.GetStagedRelations(taskGuid, Arg.Any<CancellationToken>())
|
||||||
|
.Returns(Task.FromResult(new cF4sdStagedSearchResultRelations()
|
||||||
|
{
|
||||||
|
PendingInformationClasses = [],
|
||||||
|
Relations = [mockRelation2]
|
||||||
|
}));
|
||||||
|
|
||||||
|
await _relationService.LoadRelationsAsync(null, TestContext.Current.CancellationToken);
|
||||||
|
await tcs.Task;
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
var actual = _relationService.GetLoadedRelations();
|
||||||
|
Assert.DoesNotContain(mockRelation1, actual);
|
||||||
|
Assert.Contains(mockRelation2, actual);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_relationService.RelationsFound -= OnRelationsFound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnRelationsFound(object? s, EventArgs e)
|
||||||
|
{
|
||||||
|
tcs.TrySetResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
using C4IT.FASD.Base;
|
||||||
|
using FasdDesktopUi.Basics.Services.RelationService;
|
||||||
|
using FasdDesktopUi.Basics.Services.SupportCase;
|
||||||
|
using NSubstitute;
|
||||||
|
|
||||||
|
namespace F4SD.Cockpit.Client.Test.Basics.Sevices.SupportCase;
|
||||||
|
|
||||||
|
public class SupportCaseTest
|
||||||
|
{
|
||||||
|
private readonly ISupportCase _supportCase;
|
||||||
|
private readonly IRelationService _relationService;
|
||||||
|
|
||||||
|
public SupportCaseTest()
|
||||||
|
{
|
||||||
|
_relationService = Substitute.For<IRelationService>();
|
||||||
|
cF4sdIdentityEntry primaryIdentity = new() { Class = enumFasdInformationClass.User, Id = Guid.NewGuid() };
|
||||||
|
_supportCase = SupportCaseFactory.Get(primaryIdentity, _relationService, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetCaseRelations_Contains_AddCaseRelations()
|
||||||
|
{
|
||||||
|
var actualRelations = _supportCase.GetCaseRelations();
|
||||||
|
Assert.Empty(actualRelations);
|
||||||
|
|
||||||
|
ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> relations = new List<cF4sdApiSearchResultRelation>()
|
||||||
|
{
|
||||||
|
new() { Type = enumF4sdSearchResultClass.Computer, Name = "My computer", Identities = [
|
||||||
|
new() { Id = Guid.NewGuid(), Class = enumFasdInformationClass.Computer }
|
||||||
|
] }
|
||||||
|
}.ToLookup(r => cF4sdIdentityEntry.GetFromSearchResult(r.Type), r => r);
|
||||||
|
|
||||||
|
_supportCase.AddCaseRelations(relations);
|
||||||
|
|
||||||
|
actualRelations = _supportCase.GetCaseRelations();
|
||||||
|
Assert.Single(actualRelations);
|
||||||
|
Assert.Contains(relations.FirstOrDefault(), actualRelations);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void AddCaseRelations_Raise_CaseRelationsAdded()
|
||||||
|
{
|
||||||
|
ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> relations = new List<cF4sdApiSearchResultRelation>()
|
||||||
|
{
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
Type = enumF4sdSearchResultClass.Computer,
|
||||||
|
Name = "My computer",
|
||||||
|
Identities =
|
||||||
|
[
|
||||||
|
new() { Id = Guid.NewGuid(), Class = enumFasdInformationClass.Computer }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}.ToLookup(r => cF4sdIdentityEntry.GetFromSearchResult(r.Type), r => r);
|
||||||
|
|
||||||
|
var raisedEvent = Assert.Raises<RelationEventArgs>(
|
||||||
|
h => _supportCase.CaseRelationsAdded += h,
|
||||||
|
h => _supportCase.CaseRelationsAdded -= h,
|
||||||
|
() => _supportCase.AddCaseRelations(relations));
|
||||||
|
|
||||||
|
Assert.NotNull(raisedEvent);
|
||||||
|
Assert.Equal(_supportCase, raisedEvent.Sender);
|
||||||
|
Assert.Equal(relations, raisedEvent.Arguments.Relations);
|
||||||
|
}
|
||||||
|
}
|
||||||
43
F4SD.Cockpit.Client.Test/F4SD.Cockpit.Client.Test.csproj
Normal file
43
F4SD.Cockpit.Client.Test/F4SD.Cockpit.Client.Test.csproj
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>F4SD.Cockpit.Client.Test</RootNamespace>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<!--
|
||||||
|
To enable the Microsoft Testing Platform 'dotnet test' experience, add property:
|
||||||
|
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
|
||||||
|
|
||||||
|
To enable the Microsoft Testing Platform native command line experience, add property:
|
||||||
|
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
|
||||||
|
|
||||||
|
For more information on Microsoft Testing Platform support in xUnit.net, please visit:
|
||||||
|
https://xunit.net/docs/getting-started/v3/microsoft-testing-platform
|
||||||
|
-->
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Using Include="Xunit" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
|
||||||
|
<PackageReference Include="NSubstitute" Version="5.3.0" />
|
||||||
|
<PackageReference Include="xunit.v3" Version="3.1.0" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\FasdDesktopUi\F4SD-Cockpit-Client.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
3
F4SD.Cockpit.Client.Test/xunit.runner.json
Normal file
3
F4SD.Cockpit.Client.Test/xunit.runner.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
|
||||||
|
}
|
||||||
6
F4SD_IconPicker/F4SDicons/App.config
Normal file
6
F4SD_IconPicker/F4SDicons/App.config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
17
F4SD_IconPicker/F4SDicons/App.xaml
Normal file
17
F4SD_IconPicker/F4SDicons/App.xaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<Application x:Class="F4SDicons.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
StartupUri="MainWindow.xaml">
|
||||||
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<!--Dark/LightMode-->
|
||||||
|
<ResourceDictionary Source="ResourcesLightMode.xaml"/>
|
||||||
|
<!--ScrollViewer Ressourcen-->
|
||||||
|
<ResourceDictionary Source="ScrollViewerResources.xaml"/>
|
||||||
|
<!--Slider Ressourcen-->
|
||||||
|
<ResourceDictionary Source="CustomSlider.xaml"/>
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
21
F4SD_IconPicker/F4SDicons/App.xaml.cs
Normal file
21
F4SD_IconPicker/F4SDicons/App.xaml.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using C4IT.Logging;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace F4SDicons
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnStartup(e);
|
||||||
|
InitializeLogger();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeLogger()
|
||||||
|
{
|
||||||
|
cLogManagerFile.CreateInstance(false, SubFolder: "Logs");
|
||||||
|
cLogManager.DefaultLogger.LogAssemblyInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
97
F4SD_IconPicker/F4SDicons/CustomSlider.xaml
Normal file
97
F4SD_IconPicker/F4SDicons/CustomSlider.xaml
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
|
||||||
|
<Style x:Key="SliderRepeatButton" TargetType="RepeatButton">
|
||||||
|
<Setter Property="SnapsToDevicePixels" Value="true" />
|
||||||
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||||
|
<Setter Property="IsTabStop" Value="false" />
|
||||||
|
<Setter Property="Focusable" Value="false" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="RepeatButton">
|
||||||
|
<Border x:Name="RightSliderBorder" Background="{DynamicResource colorF2F2F2}" Height="5" BorderThickness="1"/>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SliderRepeatButton1" TargetType="RepeatButton">
|
||||||
|
<Setter Property="SnapsToDevicePixels" Value="true" />
|
||||||
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="RepeatButton">
|
||||||
|
<Border x:Name="LeftSliderBorder" SnapsToDevicePixels="True" Background="{DynamicResource colorF2F2F2}" Height="5" BorderThickness="1"/>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SliderThumb" TargetType="Thumb">
|
||||||
|
<Setter Property="SnapsToDevicePixels" Value="true" />
|
||||||
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Thumb">
|
||||||
|
<!--Add name to ellipse to use in controltemplate triggers-->
|
||||||
|
<Border x:Name="ThumbBorder" Height="15" Width="15" CornerRadius="10" VerticalAlignment="Center" HorizontalAlignment="Center" Background="{DynamicResource color3D3C3C}" Padding="2">
|
||||||
|
<TextBlock x:Name="ThumbBorderText" FontSize="12" FontWeight="DemiBold" Foreground="{DynamicResource colorF7FAFA}" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" Text="{Binding RelativeSource={RelativeSource AncestorType=Slider, AncestorLevel=1}, Path=Value, StringFormat=N0}">
|
||||||
|
<!--<TextBlock.Text>
|
||||||
|
<Binding ElementName="CustomSlider" Path="Value"/>
|
||||||
|
</TextBlock.Text>-->
|
||||||
|
</TextBlock>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="ThumbBorder" Property="Height" Value="27"></Setter>
|
||||||
|
<Setter TargetName="ThumbBorder" Property="Width" Value="27"></Setter>
|
||||||
|
<Setter TargetName="ThumbBorder" Property="CornerRadius" Value="13"></Setter>
|
||||||
|
<Setter Property="Cursor" Value="Hand"></Setter>
|
||||||
|
<Setter TargetName="ThumbBorderText" Property="Visibility" Value="Visible"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="Slider" TargetType="Slider">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="30"/>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Track Grid.Row="1" x:Name="PART_Track" >
|
||||||
|
<Track.DecreaseRepeatButton>
|
||||||
|
<RepeatButton Style="{StaticResource SliderRepeatButton1}" Command="Slider.DecreaseLarge" />
|
||||||
|
</Track.DecreaseRepeatButton>
|
||||||
|
<Track.Thumb>
|
||||||
|
<Thumb Style="{StaticResource SliderThumb}" />
|
||||||
|
</Track.Thumb>
|
||||||
|
<Track.IncreaseRepeatButton>
|
||||||
|
<RepeatButton Style="{StaticResource SliderRepeatButton}" Command="Slider.IncreaseLarge" />
|
||||||
|
</Track.IncreaseRepeatButton>
|
||||||
|
</Track>
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<Style x:Name="CustomSlider" TargetType="Slider">
|
||||||
|
<Setter Property="Focusable" Value="False"/>
|
||||||
|
<Setter Property="SnapsToDevicePixels" Value="true" />
|
||||||
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||||
|
<Setter Property="Minimum" Value="50"/>
|
||||||
|
<Setter Property="Maximum" Value="200"/>
|
||||||
|
<Setter Property="Value" Value="100"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="Orientation" Value="Horizontal">
|
||||||
|
<Setter Property="MinHeight" Value="21" />
|
||||||
|
<Setter Property="MinWidth" Value="104" />
|
||||||
|
<Setter Property="Template" Value="{StaticResource Slider}" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
225
F4SD_IconPicker/F4SDicons/F4SD_IconPicker.csproj
Normal file
225
F4SD_IconPicker/F4SDicons/F4SD_IconPicker.csproj
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
<?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>{459169D0-712D-46A8-B9A8-2EE0FDFD3AF3}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>F4SDicons</RootNamespace>
|
||||||
|
<AssemblyName>F4SD-IconPicker</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>false</Deterministic>
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<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' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Setup %28Release%29|AnyCPU'">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Setup %28Release%29\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>IconPickerLogo.ico</ApplicationIcon>
|
||||||
|
</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>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</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="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xaml">
|
||||||
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
<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>
|
||||||
|
<ApplicationDefinition Include="App.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</ApplicationDefinition>
|
||||||
|
<Compile Include="..\..\..\Common Code\MultiLanguage\C4IT.MultiLanguage.MultiLanguageSupport.cs">
|
||||||
|
<Link>Common\C4IT.MultiLanguage.MultiLanguageSupport.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\..\..\Common Code\XML\C4IT.XML.ConfigParsing.cs">
|
||||||
|
<Link>Common\C4IT.XML.ConfigParsing.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Models\AdvancedIconInformation.cs" />
|
||||||
|
<Compile Include="Models\IconCollectionUserControl.cs" />
|
||||||
|
<Compile Include="Models\RoutedEventArgsIconInfo.cs" />
|
||||||
|
<Compile Include="User Controls\CopyTextBox.xaml.cs">
|
||||||
|
<DependentUpon>CopyTextBox.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="User Controls\IconGrid.xaml.cs">
|
||||||
|
<DependentUpon>IconGrid.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="User Controls\IconList.xaml.cs">
|
||||||
|
<DependentUpon>IconList.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="User Controls\SearchBar.xaml.cs">
|
||||||
|
<DependentUpon>SearchBar.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="User Controls\WindowStateBar.xaml.cs">
|
||||||
|
<DependentUpon>WindowStateBar.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="User Controls\ZoomViewer.xaml.cs">
|
||||||
|
<DependentUpon>ZoomViewer.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Page Include="CustomSlider.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="MainWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Compile Include="App.xaml.cs">
|
||||||
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MainWindow.xaml.cs">
|
||||||
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Page Include="ResourcesDarkMode.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="ResourcesLightMode.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="ScrollViewerResources.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="User Controls\CopyTextBox.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="User Controls\IconGrid.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="User Controls\IconList.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="User Controls\SearchBar.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="User Controls\WindowStateBar.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="User Controls\ZoomViewer.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="F4SDicon.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Images\IconsF4SD.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Images\F4SDicon3.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Images\IconPickerLogo.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\F4SD-AdaptableIcon\F4SD-AdaptableIcon.csproj">
|
||||||
|
<Project>{bab63a6a-1524-435d-9f96-7a30b6ee0624}</Project>
|
||||||
|
<Name>F4SD-AdaptableIcon</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\F4SD-Logging\F4SD-Logging.csproj">
|
||||||
|
<Project>{7793f281-b226-4e20-b6f6-5d53d70f1dc1}</Project>
|
||||||
|
<Name>F4SD-Logging</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="IconPickerLogo.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
10
F4SD_IconPicker/F4SDicons/F4SD_IconPicker.csproj.vspscc
Normal file
10
F4SD_IconPicker/F4SDicons/F4SD_IconPicker.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"
|
||||||
|
}
|
||||||
BIN
F4SD_IconPicker/F4SDicons/F4SDicon.png
Normal file
BIN
F4SD_IconPicker/F4SDicons/F4SDicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 985 B |
BIN
F4SD_IconPicker/F4SDicons/IconPickerLogo.ico
Normal file
BIN
F4SD_IconPicker/F4SDicons/IconPickerLogo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
BIN
F4SD_IconPicker/F4SDicons/Images/F4SDicon3.png
Normal file
BIN
F4SD_IconPicker/F4SDicons/Images/F4SDicon3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 778 B |
BIN
F4SD_IconPicker/F4SDicons/Images/IconPickerLogo.ico
Normal file
BIN
F4SD_IconPicker/F4SDicons/Images/IconPickerLogo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
BIN
F4SD_IconPicker/F4SDicons/Images/IconsF4SD.png
Normal file
BIN
F4SD_IconPicker/F4SDicons/Images/IconsF4SD.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 983 B |
190
F4SD_IconPicker/F4SDicons/MainWindow.xaml
Normal file
190
F4SD_IconPicker/F4SDicons/MainWindow.xaml
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
<Window x:Class="F4SDicons.MainWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:F4SDicons"
|
||||||
|
xmlns:mi="clr-namespace:MaterialIcons;assembly=MaterialIcons"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
xmlns:uc="clr-namespace:F4SDicons.User_Controls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
SizeChanged="Window_SizeChanged"
|
||||||
|
WindowStyle="None"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
Title="F4SD Icon Picker" Height="600" Width="880" Icon="/Images/IconPickerLogo.ico">
|
||||||
|
|
||||||
|
<WindowChrome.WindowChrome>
|
||||||
|
<WindowChrome CaptionHeight="45"/>
|
||||||
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
|
<Window.Resources>
|
||||||
|
<SolidColorBrush x:Key="color1C4A99" Color="#1C4A99"/>
|
||||||
|
<SolidColorBrush x:Key="colorFFFFFF" Color="#FFFFFF"/>
|
||||||
|
<BooleanToVisibilityConverter x:Key="MyBoolToVisibilityConverter" />
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
|
<Grid Background="{DynamicResource colorE9E9E9}">
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="45"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="50"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="30"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<uc:WindowStateBar Grid.Column="1" WindowChrome.IsHitTestVisibleInChrome="True">
|
||||||
|
|
||||||
|
</uc:WindowStateBar>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Grid.Row="1" Name="upperGrid">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition x:Name="colDef3" Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid Grid.Column="0" Grid.Row="2" Name="listGrid" VerticalAlignment="Stretch" Background="{DynamicResource colorE9E9E9}">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="40"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<uc:SearchBar x:Name="SearchBarUC">
|
||||||
|
|
||||||
|
</uc:SearchBar>
|
||||||
|
|
||||||
|
<Border Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
|
|
||||||
|
<ScrollViewer Margin="0,0,5,0">
|
||||||
|
|
||||||
|
<StackPanel Name="mIconsStackpanel" Orientation="Vertical">
|
||||||
|
|
||||||
|
<uc:IconList x:Name="IconListUC" IconSelected="Viewer_IconSelected" />
|
||||||
|
|
||||||
|
<uc:IconGrid x:Name="IconGridUC" IconSelected="Viewer_IconSelected" Visibility="Collapsed"/>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Grid.Column="1" Grid.Row="0" Background="{DynamicResource colorE9E9E9}">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="6*"/>
|
||||||
|
<RowDefinition Height="60"/>
|
||||||
|
<RowDefinition Height="60"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<uc:ZoomViewer Grid.Row="0" x:Name="currentIconUC">
|
||||||
|
|
||||||
|
</uc:ZoomViewer>
|
||||||
|
|
||||||
|
<uc:CopyTextBox Grid.Row="1" x:Name="currentNameUC" ToolTipText="Icon-Name kopieren">
|
||||||
|
|
||||||
|
</uc:CopyTextBox>
|
||||||
|
|
||||||
|
<uc:CopyTextBox Grid.Row="2" x:Name="currentFullNameUC" ToolTipText="XML-Konfigurationswert kopieren">
|
||||||
|
|
||||||
|
</uc:CopyTextBox>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Grid.Row="2" Name="bottomGrid" Background="{DynamicResource colorE9E9E9}">
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="35"/>
|
||||||
|
<ColumnDefinition Width="3"/>
|
||||||
|
<ColumnDefinition Width="35"/>
|
||||||
|
<ColumnDefinition Width="20"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid.Resources>
|
||||||
|
|
||||||
|
<Style TargetType="Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource colorE9E9E9}"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
<Setter Property="CornerRadius" Value="5"/>
|
||||||
|
<Setter Property="Height" Value="35"/>
|
||||||
|
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource colorF2F2F2}"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color3D3C3C}"/>
|
||||||
|
<Setter Property="IconHeight" Value="30"/>
|
||||||
|
<Setter Property="IconWidth" Value="30"/>
|
||||||
|
<Setter Property="BorderPadding" Value="5"/>
|
||||||
|
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color1F92EE}"/>
|
||||||
|
<Setter Property="IconBackgroundColor" Value="{DynamicResource colorF2F2F2}"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="F4SDicon" TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color3D3C3C}"/>
|
||||||
|
<Setter Property="SecondaryIconColor" Value="{DynamicResource colorF7FAFA}"/>
|
||||||
|
<Setter Property="BorderPadding" Value="0"/>
|
||||||
|
<Setter Property="IconWidth" Value="30"/>
|
||||||
|
<Setter Property="IconHeight" Value="30"/>
|
||||||
|
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color1C4A99}"/>
|
||||||
|
<Setter Property="SecondaryIconColor" Value="{DynamicResource colorFFFFFF}"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</Grid.Resources>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Column="0" x:Name="materialLogo" Style="{DynamicResource F4SDicon}" SelectedInternIcon="f4sd">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Column="2" x:Name="gridIcon" MouseLeftButtonUp="ChangeToGrid_ButtonUp" ToolTip="Gitter-Ansicht" SelectedMaterialIcon="ic_grid_on">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Column="2" x:Name="listIcon" Visibility="Collapsed" MouseLeftButtonUp="ChangeToList_ButtonUp" ToolTip="Listen-Ansicht" SelectedMaterialIcon="ic_format_list_bulleted">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Column="4" x:Name="darkModeIcon" MouseLeftButtonUp="ChangeToDarkMode_ButtonUp" ToolTip="Dark-Mode" SelectedInternIcon="style_moonFilled">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Column="4" x:Name="lightModeIcon" Visibility="Collapsed" MouseLeftButtonUp="ChangeToLightMode_ButtonUp" ToolTip="Light-Mode" SelectedInternIcon="style_sunFilled">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Window>
|
||||||
311
F4SD_IconPicker/F4SDicons/MainWindow.xaml.cs
Normal file
311
F4SD_IconPicker/F4SDicons/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,311 @@
|
|||||||
|
using FasdDesktopUi.Basics.UserControls.AdaptableIcon;
|
||||||
|
using MaterialIcons;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using F4SDicons.Models;
|
||||||
|
using F4SD_AdaptableIcon.Enums;
|
||||||
|
|
||||||
|
namespace F4SDicons
|
||||||
|
{
|
||||||
|
public partial class MainWindow : System.Windows.Window
|
||||||
|
{
|
||||||
|
private List<cAdvancedIconInformation> iconInformation = new List<cAdvancedIconInformation>();
|
||||||
|
|
||||||
|
|
||||||
|
public MainWindow() => InitializeComponent();
|
||||||
|
|
||||||
|
protected override void OnInitialized(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnInitialized(e);
|
||||||
|
SearchBarUC.bindingTextBox.DataContext = this;
|
||||||
|
InstantiateIconInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InstantiateIconInformation()
|
||||||
|
{
|
||||||
|
|
||||||
|
List<cAdvancedIconInformation> IconInformation = new List<cAdvancedIconInformation>();
|
||||||
|
|
||||||
|
foreach (enumInternIcons internIcon in Enum.GetValues(typeof(enumInternIcons)))
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (internIcon)
|
||||||
|
{
|
||||||
|
case enumInternIcons.none:
|
||||||
|
case enumInternIcons.fasd:
|
||||||
|
case enumInternIcons.f4sd:
|
||||||
|
case enumInternIcons.f4sd_outline:
|
||||||
|
case enumInternIcons.f4sd_speedo:
|
||||||
|
case enumInternIcons.f4sd_product_logo:
|
||||||
|
case enumInternIcons.misc_functionMarker:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
cAdvancedIconInformation tempIconInformation = new cAdvancedIconInformation() { IsVisible = true };
|
||||||
|
tempIconInformation.UpdateIconInformation(internIcon);
|
||||||
|
IconInformation.Add(tempIconInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (MaterialIconType materialIcon in Enum.GetValues(typeof(MaterialIconType)))
|
||||||
|
{
|
||||||
|
cAdvancedIconInformation tempIconInformation = new cAdvancedIconInformation() { IsVisible = true };
|
||||||
|
tempIconInformation.UpdateIconInformation(materialIcon);
|
||||||
|
IconInformation.Add(tempIconInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
iconInformation = IconInformation;
|
||||||
|
IconListUC.IconInformation = IconInformation;
|
||||||
|
IconGridUC.IconInformation = IconInformation;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Variables
|
||||||
|
|
||||||
|
bool greaterThan = false;
|
||||||
|
string src = "ResourcesLightMode.xaml";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Search Filter
|
||||||
|
|
||||||
|
private string searchvalue;
|
||||||
|
|
||||||
|
public string SearchValue
|
||||||
|
{
|
||||||
|
get { return searchvalue; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
searchvalue = value;
|
||||||
|
FilterIconInformation(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void FilterIconInformation(string filterValue)
|
||||||
|
{
|
||||||
|
foreach (var information in iconInformation)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(filterValue))
|
||||||
|
{
|
||||||
|
information.IsVisible = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
information.IsVisible = information.IconName.Contains(filterValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Size Change
|
||||||
|
|
||||||
|
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
var ah = ActualHeight;
|
||||||
|
var aw = ActualWidth;
|
||||||
|
if (ah > aw)
|
||||||
|
{
|
||||||
|
if (greaterThan == false)
|
||||||
|
{
|
||||||
|
HeightGtWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (greaterThan == true)
|
||||||
|
{
|
||||||
|
WidthGtHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HeightGtWidth()
|
||||||
|
{
|
||||||
|
RowDefinition rowDef3 = new RowDefinition();
|
||||||
|
rowDef3.Height = new GridLength(1, GridUnitType.Star);
|
||||||
|
|
||||||
|
upperGrid.RowDefinitions.Add(rowDef3);
|
||||||
|
|
||||||
|
var spareColumnDefinitions = upperGrid.ColumnDefinitions.Skip(1).ToList();
|
||||||
|
foreach (var spareColumnDefinition in spareColumnDefinitions)
|
||||||
|
{
|
||||||
|
upperGrid.ColumnDefinitions.Remove(spareColumnDefinition);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
greaterThan = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void WidthGtHeight()
|
||||||
|
{
|
||||||
|
ColumnDefinition colDef3 = new ColumnDefinition();
|
||||||
|
colDef3.Width = new GridLength(1, GridUnitType.Star);
|
||||||
|
|
||||||
|
upperGrid.ColumnDefinitions.Add(colDef3);
|
||||||
|
|
||||||
|
var spareRowDefinitions = upperGrid.RowDefinitions.Skip(1).ToList();
|
||||||
|
foreach (var spareRowDefinition in spareRowDefinitions)
|
||||||
|
{
|
||||||
|
upperGrid.RowDefinitions.Remove(spareRowDefinition);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
greaterThan = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Grid/List
|
||||||
|
|
||||||
|
bool gridMode = false;
|
||||||
|
|
||||||
|
#region To Grid
|
||||||
|
|
||||||
|
private void ChangeToGrid_ButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (gridMode == false)
|
||||||
|
{
|
||||||
|
ShowGrid();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
listIcon.Visibility = Visibility.Visible;
|
||||||
|
gridIcon.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
gridMode = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowGrid()
|
||||||
|
{
|
||||||
|
IconGridUC.Visibility = Visibility.Visible;
|
||||||
|
IconListUC.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region To List
|
||||||
|
|
||||||
|
private void ChangeToList_ButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (gridMode == true)
|
||||||
|
{
|
||||||
|
ShowList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
gridIcon.Visibility = Visibility.Visible;
|
||||||
|
listIcon.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
gridMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowList()
|
||||||
|
{
|
||||||
|
IconListUC.Visibility = Visibility.Visible;
|
||||||
|
IconGridUC.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Color Mode
|
||||||
|
|
||||||
|
bool colorMode = false;
|
||||||
|
|
||||||
|
#region Dark Mode
|
||||||
|
|
||||||
|
private void ChangeToDarkMode_ButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (colorMode == false)
|
||||||
|
{
|
||||||
|
Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
|
||||||
|
|
||||||
|
src = "ResourcesDarkMode.xaml";
|
||||||
|
|
||||||
|
System.Windows.Application.Current.Resources.MergedDictionaries.Insert(0, new ResourceDictionary { Source = new Uri(src, UriKind.Relative) });
|
||||||
|
System.Windows.Application.Current.Resources.MergedDictionaries.Remove(System.Windows.Application.Current.Resources.MergedDictionaries[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
lightModeIcon.Visibility = Visibility.Visible;
|
||||||
|
darkModeIcon.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
colorMode = true;
|
||||||
|
|
||||||
|
Mouse.OverrideCursor = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Light Mode
|
||||||
|
|
||||||
|
private void ChangeToLightMode_ButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (colorMode == true)
|
||||||
|
{
|
||||||
|
Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
|
||||||
|
|
||||||
|
src = "ResourcesLightMode.xaml";
|
||||||
|
|
||||||
|
System.Windows.Application.Current.Resources.MergedDictionaries.Insert(0, new ResourceDictionary { Source = new Uri(src, UriKind.Relative) });
|
||||||
|
System.Windows.Application.Current.Resources.MergedDictionaries.Remove(System.Windows.Application.Current.Resources.MergedDictionaries[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
darkModeIcon.Visibility = Visibility.Visible;
|
||||||
|
lightModeIcon.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
colorMode = false;
|
||||||
|
|
||||||
|
Mouse.OverrideCursor = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Klick Event
|
||||||
|
|
||||||
|
private void Viewer_IconSelected(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!(sender is FrameworkElement frameworkElement) || !(e is RoutedEventArgsIconInfo iconEventArgs))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (iconEventArgs.IconType == enumIconTypes.intern)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Enum.TryParse(iconEventArgs.IconName, out enumInternIcons internIconType))
|
||||||
|
{
|
||||||
|
currentIconUC.currentIcon.SelectedInternIcon = internIconType;
|
||||||
|
currentNameUC.TextContent = iconEventArgs.IconName;
|
||||||
|
currentFullNameUC.TextContent = "<Icon IconType=\"intern\" Name=\"" + iconEventArgs.IconName + "\"/>";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (iconEventArgs.IconType == enumIconTypes.material)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Enum.TryParse(iconEventArgs.IconName, out MaterialIconType materialIconType))
|
||||||
|
{
|
||||||
|
currentIconUC.currentIcon.SelectedMaterialIcon = materialIconType;
|
||||||
|
currentNameUC.TextContent = iconEventArgs.IconName;
|
||||||
|
currentFullNameUC.TextContent = "<Icon IconType=\"material\" Name=\"" + iconEventArgs.IconName + "\"/>";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
31
F4SD_IconPicker/F4SDicons/Models/AdvancedIconInformation.cs
Normal file
31
F4SD_IconPicker/F4SDicons/Models/AdvancedIconInformation.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static FasdDesktopUi.Basics.UserControls.AdaptableIcon.cIconPainter;
|
||||||
|
|
||||||
|
namespace F4SDicons.Models
|
||||||
|
{
|
||||||
|
public class cAdvancedIconInformation : cIconInformation, INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
private bool isVisible;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsVisible
|
||||||
|
{
|
||||||
|
get { return isVisible; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isVisible = value;
|
||||||
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsVisible)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
namespace F4SDicons.Models
|
||||||
|
{
|
||||||
|
public class IconCollectionUserControl : UserControl
|
||||||
|
{
|
||||||
|
#region Events
|
||||||
|
|
||||||
|
public static readonly RoutedEvent IconSelectedEvent = EventManager.RegisterRoutedEvent("IconSelected", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(UserControl));
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
27
F4SD_IconPicker/F4SDicons/Models/RoutedEventArgsIconInfo.cs
Normal file
27
F4SD_IconPicker/F4SDicons/Models/RoutedEventArgsIconInfo.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using F4SD_AdaptableIcon.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace F4SDicons.Models
|
||||||
|
{
|
||||||
|
public class RoutedEventArgsIconInfo : RoutedEventArgs
|
||||||
|
{
|
||||||
|
public string IconName { get; set; }
|
||||||
|
|
||||||
|
public enumIconTypes IconType { get; set; }
|
||||||
|
|
||||||
|
public RoutedEventArgsIconInfo()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoutedEventArgsIconInfo(RoutedEvent customEvent) : base (customEvent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
55
F4SD_IconPicker/F4SDicons/Properties/AssemblyInfo.cs
Normal file
55
F4SD_IconPicker/F4SDicons/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Resources;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
// 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("F4SD Icon Picker")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("Consulting4IT GmbH, Germany")]
|
||||||
|
[assembly: AssemblyProduct("F4SD Icon Picker")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2024, Consulting4IT GmbH, Germany")]
|
||||||
|
[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)]
|
||||||
|
|
||||||
|
//In order to begin building localizable applications, set
|
||||||
|
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||||
|
//inside a <PropertyGroup>. For example, if you are using US english
|
||||||
|
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||||
|
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||||
|
//the line below to match the UICulture setting in the project file.
|
||||||
|
|
||||||
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
|
|
||||||
|
[assembly: ThemeInfo(
|
||||||
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// or application resource dictionaries)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// app, or any theme specific resource dictionaries)
|
||||||
|
)]
|
||||||
|
|
||||||
|
|
||||||
|
// 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.1.*")]
|
||||||
|
[assembly: AssemblyFileVersion("1.1.0.0")]
|
||||||
70
F4SD_IconPicker/F4SDicons/Properties/Resources.Designer.cs
generated
Normal file
70
F4SD_IconPicker/F4SDicons/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 F4SDicons.Properties
|
||||||
|
{
|
||||||
|
/// <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", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <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 ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("F4SDicons.Properties.Resources", typeof(Resources).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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
F4SD_IconPicker/F4SDicons/Properties/Resources.resx
Normal file
117
F4SD_IconPicker/F4SDicons/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?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.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: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" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</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" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
29
F4SD_IconPicker/F4SDicons/Properties/Settings.Designer.cs
generated
Normal file
29
F4SD_IconPicker/F4SDicons/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 F4SDicons.Properties
|
||||||
|
{
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
F4SD_IconPicker/F4SDicons/Properties/Settings.settings
Normal file
7
F4SD_IconPicker/F4SDicons/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
52
F4SD_IconPicker/F4SDicons/ResourcesDarkMode.xaml
Normal file
52
F4SD_IconPicker/F4SDicons/ResourcesDarkMode.xaml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon">
|
||||||
|
|
||||||
|
<SolidColorBrush x:Key="colorE9E9E9" Color="#363636"/>
|
||||||
|
<SolidColorBrush x:Key="colorF7FAFA" Color="#1A1A1A"/>
|
||||||
|
<SolidColorBrush x:Key="color3D3C3C" Color="#9B9B9B"/>
|
||||||
|
<SolidColorBrush x:Key="color1F92EE" Color="#0077A8"/>
|
||||||
|
<SolidColorBrush x:Key="colorF2F2F2" Color="#272727"/>
|
||||||
|
<SolidColorBrush x:Key="color9A9B9B" Color="#5A5A5A"/>
|
||||||
|
|
||||||
|
|
||||||
|
<Color x:Key="ControlLightColor">#303030</Color>
|
||||||
|
<Color x:Key="ControlMediumColor">#303030</Color>
|
||||||
|
<Color x:Key="ControlDarkColor">#303030</Color>
|
||||||
|
<SolidColorBrush x:Key="Scrollbar.Track.Color">#575757</SolidColorBrush>
|
||||||
|
|
||||||
|
<Style TargetType="ico:AdaptableIcon" x:Key="GridIconStyle">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="#9B9B9B"/>
|
||||||
|
<Setter Property="SecondaryIconColor" Value="#1A1A1A"/>
|
||||||
|
<Setter Property="IconHeight" Value="55"/>
|
||||||
|
<Setter Property="IconWidth" Value="55" />
|
||||||
|
<Setter Property="BorderPadding" Value="7.5" />
|
||||||
|
<Setter Property="IconBackgroundColor" Value="#1A1A1A"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
<Setter Property="IconCornerRadius" Value="7.5"/>
|
||||||
|
<Setter Property="Margin" Value="5, 2.5, 0, 2.5" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="Border" x:Key="ListBorderIconStyle">
|
||||||
|
|
||||||
|
<Setter Property="Background" Value="#1A1A1A" />
|
||||||
|
<Setter Property="CornerRadius" Value="5"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="Margin" Value="10,3,10,0"/>
|
||||||
|
<Setter Property="Height" Value="30"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
|
||||||
|
|
||||||
|
<Style.Resources>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="#9B9B9B"/>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="#9B9B9B"/>
|
||||||
|
<Setter Property="SecondaryIconColor" Value="#1A1A1A"/>
|
||||||
|
</Style>
|
||||||
|
</Style.Resources>
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
52
F4SD_IconPicker/F4SDicons/ResourcesLightMode.xaml
Normal file
52
F4SD_IconPicker/F4SDicons/ResourcesLightMode.xaml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon">
|
||||||
|
|
||||||
|
<SolidColorBrush x:Key="colorE9E9E9" Color="#E9E9E9"/>
|
||||||
|
<SolidColorBrush x:Key="colorF7FAFA" Color="#F7FAFA"/>
|
||||||
|
<SolidColorBrush x:Key="color3D3C3C" Color="#3D3C3C"/>
|
||||||
|
<SolidColorBrush x:Key="color1F92EE" Color="#1F92EE"/>
|
||||||
|
<SolidColorBrush x:Key="colorF2F2F2" Color="#F2F2F2"/>
|
||||||
|
<SolidColorBrush x:Key="color9A9B9B" Color="#9A9B9B"/>
|
||||||
|
|
||||||
|
|
||||||
|
<Color x:Key="ControlLightColor">#DBDBDB</Color>
|
||||||
|
<Color x:Key="ControlMediumColor">#DBDBDB</Color>
|
||||||
|
<Color x:Key="ControlDarkColor">#DBDBDB</Color>
|
||||||
|
<SolidColorBrush x:Key="Scrollbar.Track.Color">#F2F2F2</SolidColorBrush>
|
||||||
|
|
||||||
|
<Style TargetType="ico:AdaptableIcon" x:Key="GridIconStyle">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="#3D3C3C"/>
|
||||||
|
<Setter Property="SecondaryIconColor" Value="#F7FAFA"/>
|
||||||
|
<Setter Property="IconHeight" Value="55"/>
|
||||||
|
<Setter Property="IconWidth" Value="55" />
|
||||||
|
<Setter Property="BorderPadding" Value="7.5" />
|
||||||
|
<Setter Property="IconBackgroundColor" Value="#F7FAFA"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
<Setter Property="IconCornerRadius" Value="7.5"/>
|
||||||
|
<Setter Property="Margin" Value="5, 2.5, 0, 2.5" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="Border" x:Key="ListBorderIconStyle">
|
||||||
|
|
||||||
|
<Setter Property="Background" Value="#F7FAFA" />
|
||||||
|
<Setter Property="CornerRadius" Value="5"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="Margin" Value="10,3,10,0"/>
|
||||||
|
<Setter Property="Height" Value="30"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
|
||||||
|
|
||||||
|
<Style.Resources>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="#3D3C3C"/>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="#3D3C3C"/>
|
||||||
|
<Setter Property="SecondaryIconColor" Value="#F7FAFA"/>
|
||||||
|
</Style>
|
||||||
|
</Style.Resources>
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
346
F4SD_IconPicker/F4SDicons/ScrollViewerResources.xaml
Normal file
346
F4SD_IconPicker/F4SDicons/ScrollViewerResources.xaml
Normal file
@@ -0,0 +1,346 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<Color x:Key="WindowColor">#FFE8EDF9</Color>
|
||||||
|
<Color x:Key="ContentAreaColorLight">#FFC5CBF9</Color>
|
||||||
|
<Color x:Key="ContentAreaColorDark">#FF7381F9</Color>
|
||||||
|
|
||||||
|
<Color x:Key="DisabledControlLightColor">#FFE8EDF9</Color>
|
||||||
|
<Color x:Key="DisabledControlDarkColor">#FFC5CBF9</Color>
|
||||||
|
<Color x:Key="DisabledForegroundColor">#FF888888</Color>
|
||||||
|
|
||||||
|
<Color x:Key="SelectedBackgroundColor">#FFC5CBF9</Color>
|
||||||
|
<Color x:Key="SelectedUnfocusedColor">#FFDDDDDD</Color>
|
||||||
|
|
||||||
|
<!--<Color x:Key="ControlLightColor">#DBDBDB</Color>
|
||||||
|
<Color x:Key="ControlMediumColor">#DBDBDB</Color>
|
||||||
|
<Color x:Key="ControlDarkColor">#DBDBDB</Color>-->
|
||||||
|
|
||||||
|
<Color x:Key="ControlMouseOverColor">#FF3843C4</Color>
|
||||||
|
<Color x:Key="ControlPressedColor">#FF211AA9</Color>
|
||||||
|
|
||||||
|
<Color x:Key="GlyphColor">#FF444444</Color>
|
||||||
|
<Color x:Key="GlyphMouseOver">sc#1, 0.004391443, 0.002428215, 0.242281124</Color>
|
||||||
|
|
||||||
|
<!--Border colors-->
|
||||||
|
<Color x:Key="BorderLightColor">#FFCCCCCC</Color>
|
||||||
|
<Color x:Key="BorderMediumColor">#FF888888</Color>
|
||||||
|
<Color x:Key="BorderDarkColor">#FF444444</Color>
|
||||||
|
|
||||||
|
<Color x:Key="PressedBorderLightColor">#FF888888</Color>
|
||||||
|
<Color x:Key="PressedBorderDarkColor">#FF444444</Color>
|
||||||
|
|
||||||
|
<Color x:Key="DisabledBorderLightColor">#FFAAAAAA</Color>
|
||||||
|
<Color x:Key="DisabledBorderDarkColor">#FF888888</Color>
|
||||||
|
|
||||||
|
<Color x:Key="DefaultBorderBrushDarkColor">Black</Color>
|
||||||
|
|
||||||
|
<!--Control-specific resources.-->
|
||||||
|
<Color x:Key="HeaderTopColor">#FFC5CBF9</Color>
|
||||||
|
<Color x:Key="DatagridCurrentCellBorderColor">Black</Color>
|
||||||
|
<Color x:Key="SliderTrackDarkColor">#FFC5CBF9</Color>
|
||||||
|
|
||||||
|
<Color x:Key="NavButtonFrameColor">#FF3843C4</Color>
|
||||||
|
|
||||||
|
<LinearGradientBrush x:Key="MenuPopupBrush"
|
||||||
|
EndPoint="0.5,1"
|
||||||
|
StartPoint="0.5,0">
|
||||||
|
<GradientStop Color="{DynamicResource ControlLightColor}"
|
||||||
|
Offset="0" />
|
||||||
|
<GradientStop Color="{DynamicResource ControlMediumColor}"
|
||||||
|
Offset="0.5" />
|
||||||
|
<GradientStop Color="{DynamicResource ControlLightColor}"
|
||||||
|
Offset="1" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
|
||||||
|
<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill"
|
||||||
|
StartPoint="0,0"
|
||||||
|
EndPoint="1,0">
|
||||||
|
<LinearGradientBrush.GradientStops>
|
||||||
|
<GradientStopCollection>
|
||||||
|
<GradientStop Color="#000000FF"
|
||||||
|
Offset="0" />
|
||||||
|
<GradientStop Color="#600000FF"
|
||||||
|
Offset="0.4" />
|
||||||
|
<GradientStop Color="#600000FF"
|
||||||
|
Offset="0.6" />
|
||||||
|
<GradientStop Color="#000000FF"
|
||||||
|
Offset="1" />
|
||||||
|
</GradientStopCollection>
|
||||||
|
</LinearGradientBrush.GradientStops>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
|
||||||
|
<Style x:Key="ScrollBarLineButton"
|
||||||
|
TargetType="{x:Type RepeatButton}">
|
||||||
|
<Setter Property="SnapsToDevicePixels"
|
||||||
|
Value="True" />
|
||||||
|
<Setter Property="OverridesDefaultStyle"
|
||||||
|
Value="true" />
|
||||||
|
<Setter Property="Focusable"
|
||||||
|
Value="false" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ScrollBarPageButton"
|
||||||
|
TargetType="{x:Type RepeatButton}">
|
||||||
|
<Setter Property="SnapsToDevicePixels"
|
||||||
|
Value="True" />
|
||||||
|
<Setter Property="OverridesDefaultStyle"
|
||||||
|
Value="true" />
|
||||||
|
<Setter Property="IsTabStop"
|
||||||
|
Value="false" />
|
||||||
|
<Setter Property="Focusable"
|
||||||
|
Value="false" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||||
|
<Border Background="Transparent" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ScrollBarThumb"
|
||||||
|
TargetType="{x:Type Thumb}">
|
||||||
|
<Setter Property="SnapsToDevicePixels"
|
||||||
|
Value="True" />
|
||||||
|
<Setter Property="OverridesDefaultStyle"
|
||||||
|
Value="true" />
|
||||||
|
<Setter Property="IsTabStop"
|
||||||
|
Value="false" />
|
||||||
|
<Setter Property="Focusable"
|
||||||
|
Value="false" />
|
||||||
|
<Setter Property="Cursor"
|
||||||
|
Value="Hand"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
||||||
|
<Border CornerRadius="2"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="0" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="VerticalScrollBar"
|
||||||
|
TargetType="{x:Type ScrollBar}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition MaxHeight="0.1" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition MaxHeight="0.1" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Border Grid.RowSpan="3"
|
||||||
|
CornerRadius="2"
|
||||||
|
Background="{DynamicResource Scrollbar.Track.Color}" />
|
||||||
|
<RepeatButton Grid.Row="0"
|
||||||
|
Style="{StaticResource ScrollBarLineButton}"
|
||||||
|
Height="18"
|
||||||
|
Command="ScrollBar.LineUpCommand"
|
||||||
|
Content="M 0 4 L 8 4 L 4 0 Z" />
|
||||||
|
<Track x:Name="PART_Track"
|
||||||
|
Grid.Row="1"
|
||||||
|
IsDirectionReversed="true">
|
||||||
|
<Track.DecreaseRepeatButton>
|
||||||
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
|
||||||
|
Command="ScrollBar.PageUpCommand" />
|
||||||
|
</Track.DecreaseRepeatButton>
|
||||||
|
<Track.Thumb>
|
||||||
|
<Thumb Style="{StaticResource ScrollBarThumb}"
|
||||||
|
Margin="1,0,1,0">
|
||||||
|
<Thumb.BorderBrush>
|
||||||
|
|
||||||
|
<LinearGradientBrush StartPoint="0,0"
|
||||||
|
EndPoint="1,0">
|
||||||
|
<LinearGradientBrush.GradientStops>
|
||||||
|
<GradientStopCollection>
|
||||||
|
<GradientStop Color="{DynamicResource BorderLightColor}"
|
||||||
|
Offset="0.0" />
|
||||||
|
<GradientStop Color="{DynamicResource BorderDarkColor}"
|
||||||
|
Offset="1.0" />
|
||||||
|
</GradientStopCollection>
|
||||||
|
</LinearGradientBrush.GradientStops>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
|
||||||
|
</Thumb.BorderBrush>
|
||||||
|
<Thumb.Background>
|
||||||
|
|
||||||
|
<LinearGradientBrush StartPoint="0,0"
|
||||||
|
EndPoint="1,0">
|
||||||
|
<LinearGradientBrush.GradientStops>
|
||||||
|
<GradientStopCollection>
|
||||||
|
<GradientStop Color="{DynamicResource ControlLightColor}"
|
||||||
|
Offset="0.0" />
|
||||||
|
<GradientStop Color="{DynamicResource ControlMediumColor}"
|
||||||
|
Offset="1.0" />
|
||||||
|
</GradientStopCollection>
|
||||||
|
</LinearGradientBrush.GradientStops>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
|
||||||
|
</Thumb.Background>
|
||||||
|
</Thumb>
|
||||||
|
</Track.Thumb>
|
||||||
|
<Track.IncreaseRepeatButton>
|
||||||
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
|
||||||
|
Command="ScrollBar.PageDownCommand" />
|
||||||
|
</Track.IncreaseRepeatButton>
|
||||||
|
</Track>
|
||||||
|
<RepeatButton Grid.Row="2"
|
||||||
|
Style="{StaticResource ScrollBarLineButton}"
|
||||||
|
Height="18"
|
||||||
|
Command="ScrollBar.LineDownCommand"
|
||||||
|
Content="M 0 0 L 4 4 L 8 0 Z" />
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="HorizontalScrollBar"
|
||||||
|
TargetType="{x:Type ScrollBar}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition MaxWidth="0.1" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition MaxWidth="0.1" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Border Grid.ColumnSpan="3"
|
||||||
|
CornerRadius="2"
|
||||||
|
Background="{DynamicResource Scrollbar.Track.Color}" />
|
||||||
|
<RepeatButton Grid.Column="0"
|
||||||
|
Style="{StaticResource ScrollBarLineButton}"
|
||||||
|
Width="18"
|
||||||
|
Command="ScrollBar.LineLeftCommand"
|
||||||
|
Content="M 4 0 L 4 8 L 0 4 Z" />
|
||||||
|
<Track x:Name="PART_Track"
|
||||||
|
Grid.Column="1"
|
||||||
|
IsDirectionReversed="False">
|
||||||
|
<Track.DecreaseRepeatButton>
|
||||||
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
|
||||||
|
Command="ScrollBar.PageLeftCommand" />
|
||||||
|
</Track.DecreaseRepeatButton>
|
||||||
|
<Track.Thumb>
|
||||||
|
<Thumb Style="{StaticResource ScrollBarThumb}"
|
||||||
|
Margin="0,1,0,1">
|
||||||
|
|
||||||
|
<Thumb.BorderBrush>
|
||||||
|
|
||||||
|
<LinearGradientBrush StartPoint="0,0"
|
||||||
|
EndPoint="1,0">
|
||||||
|
<LinearGradientBrush.GradientStops>
|
||||||
|
<GradientStopCollection>
|
||||||
|
<GradientStop Color="{DynamicResource BorderLightColor}"
|
||||||
|
Offset="0.0" />
|
||||||
|
<GradientStop Color="{DynamicResource BorderDarkColor}"
|
||||||
|
Offset="1.0" />
|
||||||
|
</GradientStopCollection>
|
||||||
|
</LinearGradientBrush.GradientStops>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
|
||||||
|
</Thumb.BorderBrush>
|
||||||
|
<Thumb.Background>
|
||||||
|
|
||||||
|
<LinearGradientBrush StartPoint="0,0"
|
||||||
|
EndPoint="0,1">
|
||||||
|
<LinearGradientBrush.GradientStops>
|
||||||
|
<GradientStopCollection>
|
||||||
|
<GradientStop Color="{DynamicResource ControlLightColor}"
|
||||||
|
Offset="0.0" />
|
||||||
|
<GradientStop Color="{DynamicResource ControlMediumColor}"
|
||||||
|
Offset="1.0" />
|
||||||
|
</GradientStopCollection>
|
||||||
|
</LinearGradientBrush.GradientStops>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
|
||||||
|
</Thumb.Background>
|
||||||
|
</Thumb>
|
||||||
|
</Track.Thumb>
|
||||||
|
<Track.IncreaseRepeatButton>
|
||||||
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
|
||||||
|
Command="ScrollBar.PageRightCommand" />
|
||||||
|
</Track.IncreaseRepeatButton>
|
||||||
|
</Track>
|
||||||
|
<RepeatButton Grid.Column="2"
|
||||||
|
Style="{StaticResource ScrollBarLineButton}"
|
||||||
|
Width="18"
|
||||||
|
Command="ScrollBar.LineRightCommand"
|
||||||
|
Content="M 0 0 L 4 4 L 0 8 Z" />
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<Style x:Key="{x:Type ScrollBar}"
|
||||||
|
TargetType="{x:Type ScrollBar}">
|
||||||
|
<Setter Property="SnapsToDevicePixels"
|
||||||
|
Value="True" />
|
||||||
|
<Setter Property="OverridesDefaultStyle"
|
||||||
|
Value="true" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="Orientation"
|
||||||
|
Value="Horizontal"/>
|
||||||
|
<Condition Property="IsMouseOver"
|
||||||
|
Value="false"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
|
||||||
|
<Setter Property="Width"
|
||||||
|
Value="Auto" />
|
||||||
|
<Setter Property="Height"
|
||||||
|
Value="6" />
|
||||||
|
<Setter Property="Template"
|
||||||
|
Value="{StaticResource HorizontalScrollBar}" />
|
||||||
|
</MultiTrigger>
|
||||||
|
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="Orientation"
|
||||||
|
Value="Horizontal"/>
|
||||||
|
<Condition Property="IsMouseOver"
|
||||||
|
Value="true"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
|
||||||
|
<Setter Property="Width"
|
||||||
|
Value="Auto" />
|
||||||
|
<Setter Property="Height"
|
||||||
|
Value="10" />
|
||||||
|
<Setter Property="Margin"
|
||||||
|
Value="0 -2"/>
|
||||||
|
<Setter Property="Template"
|
||||||
|
Value="{StaticResource HorizontalScrollBar}" />
|
||||||
|
</MultiTrigger>
|
||||||
|
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="Orientation"
|
||||||
|
Value="Vertical"/>
|
||||||
|
<Condition Property="IsMouseOver"
|
||||||
|
Value="false"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
|
||||||
|
<Setter Property="Width"
|
||||||
|
Value="6" />
|
||||||
|
<Setter Property="Height"
|
||||||
|
Value="Auto" />
|
||||||
|
<Setter Property="Template"
|
||||||
|
Value="{StaticResource VerticalScrollBar}" />
|
||||||
|
</MultiTrigger>
|
||||||
|
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="Orientation"
|
||||||
|
Value="Vertical"/>
|
||||||
|
<Condition Property="IsMouseOver"
|
||||||
|
Value="true"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
|
||||||
|
<Setter Property="Width"
|
||||||
|
Value="10" />
|
||||||
|
<Setter Property="Margin"
|
||||||
|
Value="-2 0"/>
|
||||||
|
<Setter Property="Height"
|
||||||
|
Value="Auto" />
|
||||||
|
<Setter Property="Template"
|
||||||
|
Value="{StaticResource VerticalScrollBar}" />
|
||||||
|
</MultiTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
42
F4SD_IconPicker/F4SDicons/User Controls/CopyTextBox.xaml
Normal file
42
F4SD_IconPicker/F4SDicons/User Controls/CopyTextBox.xaml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<UserControl x:Class="F4SDicons.User_Controls.CopyTextBox"
|
||||||
|
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:F4SDicons.User_Controls"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
|
d:Background="Moccasin" Name="TextUserControl">
|
||||||
|
<DockPanel>
|
||||||
|
|
||||||
|
|
||||||
|
<DockPanel.Resources>
|
||||||
|
|
||||||
|
<Style TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color3D3C3C}"/>
|
||||||
|
<Setter Property="IconHeight" Value="40"/>
|
||||||
|
<Setter Property="IconWidth" Value="40"/>
|
||||||
|
<Setter Property="BorderPadding" Value="5"/>
|
||||||
|
<Setter Property="Margin" Value="10"/>
|
||||||
|
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color1F92EE}"/>
|
||||||
|
<Setter Property="IconBackgroundColor" Value="{DynamicResource colorF2F2F2}"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</DockPanel.Resources>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon DockPanel.Dock="Right" x:Name="CopyBorder" MouseLeftButtonUp="currentNameButton_Click" ToolTip="{Binding ElementName=TextUserControl, Path=ToolTipText}" SelectedMaterialIcon="ic_content_copy">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<TextBlock Name="CopyBlock" Text="{Binding ElementName=TextUserControl, Path=TextContent}" Foreground="{DynamicResource color3D3C3C}" FontFamily="Calibri Light" TextWrapping="Wrap" Height="45" FontSize="14" Background="{DynamicResource colorF7FAFA}" Margin="10,0,0,0">
|
||||||
|
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
</DockPanel>
|
||||||
|
</UserControl>
|
||||||
87
F4SD_IconPicker/F4SDicons/User Controls/CopyTextBox.xaml.cs
Normal file
87
F4SD_IconPicker/F4SDicons/User Controls/CopyTextBox.xaml.cs
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
using FasdDesktopUi.Basics.UserControls.AdaptableIcon;
|
||||||
|
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 F4SDicons.User_Controls
|
||||||
|
{
|
||||||
|
public partial class CopyTextBox : UserControl
|
||||||
|
{
|
||||||
|
public CopyTextBox()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Dependency Properties
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public string TextContent
|
||||||
|
{
|
||||||
|
get { return (string)GetValue(TextContentProperty); }
|
||||||
|
set { SetValue(TextContentProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a DependencyProperty as the backing store for TextContent. This enables animation, styling, binding, etc...
|
||||||
|
public static readonly DependencyProperty TextContentProperty =
|
||||||
|
DependencyProperty.Register("TextContent", typeof(string), typeof(CopyTextBox), new PropertyMetadata(""));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public string ToolTipText
|
||||||
|
{
|
||||||
|
get { return (string)GetValue(ToolTipTextProperty); }
|
||||||
|
set { SetValue(ToolTipTextProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a DependencyProperty as the backing store for ToolTipText. This enables animation, styling, binding, etc...
|
||||||
|
public static readonly DependencyProperty ToolTipTextProperty =
|
||||||
|
DependencyProperty.Register("ToolTipText", typeof(string), typeof(CopyTextBox), new PropertyMetadata(""));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Klick Event
|
||||||
|
|
||||||
|
private void currentNameButton_Click(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
System.Windows.Clipboard.SetText(CopyBlock.Text);
|
||||||
|
|
||||||
|
if (!(sender is AdaptableIcon senderIcon) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dispatcher.Invoke(async ()=>
|
||||||
|
{
|
||||||
|
var currentMaterialIcon = senderIcon.SelectedMaterialIcon;
|
||||||
|
|
||||||
|
senderIcon.SelectedMaterialIcon = null;
|
||||||
|
senderIcon.SelectedInternIcon = F4SD_AdaptableIcon.Enums.enumInternIcons.misc_check;
|
||||||
|
Color ColorGreen = (Color)ColorConverter.ConvertFromString("#75B159");
|
||||||
|
senderIcon.PrimaryIconColor = new SolidColorBrush(ColorGreen);
|
||||||
|
await Task.Delay(500);
|
||||||
|
senderIcon.SelectedInternIcon = null;
|
||||||
|
senderIcon.SelectedMaterialIcon = currentMaterialIcon;
|
||||||
|
senderIcon.ClearValue(AdaptableIcon.PrimaryIconColorProperty);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
35
F4SD_IconPicker/F4SDicons/User Controls/IconGrid.xaml
Normal file
35
F4SD_IconPicker/F4SDicons/User Controls/IconGrid.xaml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<UserControl x:Class="F4SDicons.User_Controls.IconGrid"
|
||||||
|
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:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
xmlns:local="clr-namespace:F4SDicons.User_Controls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
|
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||||
|
|
||||||
|
<UserControl.Resources>
|
||||||
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibility"/>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
<StackPanel x:Name="GridCollection">
|
||||||
|
|
||||||
|
<ItemsControl ItemsSource="{Binding IconInformation}">
|
||||||
|
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel/>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="adaptableIcon" ToolTip="{Binding IconName}" Tag="{Binding IconName}" SelectedInternIcon="{Binding InternIcon}" SelectedMaterialIcon="{Binding MaterialIcon}" MouseLeftButtonUp="adaptableIcon_MouseLeftButtonUp" TouchDown="adaptableIcon_TouchDown" Visibility="{Binding IsVisible, Converter = {StaticResource BooleanToVisibility}}" Style="{DynamicResource GridIconStyle}"/>
|
||||||
|
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</UserControl>
|
||||||
103
F4SD_IconPicker/F4SDicons/User Controls/IconGrid.xaml.cs
Normal file
103
F4SD_IconPicker/F4SDicons/User Controls/IconGrid.xaml.cs
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
using F4SD_AdaptableIcon.Enums;
|
||||||
|
using F4SDicons.Models;
|
||||||
|
using FasdDesktopUi.Basics.UserControls.AdaptableIcon;
|
||||||
|
using MaterialIcons;
|
||||||
|
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;
|
||||||
|
using static FasdDesktopUi.Basics.UserControls.AdaptableIcon.cIconPainter;
|
||||||
|
|
||||||
|
namespace F4SDicons.User_Controls
|
||||||
|
{
|
||||||
|
public partial class IconGrid : UserControl
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<cAdvancedIconInformation> IconInformation
|
||||||
|
{
|
||||||
|
get { return (List<cAdvancedIconInformation>)GetValue(IconInformationProperty); }
|
||||||
|
set { SetValue(IconInformationProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a DependencyProperty as the backing store for IconInformation. This enables animation, styling, binding, etc...
|
||||||
|
public static readonly DependencyProperty IconInformationProperty =
|
||||||
|
DependencyProperty.Register("IconInformation", typeof(List<cAdvancedIconInformation>), typeof(IconGrid), new PropertyMetadata(null));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public IconGrid()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region Klick Event
|
||||||
|
|
||||||
|
#region Event
|
||||||
|
|
||||||
|
public event RoutedEventHandler IconSelected
|
||||||
|
{
|
||||||
|
|
||||||
|
add { AddHandler(IconCollectionUserControl.IconSelectedEvent, value); }
|
||||||
|
remove { RemoveHandler(IconCollectionUserControl.IconSelectedEvent, value); }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Klick
|
||||||
|
|
||||||
|
private void adaptableIcon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
MaterialIconWasClicked(sender);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void adaptableIcon_TouchDown(object sender, TouchEventArgs e)
|
||||||
|
{
|
||||||
|
MaterialIconWasClicked(sender);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region On Klick
|
||||||
|
|
||||||
|
private void MaterialIconWasClicked(object sender)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!(sender is FrameworkElement frameworkElement))
|
||||||
|
return;
|
||||||
|
|
||||||
|
enumIconTypes? iconType = null;
|
||||||
|
|
||||||
|
if (Enum.TryParse(frameworkElement.Tag.ToString(), out MaterialIconType _))
|
||||||
|
iconType = enumIconTypes.material;
|
||||||
|
else if (Enum.TryParse(frameworkElement.Tag.ToString(), out enumInternIcons _))
|
||||||
|
iconType = enumIconTypes.intern;
|
||||||
|
|
||||||
|
if (iconType is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
RoutedEventArgsIconInfo eventArgs = new RoutedEventArgsIconInfo(IconCollectionUserControl.IconSelectedEvent) { IconName = frameworkElement.Tag.ToString(), IconType = iconType.Value };
|
||||||
|
RaiseEvent(eventArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
34
F4SD_IconPicker/F4SDicons/User Controls/IconList.xaml
Normal file
34
F4SD_IconPicker/F4SDicons/User Controls/IconList.xaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<UserControl x:Class="F4SDicons.User_Controls.IconList"
|
||||||
|
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:F4SDicons.User_Controls"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
|
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||||
|
|
||||||
|
<UserControl.Resources>
|
||||||
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibility"/>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
<StackPanel x:Name="collectionStackPanel">
|
||||||
|
|
||||||
|
<ItemsControl ItemsSource="{Binding IconInformation}">
|
||||||
|
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border x:Name="adaptableBorder" MouseLeftButtonUp="MaterialStackPanel_MouseLeftButtonUp" TouchDown="MaterialStackPanel_TouchDown" ToolTip="{Binding IconName}" Tag="{Binding IconName}" Visibility="{Binding IsVisible, Converter = {StaticResource BooleanToVisibility}}" Style="{DynamicResource ListBorderIconStyle}">
|
||||||
|
<StackPanel x:Name="adaptableStackPanel" Orientation="Horizontal">
|
||||||
|
<ico:AdaptableIcon Margin="0, 0, 10, 0" BorderPadding="2.5" IconHeight="25" IconWidth="25" SelectedInternIcon="{Binding InternIcon}" SelectedMaterialIcon="{Binding MaterialIcon}"/>
|
||||||
|
<Border x:Name="scrollBorder">
|
||||||
|
<TextBlock x:Name="adaptableBlock" FontFamily="Calibri Regular" FontSize="18" Text="{Binding IconName}"/>
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</StackPanel>
|
||||||
|
</UserControl>
|
||||||
92
F4SD_IconPicker/F4SDicons/User Controls/IconList.xaml.cs
Normal file
92
F4SD_IconPicker/F4SDicons/User Controls/IconList.xaml.cs
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
using F4SD_AdaptableIcon.Enums;
|
||||||
|
using F4SDicons.Models;
|
||||||
|
using FasdDesktopUi.Basics.UserControls.AdaptableIcon;
|
||||||
|
using MaterialIcons;
|
||||||
|
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;
|
||||||
|
using static FasdDesktopUi.Basics.UserControls.AdaptableIcon.cIconPainter;
|
||||||
|
|
||||||
|
namespace F4SDicons.User_Controls
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class IconList : UserControl
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<cAdvancedIconInformation> IconInformation
|
||||||
|
{
|
||||||
|
get { return (List<cAdvancedIconInformation>)GetValue(IconInformationProperty); }
|
||||||
|
set { SetValue(IconInformationProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a DependencyProperty as the backing store for IconInformation. This enables animation, styling, binding, etc...
|
||||||
|
public static readonly DependencyProperty IconInformationProperty =
|
||||||
|
DependencyProperty.Register("IconInformation", typeof(List<cAdvancedIconInformation>), typeof(IconList), new PropertyMetadata(null));
|
||||||
|
|
||||||
|
|
||||||
|
public IconList()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Klick
|
||||||
|
|
||||||
|
private void MaterialStackPanel_TouchDown(object sender, TouchEventArgs e)
|
||||||
|
{
|
||||||
|
MaterialStackPanelWasClicked(sender);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MaterialStackPanel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
MaterialStackPanelWasClicked(sender);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Event
|
||||||
|
|
||||||
|
public event RoutedEventHandler IconSelected
|
||||||
|
{
|
||||||
|
|
||||||
|
add { AddHandler(IconCollectionUserControl.IconSelectedEvent, value); }
|
||||||
|
remove { RemoveHandler(IconCollectionUserControl.IconSelectedEvent, value); }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private void MaterialStackPanelWasClicked(object sender)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!(sender is FrameworkElement frameworkElement))
|
||||||
|
return;
|
||||||
|
|
||||||
|
enumIconTypes? iconType = null;
|
||||||
|
|
||||||
|
if (Enum.TryParse(frameworkElement.Tag.ToString(), out MaterialIconType _))
|
||||||
|
iconType = enumIconTypes.material;
|
||||||
|
else if (Enum.TryParse(frameworkElement.Tag.ToString(), out enumInternIcons _))
|
||||||
|
iconType = enumIconTypes.intern;
|
||||||
|
|
||||||
|
if (iconType is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
RoutedEventArgsIconInfo eventArgs = new RoutedEventArgsIconInfo(IconCollectionUserControl.IconSelectedEvent) { IconName = frameworkElement.Tag.ToString(), IconType = iconType.Value };
|
||||||
|
RaiseEvent(eventArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
54
F4SD_IconPicker/F4SDicons/User Controls/SearchBar.xaml
Normal file
54
F4SD_IconPicker/F4SDicons/User Controls/SearchBar.xaml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<UserControl x:Class="F4SDicons.User_Controls.SearchBar"
|
||||||
|
x:Name="_this"
|
||||||
|
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:F4SDicons.User_Controls"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="100" d:DesignWidth="500">
|
||||||
|
<Border Grid.Row="0" Background="{DynamicResource colorF7FAFA}" CornerRadius="17.5" VerticalAlignment="Center" Margin="10,0,15,5" Height="35">
|
||||||
|
|
||||||
|
<Border.Resources>
|
||||||
|
<Style TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color3D3C3C}"/>
|
||||||
|
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color1F92EE}"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Border.Resources>
|
||||||
|
|
||||||
|
<Grid VerticalAlignment="Center">
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="10"/>
|
||||||
|
<ColumnDefinition Width="20"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="20"/>
|
||||||
|
<ColumnDefinition Width="10"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Column="1" x:Name="SearchIcon" BorderPadding="0" IconHeight="20" IconWidth="20" SelectedInternIcon="menuBar_search">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<TextBlock Grid.Column="2" Name="previewTextBlock" Foreground="{DynamicResource color3D3C3C}" Background="Transparent" VerticalAlignment="Center" Margin="10,0,0,0">
|
||||||
|
Suchbegriff eingeben...
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
<TextBox Name="bindingTextBox" Grid.Column="2" Foreground="{DynamicResource color3D3C3C}" Background="Transparent" BorderThickness="0" VerticalAlignment="Center" GotFocus="TextBoxGotFocus" LostFocus="TextBoxLostFocus" Margin="10,0,0,0"
|
||||||
|
Text = "{Binding SearchValue, Mode = OneWayToSource, UpdateSourceTrigger = PropertyChanged}" Grid.ColumnSpan="2">
|
||||||
|
|
||||||
|
</TextBox>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Column="3" x:Name="clearSearchIcon" BorderPadding="0" IconHeight="12" IconWidth="12" MouseLeftButtonUp="ClearSearchButtonUp" Cursor="Hand" ToolTip="Eingabe löschen" SelectedInternIcon="window_close">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</UserControl>
|
||||||
57
F4SD_IconPicker/F4SDicons/User Controls/SearchBar.xaml.cs
Normal file
57
F4SD_IconPicker/F4SDicons/User Controls/SearchBar.xaml.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
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 F4SDicons.User_Controls
|
||||||
|
{
|
||||||
|
public partial class SearchBar : UserControl
|
||||||
|
{
|
||||||
|
public SearchBar()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Default Suchtext
|
||||||
|
|
||||||
|
private void TextBoxGotFocus(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//previewTextBlock.Text = "";
|
||||||
|
previewTextBlock.Visibility = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TextBoxLostFocus(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (bindingTextBox.Text == "")
|
||||||
|
{
|
||||||
|
//previewTextBlock.Text = "Suchbegriff eingeben...";
|
||||||
|
previewTextBlock.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region TextBox
|
||||||
|
|
||||||
|
private void ClearSearchButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
bindingTextBox.Text = String.Empty;
|
||||||
|
FocusManager.SetFocusedElement(FocusManager.GetFocusScope(bindingTextBox), null);
|
||||||
|
Keyboard.ClearFocus();
|
||||||
|
TextBoxLostFocus(null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
80
F4SD_IconPicker/F4SDicons/User Controls/WindowStateBar.xaml
Normal file
80
F4SD_IconPicker/F4SDicons/User Controls/WindowStateBar.xaml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<UserControl x:Class="F4SDicons.User_Controls.WindowStateBar"
|
||||||
|
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:F4SDicons.User_Controls"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="60" d:DesignWidth="215"
|
||||||
|
Name="StateBar">
|
||||||
|
|
||||||
|
<!-- TODO: WindowChrome-->
|
||||||
|
|
||||||
|
<Grid Grid.Row="0" Name="StateGrid" Margin="0,10,0,0" Background="{DynamicResource colorE9E9E9}">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="40"/>
|
||||||
|
<ColumnDefinition Width="40"/>
|
||||||
|
<ColumnDefinition Width="40"/>
|
||||||
|
<ColumnDefinition Width="40"/>
|
||||||
|
<ColumnDefinition Width="40"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid.Resources>
|
||||||
|
|
||||||
|
<Style TargetType="Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource colorE9E9E9}"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
<Setter Property="CornerRadius" Value="5"/>
|
||||||
|
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource colorF2F2F2}"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color3D3C3C}"/>
|
||||||
|
<Setter Property="IconHeight" Value="35"/>
|
||||||
|
<Setter Property="IconWidth" Value="35"/>
|
||||||
|
<Setter Property="BorderPadding" Value="5"/>
|
||||||
|
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource color1F92EE}"/>
|
||||||
|
<Setter Property="IconBackgroundColor" Value="{DynamicResource colorF2F2F2}"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</Grid.Resources>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon MouseLeftButtonUp="WindowToTopLeftCorner" Grid.Column="0" ToolTip="Fenster links anheften" SelectedInternIcon="window_dock_left">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon MouseLeftButtonUp="WindowToTopRightCorner" Grid.Column="1" ToolTip="Fenster rechts anheften" SelectedInternIcon="window_dock_right">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="minimizeIcon" Grid.Column="2" MouseLeftButtonUp="minimizeWindow_ButtonUp" ToolTip="Anwendung minimieren" SelectedInternIcon="window_minimize">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="resizeIcon" Grid.Column="3" ToolTip="Anwendung ist bereits im Fenster-Modus" PrimaryIconColor="{DynamicResource color9A9B9B}" SelectedInternIcon="window_fullscreenExit">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="resizeIcon2" Grid.Column="3" Visibility="Collapsed" MouseLeftButtonUp="resizeWindow2_ButtonUp" ToolTip="Fenster verkleinern" SelectedInternIcon="window_fullscreenExit">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="closeIcon" Grid.Column="4" MouseLeftButtonUp="closeWindow_ButtonUp" ToolTip="Anwendung beenden" SelectedInternIcon="window_close">
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
166
F4SD_IconPicker/F4SDicons/User Controls/WindowStateBar.xaml.cs
Normal file
166
F4SD_IconPicker/F4SDicons/User Controls/WindowStateBar.xaml.cs
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
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 F4SDicons.User_Controls
|
||||||
|
{
|
||||||
|
public partial class WindowStateBar : UserControl
|
||||||
|
{
|
||||||
|
public WindowStateBar()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool isWindowRight = false;
|
||||||
|
|
||||||
|
#region DockWindow
|
||||||
|
|
||||||
|
//TopLeft Position of Screen
|
||||||
|
public static void TopLeftCorner(System.Windows.Window window)
|
||||||
|
{
|
||||||
|
var screen = System.Windows.Forms.Screen.FromPoint(new System.Drawing.Point((int)window.Left, (int)window.Top));
|
||||||
|
|
||||||
|
window.Top = screen.WorkingArea.Top;
|
||||||
|
window.Left = screen.WorkingArea.Left;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//TopRight Position of Screen
|
||||||
|
public static void TopRightCorner(System.Windows.Window window)
|
||||||
|
{
|
||||||
|
var screen = System.Windows.Forms.Screen.FromPoint(new System.Drawing.Point((int)window.Left, (int)window.Top));
|
||||||
|
|
||||||
|
window.Top = screen.WorkingArea.Top;
|
||||||
|
window.Left = screen.WorkingArea.Left + window.ActualWidth + window.ActualWidth;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void TopRightCorner2(System.Windows.Window window)
|
||||||
|
{
|
||||||
|
var screen = System.Windows.Forms.Screen.FromPoint(new System.Drawing.Point((int)window.Left, (int)window.Top));
|
||||||
|
|
||||||
|
window.Top = screen.WorkingArea.Top;
|
||||||
|
window.Left = screen.WorkingArea.Right - window.ActualWidth;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void WindowToTopLeftCorner(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
resizeWindow();
|
||||||
|
|
||||||
|
TopLeftCorner(Window.GetWindow(this));
|
||||||
|
isWindowRight = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void WindowToTopRightCorner(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
resizeWindow();
|
||||||
|
|
||||||
|
TopLeftCorner(Window.GetWindow(this));
|
||||||
|
isWindowRight = false;
|
||||||
|
|
||||||
|
TopRightCorner(Window.GetWindow(this));
|
||||||
|
isWindowRight = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Minimize
|
||||||
|
|
||||||
|
//Minimize Window
|
||||||
|
private void minimizeWindow_ButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
Window.GetWindow(this).WindowState = WindowState.Minimized;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Resize
|
||||||
|
|
||||||
|
//Resize Window
|
||||||
|
private void resizeWindow2_ButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
resizeWindow2();
|
||||||
|
|
||||||
|
if (isWindowRight == false)
|
||||||
|
{
|
||||||
|
TopLeftCorner(Window.GetWindow(this));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TopRightCorner2(Window.GetWindow(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
resizeIcon.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
resizeIcon2.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resizeWindow()
|
||||||
|
{
|
||||||
|
Rect rectangle = GetCurrentScreenWorkArea(Window.GetWindow(this));
|
||||||
|
double wHeight = rectangle.Height;
|
||||||
|
double wWidth = rectangle.Width;
|
||||||
|
wWidth = wWidth / 3;
|
||||||
|
Window.GetWindow(this).Height = wHeight;
|
||||||
|
Window.GetWindow(this).Width = wWidth;
|
||||||
|
|
||||||
|
resizeIcon2.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
resizeIcon.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resizeWindow2()
|
||||||
|
{
|
||||||
|
Window.GetWindow(this).Height = 600;
|
||||||
|
Window.GetWindow(this).Width = 880;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Display
|
||||||
|
|
||||||
|
public static Rect GetCurrentScreenWorkArea(System.Windows.Window window)
|
||||||
|
{
|
||||||
|
var screen = System.Windows.Forms.Screen.FromPoint(new System.Drawing.Point((int)window.Left, (int)window.Top));
|
||||||
|
var dpiScale = VisualTreeHelper.GetDpi(window);
|
||||||
|
|
||||||
|
return new Rect { Width = screen.WorkingArea.Width / dpiScale.DpiScaleX, Height = screen.WorkingArea.Height / dpiScale.DpiScaleY };
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Close Window
|
||||||
|
|
||||||
|
private void closeWindow_ButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
Window.GetWindow(this).Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Drag Move
|
||||||
|
|
||||||
|
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
Window.GetWindow(this).DragMove();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
29
F4SD_IconPicker/F4SDicons/User Controls/ZoomViewer.xaml
Normal file
29
F4SD_IconPicker/F4SDicons/User Controls/ZoomViewer.xaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<UserControl x:Class="F4SDicons.User_Controls.ZoomViewer"
|
||||||
|
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:F4SDicons.User_Controls"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="450">
|
||||||
|
<Grid Name="currentIconGrid" Background="{DynamicResource colorE9E9E9}">
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="30"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon Grid.Row="0" x:Name="currentIcon" PrimaryIconColor="{DynamicResource color3D3C3C}" SecondaryIconColor="{DynamicResource colorF7FAFA}" IconHeight="100" IconWidth="100" Grid.RowSpan="2" RenderTransformOrigin="0.5, 0.5" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||||
|
<ico:AdaptableIcon.RenderTransform>
|
||||||
|
<RotateTransform/>
|
||||||
|
</ico:AdaptableIcon.RenderTransform>
|
||||||
|
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<Slider Name="ZoomSlider" Grid.Row="1" Width="250" Minimum="50" Maximum="200" PreviewMouseLeftButtonUp="ZoomSlider_ButtonUp" PreviewMouseLeftButtonDown="ZoomSlider_ButtonUp" ValueChanged="Slider_ValueChanged" Value="100">
|
||||||
|
|
||||||
|
</Slider>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
84
F4SD_IconPicker/F4SDicons/User Controls/ZoomViewer.xaml.cs
Normal file
84
F4SD_IconPicker/F4SDicons/User Controls/ZoomViewer.xaml.cs
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
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.Animation;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace F4SDicons.User_Controls
|
||||||
|
{
|
||||||
|
public partial class ZoomViewer : UserControl
|
||||||
|
{
|
||||||
|
public ZoomViewer()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Variables
|
||||||
|
|
||||||
|
bool zoomReachedMinimum = false;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Value
|
||||||
|
|
||||||
|
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||||
|
{
|
||||||
|
double iconZoom = e.NewValue / 100;
|
||||||
|
currentIcon.IconHeight = 100 * iconZoom;
|
||||||
|
currentIcon.IconWidth = 100 * iconZoom;
|
||||||
|
|
||||||
|
if (iconZoom == 0.5)
|
||||||
|
{
|
||||||
|
zoomReachedMinimum = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zoomReachedMinimum == true && iconZoom == 2.0)
|
||||||
|
{
|
||||||
|
RotateEasterEgg();
|
||||||
|
zoomReachedMinimum = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region RotateIcon
|
||||||
|
|
||||||
|
private void RotateEasterEgg()
|
||||||
|
{
|
||||||
|
Storyboard storyboard = new Storyboard();
|
||||||
|
|
||||||
|
DoubleAnimation animation = new DoubleAnimation();
|
||||||
|
animation.From = 0;
|
||||||
|
animation.To = 360;
|
||||||
|
animation.Duration = new Duration(TimeSpan.FromSeconds(1));
|
||||||
|
storyboard.Children.Add(animation);
|
||||||
|
|
||||||
|
|
||||||
|
Storyboard.SetTarget(animation, currentIcon);
|
||||||
|
Storyboard.SetTargetProperty(animation, new PropertyPath("(Control.RenderTransform).(RotateTransform.Angle)"));
|
||||||
|
|
||||||
|
storyboard.Begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ZoomSlider_ButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
zoomReachedMinimum = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user