5 Commits

Author SHA1 Message Date
Emmanuele Sassi 97c2466628 - aggiornato stile finestra copia multipla
- aggiornata versione
2025-08-06 11:09:52 +02:00
Emmanuele Sassi 6deabc6be5 - aggiunti EgtInterface e Language
- modificata finestra Copia Multipla
2025-07-08 16:21:01 +02:00
Emmanuele Sassi bdcda23197 - modifiche a finestra e data 2025-06-12 20:04:21 +02:00
Emmanuele Sassi dcaef9eaa9 - aggiunta EffectorWindow con TitleBar
- Utilizzata EffectorWindow per MultipleCopyWnd
- Utilizzata BaseWindow per ProcessManagerV
- aggiunto titolo a TitleBar
- aggiunto modulo Converters
2025-02-26 15:01:11 +01:00
Emmanuele Sassi 54e2f27a44 - added EffectorWindow 2025-02-17 22:52:59 +01:00
16 changed files with 716 additions and 103 deletions
@@ -47,6 +47,9 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup /> <PropertyGroup />
<ItemGroup> <ItemGroup>
<Reference Include="EgwWPFBaseLib">
<HintPath>..\..\..\EgwWPFBaseLib\EgwWPFBaseLib\bin\Debug\EgwWPFBaseLib.dll</HintPath>
</Reference>
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
@@ -84,7 +87,7 @@
<Compile Include="Constants\ConstGen.vb" /> <Compile Include="Constants\ConstGen.vb" />
<Compile Include="Constants\ConstIni.vb" /> <Compile Include="Constants\ConstIni.vb" />
<Compile Include="Constants\PluginConstIni.vb" /> <Compile Include="Constants\PluginConstIni.vb" />
<Compile Include="EgtWindow\EgtWindow.vb" /> <Compile Include="EffectorWindow\EffectorWindow.vb" />
<Compile Include="MultipleCopyWnd\MultipleCopyWndV.xaml.vb"> <Compile Include="MultipleCopyWnd\MultipleCopyWndV.xaml.vb">
<DependentUpon>MultipleCopyWndV.xaml</DependentUpon> <DependentUpon>MultipleCopyWndV.xaml</DependentUpon>
</Compile> </Compile>
@@ -110,10 +113,13 @@
<DependentUpon>TitleBarV.xaml</DependentUpon> <DependentUpon>TitleBarV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Utility\Command.vb" /> <Compile Include="Utility\Command.vb" />
<Compile Include="Utility\Converters.vb" />
<Compile Include="Utility\EgtInterface.vb" />
<Compile Include="Utility\ExecProcessManager.vb" /> <Compile Include="Utility\ExecProcessManager.vb" />
<Compile Include="Utility\GenInterface.vb" /> <Compile Include="Utility\GenInterface.vb" />
<Compile Include="Utility\IdNameStruct.vb" /> <Compile Include="Utility\IdNameStruct.vb" />
<Compile Include="Utility\IniFile.vb" /> <Compile Include="Utility\IniFile.vb" />
<Compile Include="Utility\Language.vb" />
<Compile Include="Utility\PluginIniFile.vb" /> <Compile Include="Utility\PluginIniFile.vb" />
<Compile Include="Utility\StringConversion.vb" /> <Compile Include="Utility\StringConversion.vb" />
<Compile Include="Utility\ThreadData.vb" /> <Compile Include="Utility\ThreadData.vb" />
@@ -154,6 +160,7 @@
<Resource Include="Resources\Effector.ico" /> <Resource Include="Resources\Effector.ico" />
<Resource Include="Resources\EgalwareLogo.png" /> <Resource Include="Resources\EgalwareLogo.png" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>copy $(TargetPath) c:\EgtData\Effector\Plugin\Effector.Plugin.DoorArreda\Effector.Plugin.Lib.dll <PostBuildEvent>copy $(TargetPath) c:\EgtData\Effector\Plugin\Effector.Plugin.DoorArreda\Effector.Plugin.Lib.dll
@@ -0,0 +1,42 @@
' Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
'
' Step 1a) Using this custom control in a XAML file that exists in the current project.
' Add this XmlNamespace attribute to the root element of the markup file where it is
' to be used:
'
' xmlns:MyNamespace="clr-namespace:Effector.Plugin.Lib"
'
'
' Step 1b) Using this custom control in a XAML file that exists in a different project.
' Add this XmlNamespace attribute to the root element of the markup file where it is
' to be used:
'
' xmlns:MyNamespace="clr-namespace:Effector.Plugin.Lib;assembly=Effector.Plugin.Lib"
'
' You will also need to add a project reference from the project where the XAML file lives
' to this project and Rebuild to avoid compilation errors:
'
' Right click on the target project in the Solution Explorer and
' "Add Reference"->"Projects"->[Browse to and select this project]
'
'
' Step 2)
' Go ahead and use your control in the XAML file. Note that Intellisense in the
' XML editor does not currently work on custom controls and its child elements.
'
' <MyNamespace:EffectorWindow/>
'
Imports System.Windows.Controls.Primitives
Imports EgwWPFBaseLib
Public Class EffectorWindow
Inherits EgwWPFBaseLib.EgtWindow
Shared Sub New()
'This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
'This style is defined in themes\generic.xaml
DefaultStyleKeyProperty.OverrideMetadata(GetType(EffectorWindow), new FrameworkPropertyMetadata(GetType(EffectorWindow)))
End Sub
End Class
@@ -0,0 +1,8 @@
<EgwWPFBaseLib:EgtWindow x:Class="EffectorWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"
xmlns:local="clr-namespace:Effector.Plugin.Lib"
TitleBarHeight="40"
Style="{StaticResource Effector_Window}">
</EgwWPFBaseLib:EgtWindow>
@@ -0,0 +1,3 @@
Public Class EffectorWindowV
End Class
@@ -1,50 +1,57 @@
<local:EgtWindow x:Class="MultipleCopyWndV" <local:EffectorWindow x:Class="MultipleCopyWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Effector.Plugin.Lib" xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"
TitleBarHeight="30" xmlns:local="clr-namespace:Effector.Plugin.Lib"
WindowStartupLocation="CenterOwner" TitleBarHeight="40"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
SizeToContent="WidthAndHeight"> ShowInTaskbar="False"
SizeToContent="WidthAndHeight"
Title="{Binding sTitle}"
MinWidth="300"
Style="{StaticResource EffectorWindow.Dialog.NoClose}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type local:EgtWindow}}}"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<local:TitleBar/>
<Grid Grid.Row="1" <Grid Grid.Row="1"
Margin="5"> Margin="30,10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid Margin="0,0,0,5"> <Grid Margin="0,10,0,20">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="Numero di copie" <TextBlock Text="{Binding sCopyNumberMsg}"
Margin="0,0,2.5,0"/> Margin="0,0,5,0"
Style="{StaticResource TextBlock.MultipleCopy}"/>
<TextBox Grid.Column="1" <TextBox Grid.Column="1"
Text="{Binding sCopyNumber}" Text="{Binding sCopyNumber}"
Width="40" Width="40"
Margin="2.5,0,0,0"/> HorizontalAlignment="Right"
Margin="5,0,0,0"
Style="{StaticResource TextBox.MultipleCopy}"/>
</Grid> </Grid>
<Grid Grid.Row="1"> <Grid Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Content="Ok" <Button Content="{Binding sOkMsg}"
Command="{Binding Ok_Command}" Command="{Binding Ok_Command}"
Margin="0,0,2.5,0"/> Margin="0,0,5,0"
Style="{StaticResource Button.Confirm}"/>
<Button Grid.Column="1" <Button Grid.Column="1"
Content="Annulla" Content="{Binding sCancelMsg}"
Command="{Binding Cancel_Command}" Command="{Binding Cancel_Command}"
Margin="2.5,0,0,0"/> Margin="5,0,0,0"
Style="{StaticResource Button.Confirm}"/>
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
</local:EgtWindow> </local:EffectorWindow>
@@ -3,6 +3,12 @@
Friend Event m_CloseWindow(bDialogResult As Boolean) Friend Event m_CloseWindow(bDialogResult As Boolean)
Public ReadOnly Property sTitle As String
Get
Return EgtMsg(1101)
End Get
End Property
Private m_nCopyNumber As Integer Private m_nCopyNumber As Integer
Public ReadOnly Property nCopyNumber As Integer Public ReadOnly Property nCopyNumber As Integer
Get Get
@@ -15,12 +21,34 @@
End Get End Get
Set(value As String) Set(value As String)
If Not Integer.TryParse(value, m_nCopyNumber) Then If Not Integer.TryParse(value, m_nCopyNumber) Then
MessageBox.Show("Valore non impostabile come quantita' di porte!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error) MessageBox.Show(EgtMsg(1103), EgtMsg(1051), MessageBoxButton.OK, MessageBoxImage.Error)
NotifyPropertyChanged(sCopyNumber) NotifyPropertyChanged(sCopyNumber)
End If End If
End Set End Set
End Property End Property
#Region "Messages"
Public ReadOnly Property sCopyNumberMsg As String
Get
Return EgtMsg(1102)
End Get
End Property
Public ReadOnly Property sOkMsg As String
Get
Return EgtMsg(1001)
End Get
End Property
Public ReadOnly Property sCancelMsg As String
Get
Return EgtMsg(1002)
End Get
End Property
#End Region ' Messages
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand Private m_cmdCancel As ICommand
@@ -13,9 +13,9 @@ Imports System.Windows
<Assembly: AssemblyTitle("Effector.Plugin.Lib")> <Assembly: AssemblyTitle("Effector.Plugin.Lib")>
<Assembly: AssemblyDescription("")> <Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Windows User")> <Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("Effector.Plugin.Lib")> <Assembly: AssemblyProduct("Effector.Plugin.Lib")>
<Assembly: AssemblyCopyright("Copyright @ Windows User 2025")> <Assembly: AssemblyCopyright("Copyright @ 2024-2025 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)> <Assembly: ComVisible(false)>
@@ -52,5 +52,5 @@ Imports System.Windows
' Revision ' Revision
' '
<Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyVersion("2.7.8.1")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("2.7.8.1")>
@@ -1,14 +1,15 @@
<local:EgtWindow x:Class="ProcessManagerV" <EgwWPFBaseLib:EgtWindow x:Class="ProcessManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Effector.Plugin.Lib" xmlns:local="clr-namespace:Effector.Plugin.Lib"
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"
TitleBarHeight="30" TitleBarHeight="30"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
ShowInTaskbar="False" ShowInTaskbar="False"
SizeToContent="WidthAndHeight"> SizeToContent="WidthAndHeight">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type local:EgtWindow}}}"/> <RowDefinition Height="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type EgwWPFBaseLib:EgtWindow}}}"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<local:TitleBar/> <local:TitleBar/>
@@ -64,4 +65,4 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
</local:EgtWindow> </EgwWPFBaseLib:EgtWindow>
+405 -36
View File
@@ -1,56 +1,425 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:Effector.Plugin.Lib"> xmlns:local="clr-namespace:Effector.Plugin.Lib"
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib">
<local:CaptionHeightConverter x:Key="CaptionHeightConverter"/> <EgwWPFBaseLib:CaptionHeightConverter x:Key="CaptionHeightConverter"/>
<Style TargetType="{x:Type local:EgtWindow}" BasedOn="{StaticResource {x:Type Window}}"> <!--#region COLORS -->
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value> <!--#e8eef5-->
<WindowChrome CaptionHeight="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type local:EgtWindow}}}" <Color x:Key="Effector_LightBlue_Color" R="232" G="238" B="245" A="255"/>
GlassFrameThickness="0" <SolidColorBrush x:Key="Effector_LightBlue" Color="{StaticResource Effector_LightBlue_Color}" />
CornerRadius="0" <!--#afc5d6-->
ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}"/> <Color x:Key="Effector_Blue_Color" R="175" G="197" B="214" A="255"/>
</Setter.Value> <SolidColorBrush x:Key="Effector_Blue" Color="{StaticResource Effector_Blue_Color}" />
</Setter> <!--#749fc4-->
<Color x:Key="Effector_DarkBlue_Color" R="116" G="159" B="196" A="255"/>
<SolidColorBrush x:Key="Effector_DarkBlue" Color="{StaticResource Effector_DarkBlue_Color}" />
<!--#92bde3-->
<Color x:Key="Effector_LightBlue_Status_Color" R="146" G="189" B="227" A="255"/>
<SolidColorBrush x:Key="Effector_LightBlue_Status" Color="{StaticResource Effector_LightBlue_Status_Color}" />
<!--#5682a6-->
<Color x:Key="Effector_Blue_Status_Color" R="86" G="130" B="166" A="255"/>
<SolidColorBrush x:Key="Effector_Blue_Status" Color="{StaticResource Effector_Blue_Status_Color}" />
<!--#cd5c5c-->
<Color x:Key="Effector_Red_Status_Color" R="205" G="92" B="92" A="255"/>
<SolidColorBrush x:Key="Effector_Red_Status" Color="{StaticResource Effector_Red_Status_Color}" />
<!--#b1cbaa-->
<Color x:Key="Effector_Green_Status_Color" R="177" G="203" B="170" A="255"/>
<SolidColorBrush x:Key="Effector_Green_Status" Color="{StaticResource Effector_Green_Status_Color}" />
<!--#9c9c9c-->
<Color x:Key="Effector_Gray_Status_Color" R="156" G="156" B="156" A="255"/>
<SolidColorBrush x:Key="Effector_Gray_Status" Color="{StaticResource Effector_Gray_Status_Color}" />
<!--#ffd932-->
<Color x:Key="Effector_Yellow_Status_Color" R="255" G="217" B="50" A="255"/>
<SolidColorBrush x:Key="Effector_Yellow_Status" Color="{StaticResource Effector_Yellow_Status_Color}" />
<!--#6398c7-->
<Color x:Key="Effector_LightBlue_SelStatus_Color" R="99" G="152" B="199" A="255"/>
<SolidColorBrush x:Key="Effector_LightBlue_SelStatus" Color="{StaticResource Effector_LightBlue_SelStatus_Color}" />
<!--#4b677e-->
<Color x:Key="Effector_Blue_SelStatus_Color" R="75" G="103" B="126" A="255"/>
<SolidColorBrush x:Key="Effector_Blue_SelStatus" Color="{StaticResource Effector_Blue_SelStatus_Color}" />
<!--#a94444-->
<Color x:Key="Effector_Red_SelStatus_Color" R="169" G="68" B="68" A="255"/>
<SolidColorBrush x:Key="Effector_Red_SelStatus" Color="{StaticResource Effector_Red_SelStatus_Color}" />
<!--#89aa81-->
<Color x:Key="Effector_Green_SelStatus_Color" R="137" G="170" B="129" A="255"/>
<SolidColorBrush x:Key="Effector_Green_SelStatus" Color="{StaticResource Effector_Green_SelStatus_Color}" />
<!--#7d7d7d-->
<Color x:Key="Effector_Gray_SelStatus_Color" R="125" G="125" B="125" A="255"/>
<SolidColorBrush x:Key="Effector_Gray_SelStatus" Color="{StaticResource Effector_Gray_SelStatus_Color}" />
<!--#dcb718-->
<Color x:Key="Effector_Yellow_SelStatus_Color" R="220" G="183" B="24" A="255"/>
<SolidColorBrush x:Key="Effector_Yellow_SelStatus" Color="{StaticResource Effector_Yellow_SelStatus_Color}" />
<!--#e5ebf1-->
<Color x:Key="Effector_White_SelStatus_Color" R="229" G="235" B="241" A="255"/>
<SolidColorBrush x:Key="Effector_White_SelStatus" Color="{StaticResource Effector_Yellow_SelStatus_Color}" />
<!--#endregion COLORS-->
<!--#region USERCONTROL -->
<!--#region Button-->
<!--Colori default dei controlli-->
<SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
<SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
<SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
<Style TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type Window}"> <ControlTemplate TargetType="{x:Type Button}">
<Border BorderThickness="0" <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
BorderBrush="LightGray" <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
Background="{TemplateBinding Background}">
<ContentPresenter Grid.Row="1"
Content="{TemplateBinding Content}"/>
</Border> </Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style>
<Style x:Key="Button.EffectorWindow.TitleBar" TargetType="{x:Type Button}">
<Setter Property="Foreground" Value="White" />
<Setter Property="Padding" Value="0" />
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border"
Background="Transparent"
BorderThickness="0"
SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter"
Margin="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Focusable="False"
RecognizesAccessKey="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="Background" Value="{DynamicResource MouseOverOverlayBackgroundBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="border" Property="Background" Value="{DynamicResource PressedOverlayBackgroundBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Test_Button" TargetType="Button">
<Setter Property="Background" Value="Red" />
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderBrush" Value="DarkRed" />
<Setter Property="BorderThickness" Value="5" />
<Setter Property="Height" Value="50" />
<Setter Property="Width" Value="200" />
</Style>
<Style x:Key="Button.DoorList" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="40"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="2"/>
</Style>
<Style x:Key="Button.Confirm" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="70"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Regular"/>
<Setter Property="FontFamily" Value="/Resources/Fonts/#Roboto"/>
<Setter Property="Background" Value="{StaticResource Effector_DarkBlue}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="10,5,10,5"/>
</Style>
<!--#endregion Button-->
<!--#region Image-->
<Style x:Key="Button.Image.DoorList" TargetType="{x:Type Image}">
<Setter Property="Stretch" Value="Uniform" />
</Style>
<!--#endregion Image-->
<!--#region TextBlock-->
<Style x:Key="TextBlock.DataGridTextColumn.DoorList" TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="TextBlock.MultipleCopy" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Regular"/>
<Setter Property="FontFamily" Value="/Resources/Fonts/#Roboto"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<!--#endregion TextBlock-->
<!--#region TextBox-->
<Style x:Key="TextBox.DataGridTextColumn.DoorList" TargetType="{x:Type TextBox}">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style x:Key="TextBox.MultipleCopy" TargetType="{x:Type TextBox}">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Regular"/>
<Setter Property="FontFamily" Value="/Resources/Fonts/#Roboto"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<!--#endregion TextBox-->
<!--#region ComboBox-->
<Style x:Key="ComboBox.DataGridTemplateColumn.DoorList" TargetType="{x:Type ComboBox}">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
</Style>
</Setter.Value>
</Setter>
</Style>
<!--#endregion ComboBox-->
<!--#region DataGridRow-->
<Style x:Key="RowDataGrid_CustomHighLight" TargetType="{x:Type DataGridRow}">
<Setter Property="BorderBrush" Value="LightGray" />
<Style.Triggers> <Style.Triggers>
<Trigger Property="WindowState" Value="Maximized"> <Trigger Property="IsSelected" Value="True">
<Setter Property="WindowChrome.WindowChrome"> <Setter Property="BorderThickness" Value="2,2,2,2" />
<Setter.Value> <Setter Property="Padding" Value="0,0,0,0" />
<WindowChrome CaptionHeight="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type local:EgtWindow}}, Converter={StaticResource CaptionHeightConverter}}" <Setter Property="Margin" Value="-2,0,-2,0" />
<Setter Property="Foreground" Value="Blue" />
</Trigger>
</Style.Triggers>
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="Black" />
</Style.Resources>
</Style>
<!--#endregion DataGridRow-->
<!--#endregion USERCONTROL-->
<!--#region CUSTOMCONTROLS -->
<Grid x:Key="EffectorWindow.Path.Maximize">
<Path Width="46"
Height="32"
Data="M 18.5,12.5 H 25.5 V 19.5 H 18.5 Z M 20.5,12.5 V 10.5 H 27.5 V 17.5 H 25.5"
Stroke="{Binding Path=Foreground,
RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1" />
</Grid>
<Grid x:Key="EffectorWindow.Path.Normal">
<Path Width="46"
Height="32"
Data="M 18.5,10.5 H 27.5 V 19.5 H 18.5 Z"
Stroke="{Binding Path=Foreground,
RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1" />
</Grid>
<ControlTemplate x:Key="EffectorWindow.ControlTemplate.WithTitleBar" TargetType="{x:Type EgwWPFBaseLib:EgtWindow}">
<Border BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="LightGray"
Background="{TemplateBinding Background}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type local:EffectorWindow}}}"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0"
Grid.ColumnSpan="6"
BorderThickness="0"
BorderBrush="{StaticResource Effector_Blue}"
Background="{StaticResource Effector_Blue}"/>
<Image Grid.Column="0"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Source="{TemplateBinding Icon}"/>
<ContentControl Grid.Column="1"
Content="{TemplateBinding TitlePanel}"/>
<TextBlock Grid.Column="2"
Margin="4 0 0 0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="14"
Text="{TemplateBinding Title}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="False">
<Setter Property="Foreground" Value="{DynamicResource WindowTitleBarInactiveText}" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Button Grid.Column="3"
Name="PART_MinimizeBtn"
RenderOptions.EdgeMode="Aliased"
Style="{StaticResource Button.EffectorWindow.TitleBar}">
<Path Width="46"
Height="32"
Data="M 18,15 H 28"
Stroke="{Binding Path=Foreground,
RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1" />
</Button>
<Button Grid.Column="4"
Name="PART_MaximizeRestoreBtn">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Button.EffectorWindow.TitleBar}">
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:EffectorWindow}}}" Value="Maximized">
<Setter Property="Content" Value="{StaticResource EffectorWindow.Path.Maximize}" />
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:EffectorWindow}}}" Value="Normal">
<Setter Property="Content" Value="{StaticResource EffectorWindow.Path.Normal}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button Grid.Column="5"
Name="PART_CloseBtn"
Style="{StaticResource Button.EffectorWindow.TitleBar}">
<Path Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground,
RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1" />
</Button>
</Grid>
<ContentPresenter Grid.Row="1"
Content="{TemplateBinding Content}"/>
</Grid>
</Border>
</ControlTemplate>
<ControlTemplate x:Key="EffectorWindow.ControlTemplate.WithoutTitleBar" TargetType="{x:Type EgwWPFBaseLib:EgtWindow}">
<Border BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="LightGray"
Background="Red">
<ContentPresenter Grid.Row="1"
Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
<Style TargetType="{x:Type local:EffectorWindow}" BasedOn="{StaticResource {x:Type EgwWPFBaseLib:EgtWindow}}">
<Setter Property="Background" Value="White"/>
<Setter Property="TitleBarHeight" Value="45"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="IsMinimizable" Value="True"/>
<Setter Property="Icon" Value="pack://application:,,,/Effector.Plugin.Lib;Component/Resources/Effector.ico"/>
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome CaptionHeight="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type EgwWPFBaseLib:EgtWindow}}}"
GlassFrameThickness="0" GlassFrameThickness="0"
CornerRadius="0" CornerRadius="0"
ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}"/> ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}"/>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
<Setter Property="Template"> <Setter Property="Template" Value="{StaticResource EffectorWindow.ControlTemplate.WithTitleBar}"/>
<Setter.Value> <Style.Triggers>
<ControlTemplate TargetType="{x:Type Window}"> <Trigger Property="WindowStyle" Value="None">
<!--bordo necessario per evitare la parte che esce dallo schermo--> <Setter Property="Template" Value="{StaticResource EffectorWindow.ControlTemplate.WithoutTitleBar}"/>
<Border BorderThickness="7"
BorderBrush="LightGray"
Background="{TemplateBinding Background}">
<ContentPresenter Grid.Row="1"
Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger> </Trigger>
<Trigger Property="WindowState" Value="Maximized">
<Setter Property="BorderThickness" Value="7"/>
<!--da impostare perche' lo perde!-->
<Setter Property="Template" Value="{StaticResource EffectorWindow.ControlTemplate.WithTitleBar}"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="WindowState" Value="Maximized"/>
<Condition Property="WindowStyle" Value="None"/>
</MultiTrigger.Conditions>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template" Value="{StaticResource EffectorWindow.ControlTemplate.WithoutTitleBar}"/>
</MultiTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style x:Key="EffectorWindow.Dialog" TargetType="{x:Type local:EffectorWindow}">
<Setter Property="IsMinimizable" Value="False"/>
<Setter Property="IsResizable" Value="False"/>
</Style>
<Style x:Key="EffectorWindow.Dialog.NoClose" TargetType="{x:Type local:EffectorWindow}">
<Setter Property="IsMinimizable" Value="False"/>
<Setter Property="IsResizable" Value="False"/>
<Setter Property="IsClosable" Value="False"/>
</Style>
<!--#endregion CUSTOMCONTROLS-->
</ResourceDictionary> </ResourceDictionary>
@@ -18,4 +18,21 @@
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}" MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Source="/Resources/Effector.ico"/> Source="/Resources/Effector.ico"/>
<ContentControl Grid.Column="1"/> <ContentControl Grid.Column="1"/>
<TextBlock Grid.Column="2"
Margin="4 0 0 0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="14"
Text="{Binding sTitle}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="False">
<Setter Property="Foreground" Value="{DynamicResource WindowTitleBarInactiveText}" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid> </Grid>
@@ -1,3 +1,39 @@
Public Class TitleBar Public Class TitleBar
' Proprietà che permette di attivare e disattivare lo spostamento della finestra
Public Shared ReadOnly TitleProperty As DependencyProperty = DependencyProperty.Register("Title", GetType(String), GetType(TitleBar), New PropertyMetadata(""))
Public Property Title() As Boolean
Get
Return CBool(GetValue(TitleProperty))
End Get
Set(ByVal value As Boolean)
SetValue(TitleProperty, value)
End Set
End Property
' Proprietà che permette di attivare e disattivare lo spostamento della finestra
Public Shared ReadOnly IsMinimizableProperty As DependencyProperty = DependencyProperty.Register("IsMinimizable", GetType(Boolean), GetType(TitleBar), New PropertyMetadata(True))
Public Property IsMinimizable() As Boolean
Get
Return CBool(GetValue(IsMinimizableProperty))
End Get
Set(ByVal value As Boolean)
SetValue(IsMinimizableProperty, value)
End Set
End Property
' Proprietà che permette di attivare e disattivare il bottone di chiusura della finestra
Public Shared ReadOnly IsClosableProperty As DependencyProperty = DependencyProperty.Register("IsClosable", GetType(Boolean), GetType(TitleBar), New PropertyMetadata(True))
Public Property IsClosable() As Boolean
Get
Return CBool(GetValue(IsClosableProperty))
End Get
Set(ByVal value As Boolean)
SetValue(IsClosableProperty, value)
If Not value Then
IsMinimizable = False
End If
End Set
End Property
End Class End Class
+19
View File
@@ -0,0 +1,19 @@
Public Module Converters
ReadOnly dtLuaMinValue As New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
Public Function ConvertDateTimeToString(dtValue As DateTime) As String
If dtValue < dtLuaMinValue.AddDays(1) Then
Return ""
ElseIf dtValue > DateTime.Today Then
Return dtValue.ToString("T")
Else
Return dtValue.ToString("d") & " " & dtValue.ToString("T")
End If
End Function
Public Function ConvertDateTimeToLuaInteger(dtValue As DateTime) As Integer
Return Math.Floor((dtValue.ToUniversalTime - dtLuaMinValue).TotalSeconds)
End Function
End Module
@@ -0,0 +1,80 @@
Imports System.Runtime.InteropServices
Imports System.Security
Public Module EgtInterface
#If DEBUG Then
Const EgtIntDll32 As String = "EgtBasisD32.dll"
#Else
Const EgtIntDll32 As String = "EgtBasisR32.dll"
#End If
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtSetKey"), SuppressUnmanagedCodeSecurity()>
Public Function EgtSetKey(sKey As String) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyLevel"), SuppressUnmanagedCodeSecurity()>
Public Function EgtGetKeyLevel(nProd As Integer, nVer As Integer, nLev As Integer, ByRef nKLev As Integer) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyOptions"), SuppressUnmanagedCodeSecurity()>
Public Function EgtGetKeyOptions(nProd As Integer, nVer As Integer, nLev As Integer,
ByRef nOpt1 As UInteger, ByRef nOpt2 As UInteger) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyLeftDays"), SuppressUnmanagedCodeSecurity()>
Public Function EgtGetKeyLeftDays(ByRef nLeftDays As Integer) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyAssLeftDays"), SuppressUnmanagedCodeSecurity()>
Public Function EgtGetKeyAssLeftDays(ByRef nAssLeftDays As Integer) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyOptLeftDays"), SuppressUnmanagedCodeSecurity()>
Public Function EgtGetKeyOptLeftDays(ByRef nOptLeftDays As Integer) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtFreeMemory"), SuppressUnmanagedCodeSecurity()>
Public Function EgtFreeMemory(sB As IntPtr) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtLoadMessages"), SuppressUnmanagedCodeSecurity()>
Public Function EgtLoadMessages(sMsgFilePath As String) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetMsg"), SuppressUnmanagedCodeSecurity()>
Private Function EgtGetMsg_32(nId As Integer) As IntPtr
End Function
Public Function EgtMsg(nId As Integer) As String
Return Marshal.PtrToStringUni(EgtGetMsg_32(nId))
' Non è necessario liberare la memoria nativa perchè usa un buffer statico
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtInitLogger"), SuppressUnmanagedCodeSecurity()>
Public Function EgtInitLogger(nDebug As Integer, sLogFilePath As String) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtOutLog"), SuppressUnmanagedCodeSecurity()>
Private Function EgtOutLog(sMsg As String, nDebugLevel As Integer) As Boolean
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetStringUtf8FromIni"), SuppressUnmanagedCodeSecurity()>
Private Function EgtGetStringUtf8FromIni_32(sSec As String, sKey As String, sDef As String, ByRef sVal As IntPtr, sIniFile As String) As Boolean
End Function
Public Function EgtGetStringUtf8FromIni(sSec As String, sKey As String, sDef As String, ByRef sVal As String, sIniFile As String) As Boolean
Dim psVal As IntPtr
Dim bOk As Boolean = EgtGetStringUtf8FromIni_32(sSec, sKey, sDef, psVal, sIniFile)
If bOk Then
sVal = Marshal.PtrToStringUni(psVal)
EgtFreeMemory(psVal)
Else
sVal = String.Empty
End If
Return bOk
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtWriteStringUtf8ToIni"), SuppressUnmanagedCodeSecurity()>
Public Function EgtWriteStringUtf8toIni(sSec As String, sKey As String, sVal As String, sIniFile As String) As Boolean
End Function
End Module
+12 -18
View File
@@ -38,25 +38,19 @@ Public Module IniFile
Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath) Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath)
End Function End Function
'Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
' Dim sVal As String = String.Empty Dim sVal As String = String.Empty
' GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName) GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
' Dim sItems() As String = sVal.Split(",".ToCharArray) Dim sItems() As String = sVal.Split(",".ToCharArray)
' If sItems.Count() = 2 Then If sItems.Count() = 2 Then
' Return New Language(sItems(0), sItems(1)) Return New Language(sItems(0), sItems(1))
' End If End If
' Return Nothing Return Nothing
'End Function End Function
'Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
' Dim sVal As String = String.Empty Return GetPrivateProfileLanguage(lpAppName, lpKeyName, m_sPath)
' GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal) End Function
' Dim sItems() As String = sVal.Split(",".ToCharArray)
' If sItems.Count() = 2 Then
' Return New Language(sItems(0), sItems(1))
' End If
' Return Nothing
'End Function
Public Function WriteMainPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean Public Function WriteMainPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath) Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath)
+22
View File
@@ -0,0 +1,22 @@
Public Class Language
Private m_sName As String
Public ReadOnly Property Name As String
Get
Return m_sName
End Get
End Property
Private m_sFilePath As String
Public ReadOnly Property FilePath As String
Get
Return m_sFilePath
End Get
End Property
Sub New(sName As String, sFilePath As String)
m_sName = sName
m_sFilePath = sFilePath
End Sub
End Class
@@ -38,26 +38,6 @@ Public Module PluginIniFile
Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath) Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath)
End Function End Function
'Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
' Dim sVal As String = String.Empty
' GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
' Dim sItems() As String = sVal.Split(",".ToCharArray)
' If sItems.Count() = 2 Then
' Return New Language(sItems(0), sItems(1))
' End If
' Return Nothing
'End Function
'Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
' Dim sVal As String = String.Empty
' GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
' Dim sItems() As String = sVal.Split(",".ToCharArray)
' If sItems.Count() = 2 Then
' Return New Language(sItems(0), sItems(1))
' End If
' Return Nothing
'End Function
Public Function WritePluginPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean Public Function WritePluginPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath) Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath)
End Function End Function