OmagView :

- primo commit.
This commit is contained in:
Dario Sassi
2016-06-17 06:44:16 +00:00
parent c13f8d75c5
commit 7e67f84aaa
38 changed files with 4674 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
<Window x:Class="AboutBoxWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AboutBoxWD" Height="469.15" Width="511.8" WindowStyle="None" ResizeMode="NoResize"
AllowsTransparency="True" Background="Transparent" ShowInTaskbar="False">
<!-- Definizione dell'AboutBox -->
<Border Style="{StaticResource OmagCut_WindowBorder}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Name="LogoBrd" Grid.Column="1" Background="White">
<Image Source="Resources/LogoOmag.jpg" Stretch="Uniform"/>
</Border>
</Grid>
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18" />
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="KeyLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="MachineLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="ProjectLbl" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="15" />
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="10" IsCancel="True"
Style="{StaticResource OmagCut_WindowGrayTextButton}" Margin="1,0"/>
</Grid>
</Border>
</Window>
+44
View File
@@ -0,0 +1,44 @@
Imports EgtUILib
Public Class AboutBoxWD
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = Application.Current.MainWindow
Sub New(Owner As Window)
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.Owner = Owner
Me.Top = Owner.Top + (Owner.Height / 2 - Me.Height / 2)
Me.Left = Owner.Left + (Owner.Width / 2 - Me.Width / 2)
Me.ShowDialog()
End Sub
Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
DescriptionLbl.Text = My.Application.Info.Description.ToString()
VersionLbl.Text = "Version : " & My.Application.Info.Version.ToString()
Dim sKey As String = String.Empty
EgtGetKeyInfo(sKey)
Dim sOpts As String = m_MainWindow.GetKeyOptions().ToString()
KeyLbl.Text = sKey & " - " & sOpts
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
Dim sMachine As String = String.Empty
If EgtGetCurrMachineName(sMachine) Then
MachineLbl.Text = "Machine : " & sMachine
Else
MachineLbl.Text = "Machine : ---"
End If
Dim sFile As String = String.Empty
If EgtGetCurrFilePath(sFile) Then
ProjectLbl.Text = "Project : " & sFile
Else
ProjectLbl.Text = "Project : ---"
End If
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
End Sub
End Class
+10
View File
@@ -0,0 +1,10 @@
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary Source="OmagVIEWDictionary.xaml"/>
</Application.Resources>
</Application>
+6
View File
@@ -0,0 +1,6 @@
Class Application
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
' can be handled in this file.
End Class
+42
View File
@@ -0,0 +1,42 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstGen.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti generali.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Imports EgtUILib
Module ConstGen
' File con direttorio radice dei dati
Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
Public Const S_DATA As String = "Data"
Public Const K_DATAROOT As String = "DataRoot"
' File con dati di licenza
Public Const LIC_FILE_NAME As String = "OmagVIEW.lic"
Public Const S_LICENCE As String = "Licence"
Public Const K_KEY As String = "Key"
' File di log generale
Public Const GENLOG_FILE_NAME As String = "OmagVIEWLog.txt"
' Sottodirettorio di configurazione
Public Const CONF_DIR As String = "Config"
' Sottodirettorio temporaneo
Public Const TEMP_DIR As String = "Temp"
' Sottodirettorio di default per le macchine
Public Const MACHINES_DFL_DIR As String = "Machines"
' Costanti per lavorazioni
Public Const MACH_GROUP As String = "Mach01"
Public Const MAIN_TAB As String = "MainTab"
Public Const SECOND_TAB As String = "2ndTab"
End Module
+71
View File
@@ -0,0 +1,71 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Module ConstIni
Public Const INI_FILE_NAME As String = "OmagVIEW.ini"
Public Const S_GENERAL As String = "General"
Public Const K_DEBUG As String = "Debug"
Public Const K_LICENCE As String = "Licence"
Public Const K_MESSAGESDIR As String = "MessagesDir"
Public Const K_MESSAGES As String = "Messages"
Public Const K_WINPLACE As String = "WinPlace"
Public Const K_MMUNITS As String = "MmUnits"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
Public Const S_LUA As String = "Lua"
Public Const K_LIBSDIR As String = "LibsDir"
Public Const K_BASELIB As String = "BaseLib"
Public Const S_GEOMDB As String = "GeomDB"
Public Const K_DEFAULTFONT As String = "DefaultFont"
Public Const K_NFEFONTDIR As String = "NfeFontDir"
Public Const K_DEFAULTCOLOR As String = "DefaultColor"
Public Const S_OPENGL As String = "OpenGL"
Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
Public Const K_COLORBITS As String = "ColorBits"
Public Const K_DEPTHBITS As String = "DepthBits"
Public Const K_DRIVER As String = "Driver"
Public Const S_SCENE As String = "Scene"
Public Const K_BACKTOP As String = "BackTop"
Public Const K_BACKBOTTOM As String = "BackBottom"
Public Const K_SHOWGFRAME As String = "ShowGFrame"
Public Const K_MARK As String = "Mark"
Public Const K_SELSURF As String = "SelSurf"
Public Const K_SHOWMODE As String = "ShowMode"
Public Const K_CURVEDIR As String = "CurveDir"
Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
Public Const K_ZOOMWIN As String = "ZoomWin"
Public Const K_DISTLINE As String = "DistLine"
Public Const S_GRID As String = "Grid"
Public Const K_SHOWGRID As String = "ShowGrid"
Public Const K_SHOWFRAME As String = "ShowFrame"
Public Const K_SNAPSTEP As String = "SnapStep"
Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
Public Const K_MINLINESSTEP As String = "MinLineSStep"
Public Const K_MAJLINESSTEP As String = "MajLineSStep"
Public Const K_EXTSSTEP As String = "ExtSStep"
Public Const K_MINLNCOLOR As String = "MinLnColor"
Public Const K_MAJLNCOLOR As String = "MajLnColor"
Public Const S_MACH As String = "Mach"
Public Const K_MACHINESDIR As String = "MachinesDir"
Public Const K_CURRMACH As String = "CurrMach"
End Module
+33
View File
@@ -0,0 +1,33 @@
Module ConstMsg
Public Const MSG_MISSINGKEYWD As Integer = 10100
Public Const MSG_NUMERICKEYBOARDWD As Integer = 10200
Public Const MSG_OMAGCUT As Integer = 90000
Public Const MSG_GENERAL As Integer = MSG_OMAGCUT
Public Const MSG_WORKINPROGRESSPAGEUC As Integer = MSG_OMAGCUT + 100
Public Const MSG_DIRECTCUTPAGEUC As Integer = MSG_OMAGCUT + 200
Public Const MSG_MANUALAXESMOVEPAGEUC As Integer = MSG_OMAGCUT + 220
Public Const MSG_CADCUTPAGEUC As Integer = MSG_OMAGCUT + 300
Public Const MSG_NESTPAGEUC As Integer = MSG_OMAGCUT + 330
Public Const MSG_SPLITPAGEUC As Integer = MSG_OMAGCUT + 340
Public Const MSG_MOVERAWPAGEUC As Integer = MSG_OMAGCUT + 360
Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 380
Public Const MSG_COMPONENTPAGEUC As Integer = MSG_OMAGCUT + 400
Public Const MSG_IMPORTPAGEUC As Integer = MSG_OMAGCUT + 450
Public Const MSG_OPENPAGEUC As Integer = MSG_OMAGCUT + 490
Public Const MSG_RAWPARTPAGEUC As Integer = MSG_OMAGCUT + 500
Public Const MSG_CHOOSEMACHININGPAGEUC As Integer = MSG_OMAGCUT + 535
Public Const MSG_SIMULATIONPAGEUC As Integer = MSG_OMAGCUT + 550
Public Const MSG_FRAMECUTPAGEUC As Integer = MSG_OMAGCUT + 600
Public Const MSG_MACHINEPAGEUC As Integer = MSG_OMAGCUT + 700
Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 720
Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760
Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800
Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900
Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 930
Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 950
Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100
Public Const MSG_CSVPAGEUC As Integer = MSG_OMAGCUT + 1200
End Module
+436
View File
@@ -0,0 +1,436 @@
<ResourceDictionary
x:Class="EgtDictionary"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Project="clr-namespace:OmagVIEW"
xmlns:ControlExtensions="clr-namespace:OmagVIEW.ControlExtensions">
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="Button_DataTemplate_Wrap">
<TextBlock TextWrapping="Wrap" Text="{Binding}"/>
</DataTemplate>
<!--ButtonBase-->
<Style TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="#FFDDDDDD"/>
<Setter Property="BorderBrush" Value="#FF707070"/>
<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.Value>
<ControlTemplate TargetType="{x:Type Button}" >
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Project:ButtonExtensions.CornerRadius)}"
Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<!--Commentato per evitare che cambi colore quando ci si passa sopra con il mouse-->
<!--<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
</Trigger>-->
<!--Commentato per evitare che cambi colore quando viene premuto-->
<!--<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
</Trigger>-->
<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" TargetName="border" Value="#FFF4F4F4"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="#FF838383"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="CheckBox_DataTemplate_Wrap">
<TextBlock TextWrapping="Wrap" Text="{Binding}" />
</DataTemplate>
<!--Riferimento al Converter che permette di ridimensionare la spunta-->
<ControlExtensions:CheckboxConverter x:Key="converter"></ControlExtensions:CheckboxConverter>
<!--CheckBoxBase-->
<Style TargetType="{x:Type CheckBox}">
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#FF707070"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border x:Name="checkBoxBorder" Height="{Binding Path=ActualHeight, ElementName=templateRoot}" Width="{Binding Path=ActualHeight, ElementName=templateRoot}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid x:Name="markGrid">
<Path x:Name="optionMark" Data="F1M9.97498,1.22334L4.6983,9.09834 4.52164,9.09834 0,5.19331 1.27664,3.52165 4.255,6.08833 8.33331,1.52588E-05 9.97498,1.22334z" Fill="#FF212121" Margin="1" Opacity="0" Stretch="None"
RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform>
<ScaleTransform.ScaleX>
<MultiBinding Converter="{StaticResource converter}">
<Binding ElementName="templateRoot" Path="ActualHeight"/>
<Binding ElementName="optionMark" Path="ActualHeight"/>
</MultiBinding>
</ScaleTransform.ScaleX>
<ScaleTransform.ScaleY>
<MultiBinding Converter="{StaticResource converter}">
<Binding ElementName="templateRoot" Path="ActualHeight"/>
<Binding ElementName="optionMark" Path="ActualHeight"/>
</MultiBinding>
</ScaleTransform.ScaleY>
</ScaleTransform>
</TransformGroup>
</Path.RenderTransform>
</Path>
<Rectangle x:Name="indeterminateMark" Fill="#FF212121" Margin="2" Opacity="0"/>
</Grid>
</Border>
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasContent" Value="True">
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="4,-1,0,0"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="checkBoxBorder" Value="#FFF3F9FF"/>
<Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="#FF5593FF"/>
<Setter Property="Fill" TargetName="optionMark" Value="#FF212121"/>
<Setter Property="Fill" TargetName="indeterminateMark" Value="#FF212121"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" TargetName="checkBoxBorder" Value="#FFE6E6E6"/>
<Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="#FFBCBCBC"/>
<Setter Property="Fill" TargetName="optionMark" Value="#FF707070"/>
<Setter Property="Fill" TargetName="indeterminateMark" Value="#FF707070"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="checkBoxBorder" Value="#FFD9ECFF"/>
<Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="#FF3C77DD"/>
<Setter Property="Fill" TargetName="optionMark" Value="#FF212121"/>
<Setter Property="Fill" TargetName="indeterminateMark" Value="#FF212121"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Opacity" TargetName="optionMark" Value="1"/>
<Setter Property="Opacity" TargetName="indeterminateMark" Value="0"/>
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter Property="Opacity" TargetName="optionMark" Value="0"/>
<Setter Property="Opacity" TargetName="indeterminateMark" Value="1"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--Riferimento al Converter che permette di massimizzare l'area libera interna al GroupBox-->
<ControlExtensions:GroupBoxConverter x:Key="GroupBoxConverter"></ControlExtensions:GroupBoxConverter>
<ControlExtensions:BorderGapMaskConverter x:Key="BorderGapMaskConverter"></ControlExtensions:BorderGapMaskConverter>
<!--GroupBoxBase-->
<Style TargetType="{x:Type GroupBox}">
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ControlExtensions:GroupBoxExtensions.FirstColumn" Value="6" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Grid SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="FirstColumn" Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(ControlExtensions:GroupBoxExtensions.FirstColumn)}"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="6"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="6"/>
</Grid.RowDefinitions>
<Border Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(ControlExtensions:GroupBoxExtensions.CornerRadius)}" Grid.Row="1" Grid.RowSpan="3" >
<Border.OpacityMask>
<MultiBinding Converter="{StaticResource BorderGapMaskConverter}" UpdateSourceTrigger="Default">
<Binding ElementName="Header" Path="ActualWidth"/>
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
<Binding ElementName="FirstColumn" Path="Width"/>
</MultiBinding>
</Border.OpacityMask>
</Border>
<Border x:Name="Header" Grid.Column="1" Padding="3,1,3,0" Grid.Row="0" Grid.RowSpan="2">
<ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
<ContentPresenter Grid.ColumnSpan="2" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Grid.Row="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ContentPresenter.Margin>
<MultiBinding Converter="{StaticResource GroupBoxConverter}">
<Binding ElementName="Border" Path="BorderThickness"/>
<Binding ElementName="Border" Path="CornerRadius"/>
<Binding ElementName="FirstColumn" Path="Width"/>
</MultiBinding>
</ContentPresenter.Margin>
</ContentPresenter>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--TextBlock-->
<!--<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="NoWrap"/>
<Setter Property="TextTrimming" Value="None"/>
</Style>-->
<!-- ______________________________________________________________________________________________________________________ -->
<!--TextBox-->
<!--<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
<GradientStop Color="#ABADB3" Offset="0.05"/>
<GradientStop Color="#E2E3EA" Offset="0.07"/>
<GradientStop Color="#E3E9EF" Offset="1"/>
</LinearGradientBrush>
<Style BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>-->
<ControlTemplate x:Key="FixedTextBoxTemplate" TargetType="{x:Type TextBox}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<!--<Setter Property="Opacity" TargetName="border" Value="0.56"/>-->
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- ______________________________________________________________________________________________________________________ -->
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="ToggleButton_DataTemplate_Wrap">
<TextBlock TextWrapping="Wrap" Text="{Binding}" />
</DataTemplate>
<!--ToggleButtonBase-->
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="#FFDDDDDD"/>
<Setter Property="BorderBrush" Value="#FF707070"/>
<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.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(ControlExtensions:ToggleButtonExtensions.CornerRadius)}"
Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<!--Commentato per per evitare che cambi colore quando ci si passa sopra con il mouse-->
<!--<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
</Trigger>-->
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
</Trigger>
<!--Commentato per poter gestire il colore di evidenziazione direttamente nello Style del ToggleButton-->
<!--<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
</Trigger>-->
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" TargetName="border" Value="#FFF4F4F4"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="#FF838383"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--TreeViewBase-->
<!--Style e colori della freccia di espansione, necessari per modificare il ContainerItemStyle perchè contiene riferimenti ad essi-->
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Fill" Color="#FF595959"/>
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Stroke" Color="#FF262626"/>
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Stroke" Color="#FF1BBBFA"/>
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Fill" Color="Transparent"/>
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Stroke" Color="#FF262626"/>
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Fill" Color="#FF595959"/>
<PathGeometry x:Key="TreeArrow" Figures="M0,0 L0,6 L6,0 z"/>
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Fill" Color="Transparent"/>
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Stroke" Color="#FF989898"/>
<Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Width" Value="16"/>
<Setter Property="Height" Value="16"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Background="Transparent" Height="16" Padding="5,5,5,5" Width="16">
<Path x:Name="ExpandPath" Data="{StaticResource TreeArrow}" Fill="{StaticResource TreeViewItem.TreeArrow.Static.Fill}" Stroke="{StaticResource TreeViewItem.TreeArrow.Static.Stroke}">
<Path.RenderTransform>
<RotateTransform Angle="135" CenterY="3" CenterX="3"/>
</Path.RenderTransform>
</Path>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="RenderTransform" TargetName="ExpandPath">
<Setter.Value>
<RotateTransform Angle="180" CenterY="3" CenterX="3"/>
</Setter.Value>
</Setter>
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Fill}"/>
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Stroke}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Stroke}"/>
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Fill}"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsChecked" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Stroke}"/>
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Fill}"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
</ResourceDictionary>
+373
View File
@@ -0,0 +1,373 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.Globalization
Public Class EgtDictionary
Inherits ResourceDictionary
End Class
#Region "<!--ButtonBase-->"
Public Class ButtonExtensions
Public Shared ReadOnly CornerRadiusProperty As DependencyProperty = DependencyProperty.RegisterAttached("CornerRadius", GetType(Double), GetType(ButtonExtensions), New PropertyMetadata(0.0))
Public Shared Function GetCornerRadius(element As UIElement) As Double
Return CDbl(element.GetValue(CornerRadiusProperty))
End Function
Public Shared Sub SetCornerRadius(element As UIElement, value As Double)
element.SetValue(CornerRadiusProperty, value)
End Sub
End Class
#End Region
Namespace ControlExtensions
#Region "<!--CheckBoxBase-->"
'Converter che permette di ridimensionare la spunta
Public Class CheckboxConverter
Implements IMultiValueConverter
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert
If values.Length <> 2 Then
Throw New ArgumentException("There should be three values.")
End If
If String.IsNullOrEmpty(values(0).ToString) Then
values(0) = "0"
End If
If String.IsNullOrEmpty(values(1).ToString()) Then
values(2) = "0"
End If
Dim x As Double
If Not Double.TryParse(values(0).ToString(), x) Then
Throw New ArgumentException("values[0] must parse to double")
End If
Dim y As Double
If Not Double.TryParse(values(1).ToString(), y) Then
Throw New ArgumentException("values[0] must parse to double")
End If
Return (x / y) - 1
End Function
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Return New Object() {Binding.DoNothing}
End Function
End Class
#End Region
#Region "<!--GroupBoxBase-->"
Public Class GroupBoxExtensions
Public Shared ReadOnly CornerRadiusProperty As DependencyProperty = DependencyProperty.RegisterAttached("CornerRadius", GetType(Double), GetType(GroupBoxExtensions), New PropertyMetadata(0.0))
Public Shared Function GetCornerRadius(element As UIElement) As Double
Return CDbl(element.GetValue(CornerRadiusProperty))
End Function
Public Shared Sub SetCornerRadius(element As UIElement, value As Double)
element.SetValue(CornerRadiusProperty, value)
End Sub
Public Shared ReadOnly FirstColumnProperty As DependencyProperty = DependencyProperty.RegisterAttached("FirstColumn", GetType(Double), GetType(GroupBoxExtensions), New PropertyMetadata(0.0))
Public Shared Function GetFirstColumn(element As UIElement) As Double
Return CDbl(element.GetValue(CornerRadiusProperty))
End Function
Public Shared Sub SetFirstColumn(element As UIElement, value As Double)
element.SetValue(CornerRadiusProperty, value)
End Sub
End Class
'Converter che permette di massimizzare l'area interna del GroupBox
Public Class GroupBoxConverter
Implements IMultiValueConverter
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert
' Parameter Validation
Dim doubleType As Type = GetType(Double)
If values Is Nothing OrElse values.Length <> 3 OrElse values(0) Is Nothing OrElse values(1) Is Nothing OrElse values(2) Is Nothing Then
Return DependencyProperty.UnsetValue
End If
' Conversion
Dim dBorderThickness As Double = 0
Dim dCornerRadius As Double = 0
Dim sItems(3) As String
Dim Val1 As Double
Dim Val2 As Double
sItems = values(0).ToString.Split(",".ToCharArray)
Double.TryParse(sItems(2), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture.NumberFormat, Val1)
Double.TryParse(sItems(3), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture.NumberFormat, Val2)
dBorderThickness = Math.Max(Val1, Val2)
sItems = values(1).ToString.Split(",".ToCharArray)
Double.TryParse(sItems(2), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture.NumberFormat, Val1)
Double.TryParse(sItems(3), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture.NumberFormat, Val2)
dCornerRadius = Math.Max(Val1, Val2)
' Width of the line to the left of the header
' to be used to set the width of the first column of the Grid
Dim GridLengthConverter As New GridLengthConverter
Dim lineWidth As Double = CDbl(GridLengthConverter.ConvertToString(values(2)))
' Calcolo il Margin sottraendo alla larghezza della colonna (6) il massimo tra BorderThickness e CornerRadius
Dim dRightMargin = -6 + Math.Max(dBorderThickness, dCornerRadius)
Dim dLeftMargin = -lineWidth + Math.Max(dBorderThickness, dCornerRadius) - Math.Sqrt(2) / 2 * (dCornerRadius - dBorderThickness - 2)
' Calcolo il minimo tra il valore ottenuto e 0 perchè BorderThickness non può spingere il Margin oltre lo 0
dRightMargin = Math.Min(0, dRightMargin)
dLeftMargin = Math.Min(0, dLeftMargin)
' Creo Thickness con il valore ottenuto da ritornare
Dim ReturnValue As Thickness
ReturnValue.Top = 0
ReturnValue.Bottom = dRightMargin
ReturnValue.Left = dLeftMargin
ReturnValue.Right = dRightMargin
Return ReturnValue
End Function
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Return New Object() {Binding.DoNothing}
End Function
End Class
''' <summary>
''' BorderGapMaskConverter class
''' </summary>
Public Class BorderGapMaskConverter
Implements IMultiValueConverter
''' <summary>
''' Convert a value.
''' </summary>
''' <param name="values">values as produced by source binding</param>
''' <param name="targetType">target type</param>
''' <param name="parameter">converter parameter</param>
''' <param name="culture">culture information</param>
''' <returns>
''' Converted value.
''' Visual Brush that is used as the opacity mask for the Border
''' in the style for GroupBox.
''' </returns>
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert
' Parameter Validation
Dim doubleType As Type = GetType(Double)
If values Is Nothing OrElse values.Length <> 4 OrElse values(0) Is Nothing OrElse values(1) Is Nothing OrElse values(2) Is Nothing OrElse values(3) Is Nothing OrElse Not doubleType.IsAssignableFrom(values(0).[GetType]()) OrElse Not doubleType.IsAssignableFrom(values(1).[GetType]()) OrElse Not doubleType.IsAssignableFrom(values(2).[GetType]()) Then
Return DependencyProperty.UnsetValue
End If
' Conversion
Dim headerWidth As Double = CDbl(values(0))
Dim borderWidth As Double = CDbl(values(1))
Dim borderHeight As Double = CDbl(values(2))
' Width of the line to the left of the header
' to be used to set the width of the first column of the Grid
Dim GridLengthConverter As New GridLengthConverter
Dim lineWidth As Double = CDbl(GridLengthConverter.ConvertToString(values(3)))
' Doesn't make sense to have a Grid
' with 0 as width or height
If borderWidth = 0 OrElse borderHeight = 0 Then
Return Nothing
End If
Dim grid__1 As New Grid()
grid__1.Width = borderWidth
grid__1.Height = borderHeight
Dim colDef1 As New ColumnDefinition()
Dim colDef2 As New ColumnDefinition()
Dim colDef3 As New ColumnDefinition()
colDef1.Width = New GridLength(lineWidth)
colDef2.Width = New GridLength(headerWidth)
colDef3.Width = New GridLength(1, GridUnitType.Star)
grid__1.ColumnDefinitions.Add(colDef1)
grid__1.ColumnDefinitions.Add(colDef2)
grid__1.ColumnDefinitions.Add(colDef3)
Dim rowDef1 As New RowDefinition()
Dim rowDef2 As New RowDefinition()
rowDef1.Height = New GridLength(borderHeight / 2)
rowDef2.Height = New GridLength(1, GridUnitType.Star)
grid__1.RowDefinitions.Add(rowDef1)
grid__1.RowDefinitions.Add(rowDef2)
Dim rectColumn1 As New Rectangle()
Dim rectColumn2 As New Rectangle()
Dim rectColumn3 As New Rectangle()
rectColumn1.Fill = Brushes.Black
rectColumn2.Fill = Brushes.Black
rectColumn3.Fill = Brushes.Black
Grid.SetRowSpan(rectColumn1, 2)
Grid.SetRow(rectColumn1, 0)
Grid.SetColumn(rectColumn1, 0)
Grid.SetRow(rectColumn2, 1)
Grid.SetColumn(rectColumn2, 1)
Grid.SetRowSpan(rectColumn3, 2)
Grid.SetRow(rectColumn3, 0)
Grid.SetColumn(rectColumn3, 2)
grid__1.Children.Add(rectColumn1)
grid__1.Children.Add(rectColumn2)
grid__1.Children.Add(rectColumn3)
Return (New VisualBrush(grid__1))
End Function
''' <summary>
''' Not Supported
''' </summary>
''' <param name="value">value, as produced by target</param>
''' <param name="targetTypes">target types</param>
''' <param name="parameter">converter parameter</param>
''' <param name="culture">culture information</param>
''' <returns>Nothing</returns>
Public Function ConvertBack(value As Object, targetTypes As Type(), parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Return New Object() {Binding.DoNothing}
End Function
End Class
#End Region
#Region "<!--HierarchicalTreeView-->"
Public Class CathegoryItem
Inherits TreeViewItemBase
Private m_sTitle As String
Private m_sPictureString As String
Private m_Items As ObservableCollection(Of CustomItem)
Sub New(Title As String)
Me.Title = Title
Me.Items = New ObservableCollection(Of CustomItem)
End Sub
Public Property Title As String
Get
Return m_sTitle
End Get
Set(value As String)
m_sTitle = value
End Set
End Property
Public ReadOnly Property PictureString As String
Get
Return "/Resources/ToolsTreeviewImages/Lama.png"
End Get
End Property
Public Property Items As ObservableCollection(Of CustomItem)
Get
Return m_Items
End Get
Set(value As ObservableCollection(Of CustomItem))
m_Items = value
End Set
End Property
End Class
Public Class CustomItem
Inherits TreeViewItemBase
Private m_sTitle As String
Sub New(Title As String)
Me.Title = Title
End Sub
Public Property Title As String
Get
Return m_sTitle
End Get
Set(value As String)
m_sTitle = value
End Set
End Property
End Class
Public Class TreeViewItemBase
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Private m_isSelected As Boolean
Public Property IsSelected As Boolean
Get
Return m_isSelected
End Get
Set(value As Boolean)
If (value <> m_isSelected) Then
m_isSelected = value
NotifyPropertyChanged("IsSelected")
End If
End Set
End Property
Private m_isExpanded As Boolean
Public Property IsExpanded As Boolean
Get
Return m_isExpanded
End Get
Set(value As Boolean)
If (value <> m_isExpanded) Then
m_isExpanded = value
NotifyPropertyChanged("IsExpanded")
End If
End Set
End Property
Public Sub NotifyPropertyChanged(propName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
End Sub
End Class
#End Region
Public Class ToggleButtonExtensions
Public Shared ReadOnly CornerRadiusProperty As DependencyProperty = DependencyProperty.RegisterAttached("CornerRadius", GetType(Double), GetType(ToggleButtonExtensions), New PropertyMetadata(0.0))
Public Shared Function GetCornerRadius(element As UIElement) As Double
Return CDbl(element.GetValue(CornerRadiusProperty))
End Function
Public Shared Sub SetCornerRadius(element As UIElement, value As Double)
element.SetValue(CornerRadiusProperty, value)
End Sub
End Class
End Namespace
+74
View File
@@ -0,0 +1,74 @@
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:OmagVIEW"
Title="MainWindow" Height="1024" Width="1280" ResizeMode="NoResize" WindowStyle="None"
FontFamily="./Resources/Fonts/#Century Gothic"
Icon="Resources/LogoOmag.jpg">
<!-- Chiamata al Dictionary -->
<!--<Window.Resources>
<ResourceDictionary Source="OmagVIEWDictionary.xaml" />
</Window.Resources>-->
<!-- ** Definizione della Grid della MainWindow ** -->
<Grid Name="MainWindowGrid" Background="{StaticResource OmagCut_Gray}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- ** Definizione della Grid della Row 0 (Barra superiore) ** -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="11*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Name="LogoBrd" Background="Transparent">
<Image Source="Resources/LogoOmag.jpg" Stretch="Uniform" Margin="1"/>
</Border>
<!-- ** Definizione della Grid delle tab ** -->
<Grid Name="MainTabGrid" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="OptionsBtn" Grid.Column="5" Style="{StaticResource OmagCut_BlueIconToggleButton}">
<Image Source="Resources/Options.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</Grid>
<Button Grid.Column="7" Style="{StaticResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
<Grid Name="SceneGrid" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button Name="OkPartBtn" Grid.Row="0"/>
<Button Name="RuinedPartBtn" Grid.Row="1"/>
<Button Name="LabelBtn" Grid.Row="2"/>
</Grid>
</Grid>
</Grid>
</Window>
+417
View File
@@ -0,0 +1,417 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib
Imports System.ComponentModel
Imports System.Threading
Imports System.Windows.Threading
Class MainWindow
' Mutex per avere una sola istanza del programma in esecuzione
Private m_objMutex As New Mutex
Friend m_OptionsPageUC As OptionsPageUC
' Dichiarazione variabili direttori
Private m_sDataRoot As String = String.Empty
Private m_sConfigDir As String = String.Empty
Private m_sTempDir As String = String.Empty
Private m_sMachinesRoot As String = String.Empty
Private m_sIniFile As String = String.Empty
Private m_nDebug As Integer = 0
'Dichiarazione variabile contenente la lingua corrente
Friend m_CurrLanguage As Language
'Dichiarazione lista delle lingue disponibili e lingua corrente
Friend m_LanguagesList As New List(Of Language)
' Macchina corrente
Private m_sCurrMachine As String = String.Empty
' Opzioni abilitate dalla licenza attiva associata alla chiave
Private m_nKeyOptions As UInteger
Friend Enum KEY_OPT As UInteger
BASE = 1
MAN_MANIP = 2
AUTO_MANIP = 4
MAN_PHOTO = 8
AUTO_PHOTO = 16
AUTO_NESTING = 32
ENABLE_MILL = 64
PROCUCTION_LINE = 128
End Enum
' Dichiarazione Scene
Friend WithEvents CurrentProjectScene As New Scene
Private CurrentProjectSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
Private m_bFirst As Boolean = True
' Dichiarazione delle Page UserControl
Friend m_SceneButtons As SceneButtonsUC
' Timer per aggiornamento interfaccia
Private m_IdleTimer As New DispatcherTimer(DispatcherPriority.ApplicationIdle)
Public Function GetIniFile() As String
Return m_sIniFile
End Function
Public Function GetTempDir() As String
Return m_sTempDir
End Function
Public Function GetMachinesRootDir() As String
Return m_sMachinesRoot
End Function
Public Function GetCurrMachine() As String
Return m_sCurrMachine
End Function
Friend Function GetKeyOption(nKeyOpt As KEY_OPT) As Boolean
Return m_nKeyOptions And nKeyOpt
End Function
Friend Function GetKeyOptions() As UInteger
Return m_nKeyOptions
End Function
Private Sub MainWindow_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Verifico sia l'unica istanza
ManageSingleIstance()
' Impostazione path radice per i dati
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
If GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
End If
' Impostazione direttorio di configurazione
m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
' Impostazione direttorio per file temporanei
m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
' Impostazione path Ini file
m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
' Impostazione direttorio per le macchine
If GetPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot, m_sIniFile) = 0 Then
m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
End If
' Recupero nome macchina corrente
GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sCurrMachine, m_sIniFile)
' Leggo e imposto chiave di protezione
Dim sLicFileName As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName, m_sIniFile)
Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
Dim sKey As String = String.Empty
GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
EgtSetKey(sKey)
' Inizializzazione generale di EgtInterface
m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
Dim sLogFile As String = m_sTempDir & "\" & GENLOG_FILE_NAME
Dim sLogMsg As String = My.Application.Info.Description.ToString() & " ver. " & My.Application.Info.Version.ToString()
EgtInit(m_nDebug, sLogFile, sLogMsg)
' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
Dim sMsgDir As String = String.Empty
If GetPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir, m_sIniFile) = 0 Then
sMsgDir = m_sConfigDir
End If
' Leggo elenco lingue disponibili da file ini
Dim nIndex As Integer = 1
Dim ReadLanguage As Language = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex, GetIniFile)
While Not IsNothing(ReadLanguage)
m_LanguagesList.Add(ReadLanguage)
nIndex += 1
ReadLanguage = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex, GetIniFile)
End While
' Leggo file messaggi
Dim sMsgFile As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgFile, m_sIniFile)
For i As Integer = 0 To m_LanguagesList.Count - 1
If m_LanguagesList(i).LanguageName = sMsgFile Then
m_CurrLanguage = m_LanguagesList(i)
End If
Next
Dim sMsgFilePath As String = sMsgDir & "\EgalTechIta.txt"
If Not IsNothing(m_CurrLanguage) Then
sMsgFilePath = sMsgDir & "\" & m_CurrLanguage.FileName
End If
If Not EgtLoadMessages(sMsgFilePath) Then
EgtOutLog("Error in EgtLoadMessages")
End If
Dim sNfeDir As String = String.Empty
GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir, m_sIniFile)
Dim sDefFont As String = String.Empty
GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont, m_sIniFile)
EgtSetFont(sNfeDir, sDefFont)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyOptions(9423, 16, 1, m_nKeyOptions)
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString())
' Imposto dir di default per libreria Lua e lancio libreria di base
Dim sLuaLibsDir As String = String.Empty
GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir, m_sIniFile)
EgtSetLuaLibs(sLuaLibsDir)
Dim sLuaBaseLib As String = String.Empty
GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib, m_sIniFile)
EgtLuaRequire(sLuaBaseLib)
' Imposto unità di misura per interfaccia utente
Dim bMM As Boolean = (GetPrivateProfileInt(S_GENERAL, K_MMUNITS, 1, m_sIniFile) <> 0)
EgtSetUiUnits(bMM)
' Imposto posizione e dimensioni della MainWindow
Dim nFlag As Integer
Dim nLeft As Integer
Dim nTop As Integer
Dim nWidth As Integer
Dim nHeight As Integer
GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
Me.WindowStartupLocation = Windows.WindowStartupLocation.Manual
Me.Top = nTop
Me.Left = nLeft
Me.Height = nHeight
Me.Width = nWidth
WindowState = If(nFlag = 1, WindowState.Maximized, WindowState.Normal)
' Inizializzazione della libreria EgtWPFLib
EgtWPFInit()
' Creazione delle Page UserControl
m_OptionsPageUC = New OptionsPageUC
' Posizionemento nella griglia delle Page UserControl
m_OptionsPageUC.SetValue(Grid.ColumnProperty, 0)
m_OptionsPageUC.SetValue(Grid.RowProperty, 1)
' Disabilita la possibilità di imitare il click del tasto destro del mouse tenendo premuto il dito sul touch
' NB: Se abilitato impedisce di utilizzare lo stato Pressed dei Button che quindi non si evidenziano quando premuti
Stylus.SetIsPressAndHoldEnabled(Me, False)
'Assegnazione scena all'host e posizionamento nella PlacePageGrid
CurrentProjectSceneHost.Child = CurrentProjectScene
CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 1)
CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1)
Me.SceneGrid.Children.Add(CurrentProjectSceneHost)
'Creazione delle Page UserControl
m_SceneButtons = New SceneButtonsUC
' Imposto OnIdle
AddHandler m_IdleTimer.Tick, AddressOf OnIdle
End Sub
Private Sub ManageSingleIstance()
Dim bCreated As Boolean
Try
m_objMutex = New Mutex(False, "Global\OmagView", bCreated)
Catch
bCreated = False
End Try
If Not bCreated Then
' porto in primo piano la prima istanza
Dim bFound As Boolean = False
' processi del programma a 32 bit
Dim localProc As Process() = Process.GetProcessesByName("OmagViewR32")
For Each p As Process In localProc
If p.Id <> Process.GetCurrentProcess().Id Then
bFound = True
ShowWindow(p.MainWindowHandle, 1)
Exit For
End If
Next
' se non trovati processi a 32 bit provo a 64 bit
If Not bFound Then
localProc = Process.GetProcessesByName("OmagViewR64")
For Each p As Process In localProc
If p.Id <> Process.GetCurrentProcess().Id Then
bFound = True
ShowWindow(p.MainWindowHandle, SW.RESTORE)
Exit For
End If
Next
End If
' esco dal programma
End
End If
End Sub
Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles Me.Loaded
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, GetIniFile())
CurrentProjectScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(211, 211, 211)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, GetIniFile())
Dim BackBotColor As New Color3d(211, 211, 211)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, GetIniFile())
CurrentProjectScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, GetIniFile())
CurrentProjectScene.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, GetIniFile())
CurrentProjectScene.SetSelSurfMaterial(SelSurfColor)
' imposto tipo e colore del rettangolo di zoom
Dim bOutline As Boolean = True
Dim ZwColor As New Color3d(0, 0, 0)
GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, GetIniFile())
CurrentProjectScene.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, GetIniFile())
CurrentProjectScene.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, GetIniFile())
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, GetIniFile()) <> 0)
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, GetIniFile())
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, GetIniFile())
CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
If Not CurrentProjectScene.Init() Then
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
Me.SceneGrid.Children.Remove(CurrentProjectSceneHost)
Dim MissingKeyWnd As New EgtMsgBox(Me, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
Me.Close()
End If
' Inizializzo gestore lavorazioni
EgtInitMachMgr(GetMachinesRootDir())
m_bFirst = False
' Carico progetto in scarico
If Not LoadProject(m_sTempDir & "\CurrProj.nge") Then
NewProject()
End If
EgtZoom(ZM.ALL)
' inibisco selezione diretta da Scene
CurrentProjectScene.SetStatusNull()
'Posizionemento nella griglia delle Page UserControl
m_SceneButtons.SetValue(Grid.ColumnProperty, 1)
MainTabGrid.Children.Add(m_SceneButtons)
' Lancio timer per aggiornamento interfaccia
m_IdleTimer.Interval = TimeSpan.FromMilliseconds(100)
m_IdleTimer.Start()
End Sub
Private Sub OptionsBtn_Click(sender As Object, e As RoutedEventArgs) Handles OptionsBtn.Click
OptionsBtn.IsChecked = True
End Sub
Private Sub MainWindow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) Handles Me.PreviewMouseDown
End Sub
Private Sub MainWindow_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
'If (m_NumericKeyboardWD.IsVisible And e.Key = Key.Enter) Then
' m_NumericKeyboardWD.Visibility = Windows.Visibility.Hidden
'End If
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseDownScene
' Si può selezionare solo con il tasto sinistro e se stato NULL
If e.Button <> Windows.Forms.MouseButtons.Left Or
Not CurrentProjectScene.IsStatusNull() Then
Return
End If
' Identificativo del grezzo
Dim nRawId As Integer = EgtGetFirstRawPart()
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelect(True, True, True, True, True)
Dim nSel As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
Dim bPartInTable As Boolean = (EgtGetParent(nPartId) = nRawId)
If EgtIsPart(nPartId) Or bPartInTable Then
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nPartId, nStat)
' Se già selezionato deseleziono
If nStat = GDB_ST.SEL Then
EgtDeselectObj(nPartId)
Else
EgtDeselectAll()
EgtSelectObj(nPartId)
End If
EgtDraw()
Exit While
End If
nId = EgtGetNextObjInSelWin()
End While
End Sub
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs)
' Uscita
MainWindow_Unloaded(sender, e)
Me.Close()
End Sub
Private Sub MainWindow_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
' Terminazione generale di EgtInterface
EgtExit()
' Rilascio mutex
m_objMutex.Close()
End Sub
Private Sub MainWindow_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
End Sub
Private Sub EgtWPFInit()
'EgtBasicInfo
EgtWPFLib.InitializeEgtWPFLib.EgtBasicInfo_Initialization("C:/EgtDev/OmagVIEW",
1280, 1024, 15, 12,
"/#Century Gothic",
"/gothic.ttf",
Application.Current.FindResource("FontSize_UpperCaseCharacter"),
Application.Current.FindResource("FontSize_LowerCaseCharacter"))
' EgtMessageBox
EgtWPFLib.InitializeEgtWPFLib.EgtMsgBox_Initialization(Application.Current.FindResource("OmagCut_WindowBorder"),
Application.Current.FindResource("OmagCut_WindowGrayTextButton"),
Nothing,
Application.Current.FindResource("FontSize_UpperCaseCharacter"),
Application.Current.FindResource("FontSize_LowerCaseCharacter"))
'Inizializzazione della libreria
EgtWPFLib.InitializeEgtWPFLib.EgtPaths_Initialization()
End Sub
' OnIdle
Private Sub OnIdle()
End Sub
' Evento che apre AboutBox quando viene clickato il logo
Private Sub LogoBrd_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles LogoBrd.MouseDown
Dim AboutBox As New AboutBoxWD(Me)
End Sub
Private Function LoadProject(ByVal sPath As String) As Boolean
' Carico il file
If Not EgtOpenFile(sPath) Then
Return False
End If
' Recupero il gruppo di lavoro del file
Dim nMachGrpId As Integer = EgtGetFirstMachGroup()
If nMachGrpId = GDB_ID.NULL Then
Return False
End If
' Carico il gruppo e verifico che la sua macchina sia quella corrente
Dim sFileMachine As String = String.Empty
If Not EgtSetCurrMachGroup(nMachGrpId) Then
EgtGetInfo(nMachGrpId, "Machine", sFileMachine)
Else
EgtGetCurrMachineName(sFileMachine)
End If
' Visualizzo solo la tavola della macchina
EgtShowOnlyTable(True)
Return True
End Function
Friend Function NewProject() As Boolean
' Imposto il nuovo progetto
EgtNewFile()
' Recupero nome macchina corrente
Dim sMachine As String = String.Empty
GetPrivateProfileString(S_MACH, K_CURRMACH, "", sMachine, m_sIniFile)
' Creo un gruppo di lavoro e carico la macchina corrente
If EgtAddMachGroup(MACH_GROUP, sMachine) = GDB_ID.NULL Then
Return False
End If
' Imposto la tavola corrente
If Not EgtSetTable(MAIN_TAB) Then
Return False
End If
EgtShowOnlyTable(True)
Return True
End Function
End Class
+59
View File
@@ -0,0 +1,59 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Globalization
Imports System.Resources
Imports 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.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("OmagVIEW 32 bit")>
<Assembly: AssemblyDescription("OmagVIEWR32.exe")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("OmagVIEW")>
<Assembly: AssemblyCopyright("Copyright © 2016-2016 by EgalTech s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
'In order to begin building localizable applications, set
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj 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)>
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
'1st parameter: where theme specific resource dictionaries are located
'(used if a resource is not found in the page,
' or application resource dictionaries)
'2nd parameter: where the generic resource dictionary is located
'(used if a resource is not found in the page,
'app, and any theme specific resource dictionaries)
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("d912881b-e176-474a-af2b-f07f2032db8b")>
' 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.6.18.10")>
<Assembly: AssemblyFileVersion("1.6.18.10")>
+121
View File
@@ -0,0 +1,121 @@
#If _MyType <> "Empty" Then
Namespace My
''' <summary>
''' Module used to define the properties that are available in the My Namespace for WPF
''' </summary>
''' <remarks></remarks>
<Global.Microsoft.VisualBasic.HideModuleName()> _
Module MyWpfExtension
Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
''' <summary>
''' Returns the application object for the running application
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Application() As Application
Get
Return CType(Global.System.Windows.Application.Current, Application)
End Get
End Property
''' <summary>
''' Returns information about the host computer.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
Get
Return s_Computer.GetInstance()
End Get
End Property
''' <summary>
''' Returns information for the current user. If you wish to run the application with the current
''' Windows user credentials, call My.User.InitializeWithWindowsUser().
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
Get
Return s_User.GetInstance()
End Get
End Property
''' <summary>
''' Returns the application log. The listeners can be configured by the application's configuration file.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
Get
Return s_Log.GetInstance()
End Get
End Property
''' <summary>
''' Returns the collection of Windows defined in the project.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Windows() As MyWindows
<Global.System.Diagnostics.DebuggerHidden()> _
Get
Return s_Windows.GetInstance()
End Get
End Property
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
<Global.Microsoft.VisualBasic.MyGroupCollection("System.Windows.Window", "Create__Instance__", "Dispose__Instance__", "My.MyWpfExtenstionModule.Windows")> _
Friend NotInheritable Class MyWindows
<Global.System.Diagnostics.DebuggerHidden()> _
Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
If Instance Is Nothing Then
If s_WindowBeingCreated IsNot Nothing Then
If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
End If
Else
s_WindowBeingCreated = New Global.System.Collections.Hashtable()
End If
s_WindowBeingCreated.Add(GetType(T), Nothing)
Return New T()
s_WindowBeingCreated.Remove(GetType(T))
Else
Return Instance
End If
End Function
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
<Global.System.Diagnostics.DebuggerHidden()> _
Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
instance = Nothing
End Sub
<Global.System.Diagnostics.DebuggerHidden()> _
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Public Sub New()
MyBase.New()
End Sub
<Global.System.ThreadStatic()> Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function Equals(ByVal o As Object) As Boolean
Return MyBase.Equals(o)
End Function
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function GetHashCode() As Integer
Return MyBase.GetHashCode
End Function
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Friend Overloads Function [GetType]() As Global.System.Type
Return GetType(MyWindows)
End Function
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function ToString() As String
Return MyBase.ToString
End Function
End Class
End Module
End Namespace
Partial Class Application
Inherits Global.System.Windows.Application
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
<Global.System.Diagnostics.DebuggerHidden()> _
Get
Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
End Get
End Property
End Class
#End If
+63
View File
@@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'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.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("OmagVIEW.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<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)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace
+117
View 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>
+71
View File
@@ -0,0 +1,71 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.OmagVIEW.MySettings
Get
Return Global.OmagVIEW.MySettings.Default
End Get
End Property
End Module
End Namespace
+7
View File
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+22
View File
@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "OmagVIEW", "OmagVIEW.vbproj", "{33137AF2-9126-46C4-9650-3E529B68CF9B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{33137AF2-9126-46C4-9650-3E529B68CF9B}.Debug|x86.ActiveCfg = Debug|x86
{33137AF2-9126-46C4-9650-3E529B68CF9B}.Debug|x86.Build.0 = Debug|x86
{33137AF2-9126-46C4-9650-3E529B68CF9B}.Release|x86.ActiveCfg = Release|x86
{33137AF2-9126-46C4-9650-3E529B68CF9B}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+215
View File
@@ -0,0 +1,215 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" 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>{33137AF2-9126-46C4-9650-3E529B68CF9B}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<OutputType>WinExe</OutputType>
<RootNamespace>OmagVIEW</RootNamespace>
<AssemblyName>OmagVIEW</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MyType>Custom</MyType>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<IncrementalBuild>true</IncrementalBuild>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>
</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugSymbols>false</DebugSymbols>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<IncrementalBuild>false</IncrementalBuild>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>
</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtUILib">
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
</Reference>
<Reference Include="EgtWPFLib">
<HintPath>..\..\EgtProg\DllD32\EgtWPFLib.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="Application.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="AboutBoxWD.xaml.vb">
<DependentUpon>AboutBoxWD.xaml</DependentUpon>
</Compile>
<Compile Include="EgtDictionary.xaml.vb">
<DependentUpon>EgtDictionary.xaml</DependentUpon>
</Compile>
<Compile Include="OmagVIEWDictionary.xaml.vb">
<DependentUpon>OmagVIEWDictionary.xaml</DependentUpon>
</Compile>
<Compile Include="OptionsPageUC.xaml.vb">
<DependentUpon>OptionsPageUC.xaml</DependentUpon>
</Compile>
<Compile Include="SceneButtonsUC.xaml.vb">
<DependentUpon>SceneButtonsUC.xaml</DependentUpon>
</Compile>
<Compile Include="Utility.vb" />
<Page Include="AboutBoxWD.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="EgtDictionary.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="Application.xaml.vb">
<DependentUpon>Application.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ConstGen.vb" />
<Compile Include="ConstIni.vb" />
<Compile Include="ConstMsg.vb" />
<Compile Include="MainWindow.xaml.vb">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="OmagVIEWDictionary.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="OptionsPageUC.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SceneButtonsUC.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows" />
<Import Include="System.Windows.Controls" />
<Import Include="System.Windows.Data" />
<Import Include="System.Windows.Documents" />
<Import Include="System.Windows.Input" />
<Import Include="System.Windows.Shapes" />
<Import Include="System.Windows.Media" />
<Import Include="System.Windows.Media.Imaging" />
<Import Include="System.Windows.Navigation" />
</ItemGroup>
<ItemGroup>
<Compile Include="My Project\AssemblyInfo.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="My Project\MyExtensions\MyWpfExtension.vb">
<VBMyExtensionTemplateID>Microsoft.VisualBasic.WPF.MyExtension</VBMyExtensionTemplateID>
<VBMyExtensionTemplateVersion>1.0.0.0</VBMyExtensionTemplateVersion>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
</EmbeddedResource>
<None Include="app.config" />
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<AppDesigner Include="My Project\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\GenericView.png" />
<Resource Include="Resources\LookFromTOP.png" />
<Resource Include="Resources\Pan.png" />
<Resource Include="Resources\ZoomAll.png" />
<Resource Include="Resources\ZoomIn.png" />
<Resource Include="Resources\ZoomOut.png" />
<Resource Include="Resources\ZoomWin.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\LogoOmag.jpg" />
<Resource Include="Resources\Options.png" />
<Resource Include="Resources\V.png" />
<Resource Include="Resources\X.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagVIEW\OmagVIEWR32.exe
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\OmagVIEW\OmagVIEWD32.exe</PostBuildEvent>
</PropertyGroup>
</Project>
File diff suppressed because it is too large Load Diff
+322
View File
@@ -0,0 +1,322 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Partial Class OmagCUTDictionary
Inherits ResourceDictionary
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
' Evento della TextBox con Style che permette di aprire in automatico la calcolatrice
'Friend Sub NumericKeyboard_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
' ' Recupero dati da sorgente
' Dim sTitle As String = String.Empty
' Dim sText As String = String.Empty
' Dim TxBx As TextBox = CType(e.Source, TextBox)
' If Not IsNothing(TxBx) Then
' sText = TxBx.Text
' Dim AssocLabel As Label = TxBx.Tag
' If Not IsNothing(AssocLabel) Then
' sTitle = AssocLabel.Content
' End If
' End If
' ' Creo calcolatrice
' Dim NumericKeyboardWD As New NumericKeyboardWD(sTitle, sText, e.Source)
' ' La visualizzo
' NumericKeyboardWD.ShowDialog()
'End Sub
' Evento della TextBox con Style che permette di aggiornare in automatico il componente con il nuovo valore
'Private Sub NumericKeyboard_TextChanged(sender As Object, e As TextChangedEventArgs)
' Select Case m_MainWindow.m_ActivePage
' Case MainWindow.Pages.Draw
' If Not m_MainWindow.m_DrawPageUC.m_bShowVar Then
' m_MainWindow.m_DrawPageUC.UpdateView()
' End If
' Case MainWindow.Pages.RawPart
' If Not m_MainWindow.m_RawPartPage.m_bShowVar Then
' m_MainWindow.m_RawPartPage.UpdateRawPart()
' End If
' End Select
'End Sub
End Class
Namespace TreeViewItem
Public Class CathegoryItem
Inherits TreeViewItemBase
'Private m_sTitle As String
Private m_sPictureString As String
Private m_nFType As Integer
Private m_Items As ObservableCollection(Of CustomItem)
'Public Property Name As String
' Get
' Return m_sTitle
' End Get
' Set(value As String)
' m_sTitle = value
' End Set
'End Property
Public ReadOnly Property PictureString As String
Get
Return "/Resources/ToolsTreeViewImages/Lama.png"
End Get
End Property
Public ReadOnly Property nFType As Integer
Get
Return m_nFType
End Get
End Property
Public Property Items As ObservableCollection(Of CustomItem)
Get
Return m_Items
End Get
Set(value As ObservableCollection(Of CustomItem))
m_Items = value
End Set
End Property
Sub New(sName As String, nType As Integer)
Name = sName
m_nFType = nType
Me.Items = New ObservableCollection(Of CustomItem)
End Sub
End Class
Public Class CustomItem
Inherits TreeViewItemBase
'Private m_sTitle As String
Private m_nType As Integer
'Public Property Name As String
' Get
' Return m_sTitle
' End Get
' Set(value As String)
' m_sTitle = value
' End Set
'End Property
Public ReadOnly Property nType As Integer
Get
Return m_nType
End Get
End Property
Sub New(Title As String, nType As Integer)
Me.Name = Title
m_nType = nType
End Sub
End Class
Public Class PartCathegoryItem
Inherits TreeViewItemBase
'Private m_sTitle As String
Private m_sPictureString As String
Private m_nFType As Integer
Private m_Items As ObservableCollection(Of PartCustomItem)
'Public Property Name As String
' Get
' Return m_sTitle
' End Get
' Set(value As String)
' m_sTitle = value
' End Set
'End Property
Public ReadOnly Property PictureString As String
Get
Return "/Resources/ToolsTreeViewImages/Lama.png"
End Get
End Property
Public ReadOnly Property nFType As Integer
Get
Return m_nFType
End Get
End Property
Public Property Items As ObservableCollection(Of PartCustomItem)
Get
Return m_Items
End Get
Set(value As ObservableCollection(Of PartCustomItem))
m_Items = value
End Set
End Property
Sub New(sName As String, nType As Integer)
Name = sName
m_nFType = nType
Me.Items = New ObservableCollection(Of PartCustomItem)
End Sub
End Class
Public Class PartCustomItem
Inherits TreeViewItemBase
'Private m_sTitle As String
Private m_nType As Integer
Private m_bIsActive As Boolean
Private m_sText1 As String
Private m_sText2 As String
Public Property sText1 As String
Get
Return m_sText1
End Get
Set(value As String)
m_sText1 = value
NotifyPropertyChanged("sText1")
End Set
End Property
Public Property sText2 As String
Get
Return m_sText2
End Get
Set(value As String)
m_sText2 = value
NotifyPropertyChanged("sText2")
End Set
End Property
Public ReadOnly Property nType As Integer
Get
Return m_nType
End Get
End Property
Public Property bIsActive As Boolean
Get
Return m_bIsActive
End Get
Set(value As Boolean)
If value <> m_bIsActive Then
m_bIsActive = value
NotifyPropertyChanged("bIsActive")
End If
End Set
End Property
Sub New(Title As String, nType As Integer, sText1 As String, sText2 As String)
Me.Name = Title
m_nType = nType
m_sText1 = sText1
m_sText2 = sText2
m_bIsActive = True
End Sub
Sub New(Title As String, nType As Integer, sText1 As String, sText2 As String, bIsActive As Boolean)
Me.Name = Title
m_nType = nType
m_sText1 = sText1
m_sText2 = sText2
m_bIsActive = bIsActive
End Sub
End Class
Public Class TreeViewItemBase
Implements INotifyPropertyChanged
Private m_Name As String
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
If (value <> m_Name) Then
m_Name = value
NotifyPropertyChanged("Name")
End If
End Set
End Property
Private m_isSelected As Boolean
Public Property IsSelected As Boolean
Get
Return m_isSelected
End Get
Set(value As Boolean)
If (value <> m_isSelected) Then
m_isSelected = value
NotifyPropertyChanged("IsSelected")
End If
End Set
End Property
Private m_isExpanded As Boolean
Public Property IsExpanded As Boolean
Get
Return m_isExpanded
End Get
Set(value As Boolean)
If (value <> m_isExpanded) Then
m_isExpanded = value
NotifyPropertyChanged("IsExpanded")
End If
End Set
End Property
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Public Sub NotifyPropertyChanged(propName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
End Sub
End Class
End Namespace
Namespace ArithmeticConverterNameSpace
Public Class CheckboxConverter
Implements IMultiValueConverter
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert
If values.Length <> 2 Then
Throw New ArgumentException("There should be three values.")
End If
If String.IsNullOrEmpty(values(0).ToString) Then
values(0) = "0"
End If
If String.IsNullOrEmpty(values(1).ToString()) Then
values(2) = "0"
End If
Dim x As Double
If Not Double.TryParse(values(0).ToString(), x) Then
Throw New ArgumentException("values[0] must parse to double")
End If
Dim y As Double
If Not Double.TryParse(values(1).ToString(), y) Then
Throw New ArgumentException("values[0] must parse to double")
End If
Return (x / y) - 1
End Function
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
End Namespace
+76
View File
@@ -0,0 +1,76 @@
<UserControl x:Class="OptionsPageUC"
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"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<!-- Definizione della OptionsPage -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="7.5*"/>
</Grid.RowDefinitions>
<GroupBox Name="LanguageGpBx" Grid.RowSpan="2" Style="{StaticResource OmagCut_GroupBox}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Name="LanguageCmBx" Grid.Column="1" Grid.Row="1" MinWidth="49" Height="40">
<ComboBox.ItemTemplate>
<DataTemplate>
<Label Content="{Binding LanguageName}" FontSize="20" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="LanguageMsgTxBl" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
</Grid>
</GroupBox>
<GroupBox Name="UnitsOfMeasureGpBx" Grid.Column="1" Style="{StaticResource OmagCut_GroupBox}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<ComboBox Name="UnitsOfMeasureCmBx" Grid.Column="1" Grid.Row="1" Height="40">
<ComboBox.ItemTemplate>
<DataTemplate>
<Label Content="{Binding}" FontSize="20" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</GroupBox>
</Grid>
</UserControl>
+40
View File
@@ -0,0 +1,40 @@
Imports EgtUILib
Public Class OptionsPageUC
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
Private UnitsList() As String = {"inch", "mm"}
Private Sub OptionsPageUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Associazione della lista linguaggi alla combobox
LanguageCmBx.ItemsSource = m_MainWindow.m_LanguagesList
' Associazione della lista unità di misura alla combobox
UnitsOfMeasureCmBx.ItemsSource = UnitsList
' Imposto la lingua corrente
LanguageCmBx.SelectedItem = m_MainWindow.m_CurrLanguage
' Imposto l'unità di misura corrente
UnitsOfMeasureCmBx.SelectedIndex = If(EgtUiUnitsAreMM(), 1, 0)
' Messaggi
LanguageGpBx.Header = EgtMsg(MSG_OPTIONSPAGEUC + 1)
LanguageMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 2)
UnitsOfMeasureGpBx.Header = EgtMsg(MSG_OPTIONSPAGEUC + 3)
End Sub
Private Sub LanguageCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles LanguageCmBx.SelectionChanged
m_MainWindow.m_CurrLanguage = LanguageCmBx.SelectedItem
WritePrivateProfileString(S_GENERAL, K_MESSAGES, m_MainWindow.m_CurrLanguage.LanguageName, m_MainWindow.GetIniFile())
End Sub
Private Sub UnitsOfMeasureCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles UnitsOfMeasureCmBx.SelectionChanged
Dim bMM As Boolean = (UnitsOfMeasureCmBx.SelectedIndex <> 0)
EgtSetUiUnits(bMM)
'm_MainWindow.m_CurrentProjectPageUC.UpdateHeightTxBx()
WritePrivateProfileString(S_GENERAL, K_MMUNITS, If(bMM, 1, 0), m_MainWindow.GetIniFile())
End Sub
End Class
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+50
View File
@@ -0,0 +1,50 @@
<UserControl x:Class="SceneButtonsUC"
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"
mc:Ignorable="d"
d:DesignHeight="85.3" d:DesignWidth="597.1">
<!-- Chiamata al Dictionary -->
<!--<UserControl.Resources>
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
</UserControl.Resources>-->
<!-- Definizione del controllo SceneButton -->
<Grid Name="SceneButtonsGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="ZoomAllBtn" Grid.Column="0" Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/ZoomAll.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ZoomInBtn" Grid.Column="1" Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/ZoomIn.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ZoomOutBtn" Grid.Column="2" Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/ZoomOut.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ZoomWinBtn" Grid.Column="3" Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/ZoomWin.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="PanBtn" Grid.Column="4" Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/Pan.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="GenericViewBtn" Grid.Column="5" Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/GenericView.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="TopViewBtn" Grid.Column="6" Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/LookFromTOP.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</UserControl>
+52
View File
@@ -0,0 +1,52 @@
Imports EgtUILib
Public Class SceneButtonsUC
'Riferimento alla MainWindow
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
Private Sub ZoomAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomAllBtn.Click
EgtZoom(ZM.ALL)
End Sub
Private Sub ZoomInBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomInBtn.Click
EgtZoom(ZM.IN_)
End Sub
Private Sub ZoomOutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomOutBtn.Click
EgtZoom(ZM.OUT)
End Sub
Private Sub ZoomWinBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomWinBtn.Click
GetCurrScene.SetStatusZoomWin()
End Sub
Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click
GetCurrScene.SetStatusPan()
End Sub
Private Sub GenericViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles GenericViewBtn.Click
If Keyboard.IsKeyDown(Key.T) Then
EgtSetView(VT.TOP)
ElseIf Keyboard.IsKeyDown(Key.F) Then
EgtSetView(VT.FRONT)
ElseIf Keyboard.IsKeyDown(Key.B) Then
EgtSetView(VT.BACK)
ElseIf Keyboard.IsKeyDown(Key.L) Then
EgtSetView(VT.LEFT)
ElseIf Keyboard.IsKeyDown(Key.R) Then
EgtSetView(VT.RIGHT)
Else
GetCurrScene.SetStatusRot()
End If
End Sub
Private Sub TopViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles TopViewBtn.Click
EgtSetView(VT.TOP)
End Sub
Private Function GetCurrScene() As EgtUILib.Scene
Return m_MainWindow.CurrentProjectScene
End Function
End Class
+102
View File
@@ -0,0 +1,102 @@
Imports System.Globalization
Imports EgtUILib
Module Utility
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
' Costringo ad aggiornare UI
Dim nDummy As Integer
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
New Action(Function() nDummy = 0))
End Sub
'--------------------------------------------------------------------------------------------------
Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
If nNumDec > 0 Then
Return sVal.TrimEnd("0".ToCharArray()).TrimEnd(".".ToCharArray)
Else
Return sVal
End If
End Function
Friend Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean
Return EgtLuaEvalNumExpr(sVal, dVal)
End Function
Friend Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
Return DoubleToString(EgtToUiUnits(dVal), nNumDec)
End Function
Friend Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean
If EgtLuaEvalNumExpr(sVal, dVal) Then
dVal = EgtFromUiUnits(dVal)
Return True
Else
Return False
End If
End Function
Friend Function UIExprToExpr(ByVal sUIExpr) As String
If String.IsNullOrWhiteSpace(sUIExpr) Then
Return ""
End If
Return sUIExpr.Replace("""", "*GEO.ONE_INCH")
End Function
Friend Function ExprToUIExpr(ByVal sExpr) As String
If String.IsNullOrWhiteSpace(sExpr) Then
Return ""
End If
Return sExpr.Replace("*GEO.ONE_INCH", """")
End Function
'--------------------------------------------------------------------------------------------------
Public Class Language
Private m_sLanguageName As String
Private m_sFileName As String
Public Property LanguageName As String
Get
Return m_sLanguageName
End Get
Set(value As String)
m_sLanguageName = value
End Set
End Property
Public Property FileName As String
Get
Return m_sFileName
End Get
Set(value As String)
m_sFileName = value
End Set
End Property
Sub New(LanguageName As String, FileName As String)
Me.LanguageName = LanguageName
Me.FileName = FileName
End Sub
End Class
Public Function GetPrivateProfileLanguage(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByVal 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
End Module
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information"/>
</switches>
<sharedListeners>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>