Creazione finestra di dialogo e aggiornamento rettangoli colore del ColorPicker
This commit is contained in:
@@ -225,54 +225,54 @@ Public Class EgtColorPickerV
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Converte il colore selezionato da HLS ( tonalità, luminosità, saturazione) in RGB
|
||||
''' </summary>
|
||||
''' <param name="h">Tonalità del colore selezionato espressa in double</param>
|
||||
''' <param name="l">Luminosità del colore selezionato espressa in double</param>
|
||||
''' <param name="s">Saturazione del colore selezionato espressa in double</param>
|
||||
''' <param name="r">Colore Rosso restituito dalla funzione espresso in intero</param>
|
||||
''' <param name="g">Colore Verde restituito dalla funzione espresso in intero</param>
|
||||
''' <param name="b">Colore Blu restituito dalla funzione espresso in intero</param>
|
||||
Private Shared Sub HlsToRgb(ByVal h As Double, ByVal l As Double, ByVal s As Double, <Out> ByRef r As Integer, <Out> ByRef g As Integer, <Out> ByRef b As Integer)
|
||||
Dim p2 As Double
|
||||
'''' <summary>
|
||||
'''' Converte il colore selezionato da HLS ( tonalità, luminosità, saturazione) in RGB
|
||||
'''' </summary>
|
||||
'''' <param name="h">Tonalità del colore selezionato espressa in double</param>
|
||||
'''' <param name="l">Luminosità del colore selezionato espressa in double</param>
|
||||
'''' <param name="s">Saturazione del colore selezionato espressa in double</param>
|
||||
'''' <param name="r">Colore Rosso restituito dalla funzione espresso in intero</param>
|
||||
'''' <param name="g">Colore Verde restituito dalla funzione espresso in intero</param>
|
||||
'''' <param name="b">Colore Blu restituito dalla funzione espresso in intero</param>
|
||||
'Private Shared Sub HlsToRgb(ByVal h As Double, ByVal l As Double, ByVal s As Double, <Out> ByRef r As Integer, <Out> ByRef g As Integer, <Out> ByRef b As Integer)
|
||||
' Dim p2 As Double
|
||||
|
||||
If l <= 0.5 Then
|
||||
p2 = l * (1 + s)
|
||||
Else
|
||||
p2 = l + s - l * s
|
||||
End If
|
||||
' If l <= 0.5 Then
|
||||
' p2 = l * (1 + s)
|
||||
' Else
|
||||
' p2 = l + s - l * s
|
||||
' End If
|
||||
|
||||
Dim p1 As Double = 2 * l - p2
|
||||
Dim double_r, double_g, double_b As Double
|
||||
' Dim p1 As Double = 2 * l - p2
|
||||
' Dim double_r, double_g, double_b As Double
|
||||
|
||||
If s = 0 Then
|
||||
double_r = l
|
||||
double_g = l
|
||||
double_b = l
|
||||
Else
|
||||
double_r = QqhToRgb(p1, p2, h + 120)
|
||||
double_g = QqhToRgb(p1, p2, h)
|
||||
double_b = QqhToRgb(p1, p2, h - 120)
|
||||
End If
|
||||
' If s = 0 Then
|
||||
' double_r = l
|
||||
' double_g = l
|
||||
' double_b = l
|
||||
' Else
|
||||
' double_r = QqhToRgb(p1, p2, h + 120)
|
||||
' double_g = QqhToRgb(p1, p2, h)
|
||||
' double_b = QqhToRgb(p1, p2, h - 120)
|
||||
' End If
|
||||
|
||||
r = CInt((double_r * 255.0))
|
||||
g = CInt((double_g * 255.0))
|
||||
b = CInt((double_b * 255.0))
|
||||
End Sub
|
||||
' r = CInt((double_r * 255.0))
|
||||
' g = CInt((double_g * 255.0))
|
||||
' b = CInt((double_b * 255.0))
|
||||
'End Sub
|
||||
|
||||
Private Shared Function QqhToRgb(ByVal q1 As Double, ByVal q2 As Double, ByVal hue As Double) As Double
|
||||
If hue > 360 Then
|
||||
hue -= 360
|
||||
ElseIf hue < 0 Then
|
||||
hue += 360
|
||||
End If
|
||||
'Private Shared Function QqhToRgb(ByVal q1 As Double, ByVal q2 As Double, ByVal hue As Double) As Double
|
||||
' If hue > 360 Then
|
||||
' hue -= 360
|
||||
' ElseIf hue < 0 Then
|
||||
' hue += 360
|
||||
' End If
|
||||
|
||||
If hue < 60 Then Return q1 + (q2 - q1) * hue / 60
|
||||
If hue < 180 Then Return q2
|
||||
If hue < 240 Then Return q1 + (q2 - q1) * (240 - hue) / 60
|
||||
Return q1
|
||||
End Function
|
||||
' If hue < 60 Then Return q1 + (q2 - q1) * hue / 60
|
||||
' If hue < 180 Then Return q2
|
||||
' If hue < 240 Then Return q1 + (q2 - q1) * (240 - hue) / 60
|
||||
' Return q1
|
||||
'End Function
|
||||
|
||||
''' <summary>
|
||||
''' Apre una finestra EgtColorPicker
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports System.Reflection
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class EgtColorPickerVM
|
||||
Inherits VMBase
|
||||
@@ -223,10 +222,11 @@ Public Class EgtColorPickerVM
|
||||
Set(value As String)
|
||||
If StringToDouble(value, m_Red) And (m_Red >= 0 AndAlso m_Red <= 255) Then
|
||||
UpdateRed(m_Red)
|
||||
m_Red = value
|
||||
'm_Red = value
|
||||
m_Fill = New SolidColorBrush(Color.FromRgb(m_Red, m_Green, m_Blue))
|
||||
SetCurrColorFill(m_Fill.Color)
|
||||
NotifyPropertyChanged(NameOf(Fill))
|
||||
NotifyPropertyChanged(NameOf(Red))
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(Red))
|
||||
End If
|
||||
@@ -244,8 +244,7 @@ Public Class EgtColorPickerVM
|
||||
Return DoubleToString(RgbColor.G, 0)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If StringToDouble(value, m_Green) And (m_Red >= 0 AndAlso m_Red <= 255) And
|
||||
(m_Green >= 0 AndAlso m_Green <= 255) And (m_Blue >= 0 AndAlso m_Blue <= 255) Then
|
||||
If StringToDouble(value, m_Green) And (m_Green >= 0 AndAlso m_Green <= 255) Then
|
||||
UpdateGreen(value)
|
||||
m_Green = value
|
||||
m_Fill = New SolidColorBrush(Color.FromRgb(m_Red, m_Green, m_Blue))
|
||||
@@ -268,8 +267,7 @@ Public Class EgtColorPickerVM
|
||||
Return DoubleToString(RgbColor.B, 0)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If StringToDouble(value, m_Blue) And (m_Red >= 0 AndAlso m_Red <= 255) And
|
||||
(m_Green >= 0 AndAlso m_Green <= 255) And (m_Blue >= 0 AndAlso m_Blue <= 255) Then
|
||||
If StringToDouble(value, m_Blue) And (m_Blue >= 0 AndAlso m_Blue <= 255) Then
|
||||
UpdateBlue(value)
|
||||
m_Blue = value
|
||||
m_Fill = New SolidColorBrush(Color.FromRgb(m_Red, m_Green, m_Blue))
|
||||
@@ -521,11 +519,13 @@ Public Class EgtColorPickerVM
|
||||
Dim RGBColor As Color = HSLColor.HslToRgb(m_HSLColor)
|
||||
Dim h, s, l As Double
|
||||
HSLColor.RgbToHsl(Color.FromRgb(value, RGBColor.G, RGBColor.B), h, s, l)
|
||||
SetRed(value)
|
||||
m_HSLColor.SetHue(h)
|
||||
m_HSLColor.SetSaturation(s)
|
||||
m_HSLColor.SetLightness(l)
|
||||
NotifyPropertyChanged(NameOf(CurrColor))
|
||||
SetLightnessColor()
|
||||
UpdateHue()
|
||||
UpdateSaturation()
|
||||
UpdateLightness()
|
||||
NotifyPropertyChanged(NameOf(Red))
|
||||
@@ -542,6 +542,7 @@ Public Class EgtColorPickerVM
|
||||
m_HSLColor.SetLightness(l)
|
||||
NotifyPropertyChanged(NameOf(CurrColor))
|
||||
SetLightnessColor()
|
||||
UpdateHue()
|
||||
UpdateSaturation()
|
||||
UpdateLightness()
|
||||
NotifyPropertyChanged(NameOf(Red))
|
||||
@@ -559,6 +560,7 @@ Public Class EgtColorPickerVM
|
||||
m_HSLColor.SetLightness(l)
|
||||
NotifyPropertyChanged(NameOf(CurrColor))
|
||||
SetLightnessColor()
|
||||
UpdateHue()
|
||||
UpdateSaturation()
|
||||
UpdateLightness()
|
||||
NotifyPropertyChanged(NameOf(Red))
|
||||
@@ -823,17 +825,22 @@ Public Class HSLColor
|
||||
Dim dRPrimo As Double = r / 255
|
||||
Dim dGPrimo As Double = g / 255
|
||||
Dim dBPrimo As Double = b / 255
|
||||
Dim CMax As Double = Math.Max(Math.Max(dRPrimo, dGPrimo), dBPrimo)
|
||||
Dim CMin As Double = Math.Min(Math.Min(dRPrimo, dGPrimo), dBPrimo)
|
||||
Dim CMax As Double = Math.Max(dRPrimo, Math.Max(dGPrimo, dBPrimo))
|
||||
Dim CMin As Double = Math.Min(dRPrimo, Math.Min(dGPrimo, dBPrimo))
|
||||
Dim Delta As Double = CMax - CMin
|
||||
If Delta = 0 Then
|
||||
h = 0
|
||||
ElseIf CMax = dRPrimo Then
|
||||
h = 60 * (((dGPrimo - dBPrimo) / Delta) Mod 6)
|
||||
Dim hMod = (((dGPrimo - dBPrimo) / Delta) Mod 6)
|
||||
If hMod < 0 Then
|
||||
h = 60 * (hMod + 6)
|
||||
Else
|
||||
h = 60 * hMod
|
||||
End If
|
||||
ElseIf CMax = dGPrimo Then
|
||||
h = 60 * (((dBPrimo - dRPrimo) / Delta) + 2)
|
||||
h = 60 * ((dBPrimo - dRPrimo) / Delta + 2)
|
||||
ElseIf CMax = dBPrimo Then
|
||||
h = 60 * (((dRPrimo - dGPrimo) / Delta) + 4)
|
||||
h = 60 * ((dRPrimo - dGPrimo) / Delta + 4)
|
||||
End If
|
||||
|
||||
l = (CMax + CMin) / 2
|
||||
|
||||
@@ -0,0 +1,450 @@
|
||||
<EgtWPFLib5:EgtMainWindow x:Class="EgtManageFileDialogV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:local="clr-namespace:Icarus"
|
||||
Title="{Binding sTitle}"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Style="{StaticResource Dialog_Window}">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Command="{Binding GoBack_Command}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="2.5,0,0,0"
|
||||
Style="{StaticResource RightPanel_Button}">
|
||||
<Image Source="\Resources\EgtDialog\Restore.png"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1"
|
||||
Margin="5"
|
||||
Text="{Binding sUrl_Msg, Mode=TwoWay}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<ComboBox Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
ItemsSource="{Binding VisualizationList}"
|
||||
SelectedItem="{Binding SelVisualization}"
|
||||
Width="200"
|
||||
Margin="2.5,0,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}">
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TreeView x:Name="FileTree"
|
||||
ItemsSource="{Binding RootList}"
|
||||
Height="300"
|
||||
Width="200"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:EgtFolder}"
|
||||
ItemsSource="{Binding FolderList}">
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</HierarchicalDataTemplate>
|
||||
<DataTemplate DataType="{x:Type local:EgtItem}">
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
<TabControl Grid.Column="1"
|
||||
BorderBrush="White"
|
||||
BorderThickness="0"
|
||||
Background="White"
|
||||
SelectedIndex="{Binding nSelectView}">
|
||||
<TabItem Visibility="{Binding ListBox_Visibility}">
|
||||
<Grid Grid.Column="1"
|
||||
Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Name_Msg}"
|
||||
Visibility="{Binding UVision_Visibility}"
|
||||
Margin="5,5,5,5"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<ListBox x:Name="FileList"
|
||||
Grid.Row="1"
|
||||
Width="350"
|
||||
Height="250"
|
||||
Margin="5,5,5,5"
|
||||
BorderBrush="White"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelTreeItem.ItemSelected}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate x:Key="ScheduleTemplate"
|
||||
DataType="{x:Type local:EgtDirectory}" >
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="15"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="BoxingTemplate"
|
||||
DataType="{x:Type local:EgtDirectory}">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="65"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="3"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding sTypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding sDimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="ContentTemplateView"
|
||||
DataType="{x:Type local:EgtDirectory}">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="60"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sTypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Column="2"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding dLastModifyDate}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sDimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type local:EgtDirectory}">
|
||||
<ContentControl Content="{Binding}">
|
||||
<ContentControl.Style>
|
||||
<Style TargetType="{x:Type ContentControl}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DataContext.nTaskStatus, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="0">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource ScheduleTemplate}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.nTaskStatus, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="1">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource BoxingTemplate}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.nTaskStatus, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="2">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource ContentTemplateView}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ContentControl.Style>
|
||||
</ContentControl>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
||||
<!--<ListBox.ItemTemplate>
|
||||
<DataTemplate >
|
||||
<TextBlock Text="{Binding Name}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>-->
|
||||
|
||||
<!--<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="/Resources/ProjectManager/New.png"
|
||||
Height="65"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="3"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding Name}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding TypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding Dimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>-->
|
||||
|
||||
<!--<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="/Resources/ProjectManager/New.png"
|
||||
Height="60"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding Name}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding TypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Column="2"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding LastModifyDate}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding Dimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>-->
|
||||
<!--</DataTemplate>
|
||||
</ListBox.ItemTemplate>-->
|
||||
</ListBox>
|
||||
<UniformGrid Visibility="{Binding UVision_Visibility}"
|
||||
Grid.Column="1"
|
||||
Columns="3"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding LastModify_Msg}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding Type_Msg}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding Dimension_Msg}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Visibility="{Binding UVision_Visibility}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Columns="3"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Margin="5,5,5,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Text="{Binding SelectedItem.dLastModifyDate, ElementName=FileList}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
Margin="5,5,5,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Text="{Binding SelectedItem.sTypeItem, ElementName=FileList}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock Grid.Column="3"
|
||||
Grid.Row="1"
|
||||
Margin="5,5,5,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Text="{Binding SelectedItem.sDimension, ElementName=FileList}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Visibility="{Binding DataGrid_Visibility}">
|
||||
<DataGrid AutoGenerateColumns="False"
|
||||
Height="300"
|
||||
Margin="5,5,5,10"
|
||||
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelTreeItem.ItemSelected}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding sName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Name_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="12,6,12,6"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding dLastModifyDate}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.LastModify_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="12,6,12,6"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding sTypeItem}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Type_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="12,6,12,6"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding sDimension}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Dimension_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Right"/>
|
||||
<Setter Property="Padding" Value="12,6,12,6"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow"
|
||||
BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding FileName_Msg}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<!--<ComboBox Grid.Column="1"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
IsEditable="True"
|
||||
ItemsSource="{Binding ListItemView}"
|
||||
SelectedItem="{Binding SelListItemView}"
|
||||
Width="400"
|
||||
Margin="2.5,0,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}">
|
||||
</ComboBox>-->
|
||||
<TextBox Grid.Column="1"
|
||||
Margin="2.5,2.5,2.5,5"
|
||||
Width="350"
|
||||
Height="30"
|
||||
TextAlignment="Left"
|
||||
Text="{Binding sSaveFileName}"
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<ComboBox Grid.Column="2"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
ItemsSource="{Binding ListFilter}"
|
||||
SelectedItem="{Binding SelExstension}"
|
||||
DisplayMemberPath="sNameExstension"
|
||||
HorizontalAlignment="Right"
|
||||
Width="200"
|
||||
Margin="2.5,0,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}">
|
||||
</ComboBox>
|
||||
<UniformGrid Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Rows="1"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<Button IsDefault="True"
|
||||
Content="OK"
|
||||
Command="{Binding Ok_Command}"
|
||||
Margin="15,0,2.5,0"
|
||||
Style="{StaticResource RightPanel_HalfRound_Button}"/>
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="2.5,0,0,0"
|
||||
Style="{StaticResource RightPanel_HalfRound_Button}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtMainWindow>
|
||||
@@ -0,0 +1,88 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Public Class EgtManageFileDialogV
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private WithEvents m_EgtManageFileDialogVM As EgtManageFileDialogVM
|
||||
|
||||
Private Shadows DialogResult As DialogResult
|
||||
|
||||
Public Overloads Property Title As String
|
||||
Get
|
||||
Return m_EgtManageFileDialogVM.sTitle
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_EgtManageFileDialogVM.sTitle = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Filter As String
|
||||
Get
|
||||
Return m_EgtManageFileDialogVM.sFilter
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_EgtManageFileDialogVM.sFilter = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property InitialDirectory As String
|
||||
Get
|
||||
Return m_EgtManageFileDialogVM.sInitialDirectory
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_EgtManageFileDialogVM.sInitialDirectory = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FileName As String
|
||||
Get
|
||||
Return m_EgtManageFileDialogVM.sFileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_EgtManageFileDialogVM.sFileName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FilterIndex As Integer
|
||||
Get
|
||||
Return m_EgtManageFileDialogVM.nFilterIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_EgtManageFileDialogVM.nFilterIndex = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONTRUCTORS"
|
||||
|
||||
Sub New(Owner As Window, EgtManageFileDialogVM As EgtManageFileDialogVM)
|
||||
MyBase.New(Owner)
|
||||
InitializeComponent()
|
||||
Me.DataContext = EgtManageFileDialogVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_EgtManageFileDialogVM = EgtManageFileDialogVM
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub CloseWindow(DialogResult As MessageBoxResult) Handles m_EgtManageFileDialogVM.m_CloseWindow
|
||||
Me.DialogResult = DialogResult
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Overloads Function ShowDialog() As DialogResult
|
||||
MyBase.ShowDialog()
|
||||
Return Me.DialogResult
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,893 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
|
||||
|
||||
Public Class EgtManageFileDialogVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public Enum VisualizationContainerType As Integer
|
||||
LISTBOX = 0
|
||||
DATAGRID = 1
|
||||
End Enum
|
||||
|
||||
Public Enum VisualizationType As Integer
|
||||
SCHEDULETEMPLATE = 0
|
||||
DETAILSTEMPLATE = 1
|
||||
BOXINGTEMPLATE = 2
|
||||
CONTENTTEMPLATE = 3
|
||||
End Enum
|
||||
|
||||
Private m_sTitle As String
|
||||
Public Property sTitle As String
|
||||
Get
|
||||
Return m_sTitle
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sTitle = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sFilter As String
|
||||
Public Property sFilter As String
|
||||
Get
|
||||
Return m_sFilter
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sFilter = value
|
||||
If Not IsNothing(sFilter) Then
|
||||
Dim FilterListSplit As String() = sFilter.Split("|"c)
|
||||
For i As Integer = 0 To FilterListSplit.Count - 1
|
||||
If i Mod 2 = 0 Then
|
||||
Dim strExstension As New EgtExstension() With {.sNameExstension = FilterListSplit(i) & FilterListSplit(i + 1), .sExstension = FilterListSplit(i + 1)}
|
||||
m_ListFilter.Add(strExstension)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sInitialDirectory As String
|
||||
Public Property sInitialDirectory As String
|
||||
Get
|
||||
Return m_sInitialDirectory
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sInitialDirectory = value
|
||||
m_sSaveFileName = "New.icrs"
|
||||
m_sUrl_Msg = m_sInitialDirectory
|
||||
Dim DirectoryStart As String() = m_sInitialDirectory.Split("\"c)
|
||||
|
||||
For i As Integer = 0 To m_RootList.Count - 1
|
||||
If m_RootList(i).sName.Trim("\") = DirectoryStart(0) Then
|
||||
m_RootList(i).IsExpanded = True
|
||||
Dim CurrItem As EgtFolder = TryCast(m_RootList(i), EgtFolder)
|
||||
If Not IsNothing(CurrItem) Then
|
||||
For j As Integer = 0 To CurrItem.FolderList.Count - 1
|
||||
If CurrItem.FolderList(j).sName = DirectoryStart(1) Then
|
||||
CurrItem.FolderList(j).IsExpanded = True
|
||||
Dim ItemFolder As EgtFolder = TryCast(CurrItem.FolderList(j), EgtFolder)
|
||||
If Not IsNothing(ItemFolder) Then
|
||||
For y As Integer = 0 To ItemFolder.FolderList.Count - 1
|
||||
If ItemFolder.FolderList(y).sName = DirectoryStart(2) Then
|
||||
ItemFolder.FolderList(y).IsExpanded = True
|
||||
ItemFolder.FolderList(y).IsSelected = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sFileName As String
|
||||
Public Property sFileName As String
|
||||
Get
|
||||
Return m_sFileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sFileName = value
|
||||
m_sSaveFileName = m_sFileName
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared m_sUrl_Msg As String
|
||||
Public Property sUrl_Msg As String
|
||||
Get
|
||||
Return m_sUrl_Msg
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sUrl_Msg = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Private m_sSelListItemView As String
|
||||
'Public Property SelListItemView As String
|
||||
' Get
|
||||
' Return m_sSelListItemView
|
||||
' End Get
|
||||
' Set(value As String)
|
||||
' m_sSelListItemView = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private m_sSaveFileName As String
|
||||
Public Property sSaveFileName As String
|
||||
Get
|
||||
Return m_sSaveFileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSaveFileName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nTaskStatus As Integer
|
||||
Public Property nTaskStatus As String
|
||||
Get
|
||||
Return m_nTaskStatus
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_nTaskStatus = value
|
||||
NotifyPropertyChanged(NameOf(nTaskStatus))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nFilterIndex As Integer
|
||||
Public Property nFilterIndex As Integer
|
||||
Get
|
||||
Return m_nFilterIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nFilterIndex = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nSelectView As Integer
|
||||
Public Property nSelectView As Integer
|
||||
Get
|
||||
Return m_nSelectView
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nSelectView = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ListFilter As ObservableCollection(Of EgtExstension)
|
||||
Public Property ListFilter As ObservableCollection(Of EgtExstension)
|
||||
Get
|
||||
Return m_ListFilter
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtExstension))
|
||||
m_ListFilter = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Public Shared m_ListItemView As ObservableCollection(Of String)
|
||||
'Public Property ListItemView As ObservableCollection(Of String)
|
||||
' Get
|
||||
' Return m_ListItemView
|
||||
' End Get
|
||||
' Set(value As ObservableCollection(Of String))
|
||||
' m_ListItemView = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private m_RootList As New ObservableCollection(Of EgtDirectory)
|
||||
Public Property RootList As ObservableCollection(Of EgtDirectory)
|
||||
Get
|
||||
Return m_RootList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDirectory))
|
||||
m_RootList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_VisualizationList As ObservableCollection(Of IdNameStruct)
|
||||
Public Property VisualizationList As ObservableCollection(Of IdNameStruct)
|
||||
Get
|
||||
Return m_VisualizationList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of IdNameStruct))
|
||||
m_VisualizationList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelVisualization As IdNameStruct
|
||||
Public Property SelVisualization As IdNameStruct
|
||||
Get
|
||||
Return m_SelVisualization
|
||||
End Get
|
||||
Set(value As IdNameStruct)
|
||||
m_SelVisualization = value
|
||||
Select Case m_SelVisualization.Id
|
||||
Case VisualizationType.SCHEDULETEMPLATE
|
||||
m_nSelectView = VisualizationContainerType.LISTBOX
|
||||
nTaskStatus = 0
|
||||
m_UVision_Visibility = Visibility.Visible
|
||||
m_ListBox_Visibility = Visibility.Visible
|
||||
m_DataGrid_Visibility = Visibility.Collapsed
|
||||
Case VisualizationType.DETAILSTEMPLATE
|
||||
m_nSelectView = VisualizationContainerType.DATAGRID
|
||||
m_UVision_Visibility = Visibility.Collapsed
|
||||
m_ListBox_Visibility = Visibility.Collapsed
|
||||
m_DataGrid_Visibility = Visibility.Visible
|
||||
Case VisualizationType.BOXINGTEMPLATE
|
||||
m_nSelectView = VisualizationContainerType.LISTBOX
|
||||
nTaskStatus = 1
|
||||
m_UVision_Visibility = Visibility.Collapsed
|
||||
m_ListBox_Visibility = Visibility.Visible
|
||||
m_DataGrid_Visibility = Visibility.Collapsed
|
||||
Case VisualizationType.CONTENTTEMPLATE
|
||||
m_nSelectView = VisualizationContainerType.LISTBOX
|
||||
nTaskStatus = 2
|
||||
m_UVision_Visibility = Visibility.Collapsed
|
||||
m_ListBox_Visibility = Visibility.Visible
|
||||
m_DataGrid_Visibility = Visibility.Collapsed
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(nSelectView))
|
||||
NotifyPropertyChanged(NameOf(UVision_Visibility))
|
||||
NotifyPropertyChanged(NameOf(DataGrid_Visibility))
|
||||
NotifyPropertyChanged(NameOf(ListBox_Visibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_DataGrid_Visibility As Visibility
|
||||
Public Property DataGrid_Visibility As Visibility
|
||||
Get
|
||||
Return m_DataGrid_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_DataGrid_Visibility = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ListBox_Visibility As Visibility
|
||||
Public Property ListBox_Visibility As Visibility
|
||||
Get
|
||||
Return m_ListBox_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_ListBox_Visibility = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_UVision_Visibility As Visibility
|
||||
Public Property UVision_Visibility As Visibility
|
||||
Get
|
||||
Return m_UVision_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_UVision_Visibility = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared m_SelExstension As EgtExstension
|
||||
Public Property SelExstension As EgtExstension
|
||||
Get
|
||||
Return m_SelExstension
|
||||
End Get
|
||||
Set(value As EgtExstension)
|
||||
m_SelExstension = value
|
||||
Dim CurrItem As EgtFolder = TryCast(m_SelTreeItem, EgtFolder)
|
||||
If Not IsNothing(CurrItem) Then
|
||||
CollectionViewSource.GetDefaultView(CurrItem.FolderList).Refresh()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared m_SelTreeItem As EgtDirectory
|
||||
Public Property SelTreeItem As EgtDirectory
|
||||
Get
|
||||
Return m_SelTreeItem
|
||||
End Get
|
||||
Set(value As EgtDirectory)
|
||||
m_SelTreeItem = value
|
||||
NotifyPropertyChanged(NameOf(SelTreeItem))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Sub UpdateSelRoot(Item As EgtDirectory)
|
||||
m_SelTreeItem = Item
|
||||
NotifyPropertyChanged(NameOf(SelTreeItem))
|
||||
End Sub
|
||||
|
||||
'Comandi
|
||||
Private m_cmdCancel As ICommand
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdGoBack As ICommand
|
||||
Friend Event m_CloseWindow(bDialogResult As MessageBoxResult)
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONTRUCTORS"
|
||||
|
||||
Sub New()
|
||||
m_RootList.Clear()
|
||||
EgtDirectory.refUpdateSelRoot = AddressOf UpdateSelRoot
|
||||
Dim drives As DriveInfo() = DriveInfo.GetDrives().Where(Function(d) d.IsReady).ToArray()
|
||||
|
||||
m_ListFilter = New ObservableCollection(Of EgtExstension)
|
||||
|
||||
For i As Integer = 0 To drives.Count() - 1
|
||||
Dim directory As New EgtFolder(drives(i).RootDirectory, Nothing)
|
||||
'AddHandler directory.PropertyChanged, AddressOf Directory_PropertyChanged
|
||||
m_RootList.Add(directory)
|
||||
Next
|
||||
|
||||
SetVisualizzationList()
|
||||
|
||||
m_SelVisualization.Id = VisualizationType.SCHEDULETEMPLATE
|
||||
m_nSelectView = VisualizationContainerType.LISTBOX
|
||||
nTaskStatus = 0
|
||||
m_UVision_Visibility = Visibility.Visible
|
||||
m_ListBox_Visibility = Visibility.Visible
|
||||
m_DataGrid_Visibility = Visibility.Collapsed
|
||||
|
||||
NotifyPropertyChanged(NameOf(RootList))
|
||||
NotifyPropertyChanged(NameOf(ListFilter))
|
||||
NotifyPropertyChanged(NameOf(VisualizationList))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONTRUCTORS
|
||||
|
||||
#Region "Messages"
|
||||
Public ReadOnly Property Name_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15060)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LastModify_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15061)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Type_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15062)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Dimension_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15063)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Folder_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15064)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property FileName_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15065)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Schedule_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15067)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Details_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15068)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Boxing_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15069)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Content_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15070)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property DataFolder_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15071)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
''' <summary>
|
||||
''' Inizializza la ComboBox per la scelta dei template
|
||||
''' </summary>
|
||||
Private Sub SetVisualizzationList()
|
||||
m_VisualizationList = New ObservableCollection(Of IdNameStruct)
|
||||
Dim ItemVisualization As New IdNameStruct With {
|
||||
.Id = 0,
|
||||
.Name = Schedule_Msg
|
||||
}
|
||||
m_VisualizationList.Add(ItemVisualization)
|
||||
ItemVisualization.Id = 1
|
||||
ItemVisualization.Name = Details_Msg
|
||||
m_VisualizationList.Add(ItemVisualization)
|
||||
ItemVisualization.Id = 2
|
||||
ItemVisualization.Name = Boxing_Msg
|
||||
m_VisualizationList.Add(ItemVisualization)
|
||||
ItemVisualization.Id = 3
|
||||
ItemVisualization.Name = Content_Msg
|
||||
m_VisualizationList.Add(ItemVisualization)
|
||||
End Sub
|
||||
|
||||
Private Sub Directory_PropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
If e.PropertyName = "IsSelected" Then
|
||||
'UpdateSelRoot()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Command Ok"
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
Dim CurrItem As EgtItem = TryCast(EgtFolder.m_ItemSelected, EgtItem)
|
||||
If Not IsNothing(CurrItem) Then
|
||||
m_sFileName = m_SelTreeItem.InfoDir.FullName & "\" & CurrItem.sName
|
||||
Else
|
||||
m_sFileName = m_SelTreeItem.InfoDir.FullName & "\" & m_sSaveFileName
|
||||
End If
|
||||
RaiseEvent m_CloseWindow(DialogResult.OK)
|
||||
End Sub
|
||||
#End Region 'Command Ok
|
||||
|
||||
#Region "Command GoBack"
|
||||
Public ReadOnly Property GoBack_Command As ICommand
|
||||
Get
|
||||
If m_cmdGoBack Is Nothing Then
|
||||
m_cmdGoBack = New Command(AddressOf GoBack)
|
||||
End If
|
||||
Return m_cmdGoBack
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub GoBack()
|
||||
m_SelTreeItem = EgtFolder.m_ParentFolder
|
||||
m_SelTreeItem.IsSelected = True
|
||||
m_sUrl_Msg = ""
|
||||
m_sUrl_Msg = m_SelTreeItem.InfoDir.FullName
|
||||
EgtDirectory.m_sIconSource = "\Resources\EgtDialog\Folder.png"
|
||||
NotifyPropertyChanged(NameOf(sUrl_Msg))
|
||||
End Sub
|
||||
#End Region 'Command GoBack
|
||||
|
||||
#Region "Command Cancel"
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Cancel()
|
||||
RaiseEvent m_CloseWindow(DialogResult.Cancel)
|
||||
End Sub
|
||||
#End Region 'Command Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtExstension
|
||||
Inherits VMBase
|
||||
|
||||
Public m_sNameExstension As String
|
||||
Public Property sNameExstension As String
|
||||
Get
|
||||
Return m_sNameExstension
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sNameExstension = value
|
||||
NotifyPropertyChanged(NameOf(sNameExstension))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_sExstension As String
|
||||
Public Property sExstension As String
|
||||
Get
|
||||
Return m_sExstension
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sExstension = value
|
||||
NotifyPropertyChanged(NameOf(sExstension))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtDirectory
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Shared refUpdateSelRoot As Action(Of EgtDirectory)
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Overridable Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
refUpdateSelRoot(Me)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bIsExpanded As Boolean
|
||||
Public Overridable Property IsExpanded As Boolean
|
||||
Get
|
||||
Return m_bIsExpanded
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsExpanded = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_InfoDir As DirectoryInfo
|
||||
Public Property InfoDir As DirectoryInfo
|
||||
Get
|
||||
Return m_InfoDir
|
||||
End Get
|
||||
Set(value As DirectoryInfo)
|
||||
m_InfoDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Try
|
||||
Return If(Not IsNothing(m_InfoDir), m_InfoDir.Name, "")
|
||||
Catch ex As Exception
|
||||
Return ""
|
||||
End Try
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared m_sIconSource As String
|
||||
Public Property sIconSource As String
|
||||
Get
|
||||
Return m_sIconSource
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sIconSource = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTypeItem As String
|
||||
Get
|
||||
Try
|
||||
Return If(Not IsNothing(m_InfoDir), m_InfoDir.Extension, "")
|
||||
Catch ex As Exception
|
||||
Return ""
|
||||
End Try
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dLastModifyDate As Date
|
||||
Get
|
||||
Try
|
||||
Return If(Not IsNothing(m_InfoDir), m_InfoDir.LastAccessTime.ToString("dd/MM/yyyy HH:mm:ss"), Date.UtcNow.ToString("dd/MM/yyyy HH:mm:ss"))
|
||||
Catch ex As Exception
|
||||
Return Date.UtcNow.ToString("dd/MM/yyyy HH:mm:ss")
|
||||
End Try
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sDimension As Integer
|
||||
Get
|
||||
Try
|
||||
Return If(Not IsNothing(m_InfoDir), m_InfoDir.EnumerateDirectories().Count, 0)
|
||||
Catch ex As Exception
|
||||
Return 0
|
||||
End Try
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtFolder
|
||||
Inherits EgtDirectory
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public Shared m_ItemList_View As CollectionView = Nothing
|
||||
|
||||
Private m_FolderList As New ObservableCollection(Of EgtDirectory)
|
||||
Public Property FolderList As ObservableCollection(Of EgtDirectory)
|
||||
Get
|
||||
Return m_FolderList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDirectory))
|
||||
m_FolderList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared m_ItemSelected As EgtDirectory
|
||||
Public Property ItemSelected As EgtDirectory
|
||||
Get
|
||||
Return m_ItemSelected
|
||||
End Get
|
||||
Set(value As EgtDirectory)
|
||||
m_ItemSelected = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public Overloads Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sTypeItem As String
|
||||
Public Overloads Property sTypeItem As String
|
||||
Get
|
||||
Return m_sTypeItem
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sTypeItem = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dLastModifyDate As Date
|
||||
Public Overloads Property dLastModifyDate As String
|
||||
Get
|
||||
Return m_dLastModifyDate
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_dLastModifyDate = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared m_ParentFolder As EgtFolder
|
||||
Public Property ParentFolder As EgtFolder
|
||||
Get
|
||||
Return m_ParentFolder
|
||||
End Get
|
||||
Set(value As EgtFolder)
|
||||
m_ParentFolder = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bIsExpanded As Boolean
|
||||
Public Overrides Property IsExpanded As Boolean
|
||||
Get
|
||||
Return m_bIsExpanded
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsExpanded = value
|
||||
NotifyPropertyChanged(NameOf(IsExpanded))
|
||||
Dim DirectoryList() As DirectoryInfo
|
||||
Dim FileList() As FileInfo
|
||||
Try
|
||||
DirectoryList = m_InfoDir.GetDirectories().Where(Function(file) (file.Attributes And FileAttributes.Hidden And file.Name <> EgtManageFileDialogVM.DataFolder_Msg) = 0).ToArray()
|
||||
FileList = m_InfoDir.GetFiles().Where(Function(file) (file.Attributes And FileAttributes.Hidden) = 0).ToArray()
|
||||
Catch ex As Exception
|
||||
DirectoryList = Nothing
|
||||
FileList = Nothing
|
||||
End Try
|
||||
m_FolderList.Clear()
|
||||
If Not IsNothing(DirectoryList) Then
|
||||
For Each subDir As DirectoryInfo In DirectoryList
|
||||
Dim directory As New EgtFolder(subDir, Me)
|
||||
m_FolderList.Add(directory)
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(FileList) Then
|
||||
For Each files As FileInfo In FileList
|
||||
Dim file As New EgtItem(files)
|
||||
m_FolderList.Add(file)
|
||||
Next
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
refUpdateSelRoot(Me)
|
||||
Dim DirectoryList() As DirectoryInfo
|
||||
Dim FileList() As FileInfo
|
||||
Try
|
||||
DirectoryList = m_InfoDir.GetDirectories().Where(Function(file) (file.Attributes And FileAttributes.Hidden And file.Name <> EgtManageFileDialogVM.DataFolder_Msg) = 0).ToArray()
|
||||
FileList = m_InfoDir.GetFiles().Where(Function(file) (file.Attributes And FileAttributes.Hidden) = 0).ToArray()
|
||||
Catch ex As Exception
|
||||
DirectoryList = Nothing
|
||||
FileList = Nothing
|
||||
End Try
|
||||
m_FolderList.Clear()
|
||||
If Not IsNothing(DirectoryList) Then
|
||||
For Each subDir As DirectoryInfo In DirectoryList
|
||||
Dim directory As New EgtFolder(subDir, Me)
|
||||
m_FolderList.Add(directory)
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(FileList) Then
|
||||
For Each files As FileInfo In FileList
|
||||
Dim file As New EgtItem(files)
|
||||
m_FolderList.Add(file)
|
||||
Next
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONTRUCTORS"
|
||||
|
||||
Sub New(InfoDir As DirectoryInfo, Folder As EgtFolder)
|
||||
|
||||
m_InfoDir = InfoDir
|
||||
m_sName = InfoDir.Name
|
||||
m_dLastModifyDate = InfoDir.LastWriteTime.ToString("dd/MM/yyyy HH:mm:ss")
|
||||
If InfoDir.Extension <> "" Then
|
||||
m_sTypeItem = "File " & InfoDir.Extension.ToUpper()
|
||||
m_sIconSource = "\Resources\EgtDialog\New.png"
|
||||
Else
|
||||
m_sTypeItem = EgtManageFileDialogVM.Folder_Msg
|
||||
m_sIconSource = "\Resources\EgtDialog\Folder.png"
|
||||
End If
|
||||
m_FolderList.Add(New EgtDirectory())
|
||||
EgtManageFileDialogVM.m_SelExstension = New EgtExstension()
|
||||
m_ParentFolder = Folder
|
||||
m_ItemSelected = New EgtDirectory()
|
||||
|
||||
|
||||
m_ItemList_View = CollectionViewSource.GetDefaultView(m_FolderList)
|
||||
m_ItemList_View.Filter = AddressOf ItemFilter
|
||||
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
NotifyPropertyChanged(NameOf(dLastModifyDate))
|
||||
NotifyPropertyChanged(NameOf(sTypeItem))
|
||||
NotifyPropertyChanged(NameOf(sIconSource))
|
||||
NotifyPropertyChanged(NameOf(FolderList))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Function ItemFilter(Item As Object) As Boolean
|
||||
Dim CurrItem As EgtItem = TryCast(Item, EgtItem)
|
||||
|
||||
If Not IsNothing(CurrItem) AndAlso Not IsNothing(EgtManageFileDialogVM.m_SelExstension.m_sExstension) Then
|
||||
'Return CurrItem.TypeItem = EgtOpenDialogVM.m_SelExstension.s_Exstension.TrimStart("*")
|
||||
If CurrItem.sTypeItem.Substring(5).ToLower() = EgtManageFileDialogVM.m_SelExstension.m_sExstension.TrimStart("*") Then
|
||||
'EgtManageFileDialogVM.m_ListItemView.Add(m_InfoDir.FullName & "\" & CurrItem.sName)
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtItem
|
||||
Inherits EgtDirectory
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_sName As String
|
||||
Public Overloads Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sTypeItem As String
|
||||
Public Overloads Property sTypeItem As String
|
||||
Get
|
||||
Return m_sTypeItem
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sTypeItem = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sDimension As String
|
||||
Public Overloads Property sDimension As String
|
||||
Get
|
||||
Return m_sDimension
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDimension = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dLastModifyDate As Date
|
||||
Public Overloads Property dLastModifyDate As String
|
||||
Get
|
||||
Return m_dLastModifyDate
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_dLastModifyDate = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
'm_sIconSource = "\Resources\EgtDialog\New.png"
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONTRUCTORS"
|
||||
|
||||
Sub New(InfoDir As FileInfo)
|
||||
|
||||
m_sName = InfoDir.Name
|
||||
m_sDimension = String.Format("{0:#,##0.00}", InfoDir.Length / 1024) & " Kb"
|
||||
m_dLastModifyDate = InfoDir.LastWriteTime.ToString("dd/MM/yyyy HH:mm:ss")
|
||||
If InfoDir.Extension <> "" Then
|
||||
m_sTypeItem = "File " & InfoDir.Extension.ToUpper()
|
||||
m_sIconSource = "\Resources\EgtDialog\New.png"
|
||||
Else
|
||||
m_sTypeItem = ""
|
||||
End If
|
||||
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
NotifyPropertyChanged(NameOf(sDimension))
|
||||
NotifyPropertyChanged(NameOf(dLastModifyDate))
|
||||
NotifyPropertyChanged(NameOf(sTypeItem))
|
||||
NotifyPropertyChanged(NameOf(sIconSource))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONTRUCTORS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -158,6 +158,10 @@
|
||||
<DependentUpon>EgtColorPickerV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EgtColorPicker\EgtColorPickerVM.vb" />
|
||||
<Compile Include="EgtManageFileDialog\EgtManageFileDialogV.xaml.vb">
|
||||
<DependentUpon>EgtManageFileDialogV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EgtManageFileDialog\EgtManageFileDialogVM.vb" />
|
||||
<Compile Include="FilledSolidPanel\FilledSolidPanelV.xaml.vb">
|
||||
<DependentUpon>FilledSolidPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -378,6 +382,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="EgtManageFileDialog\EgtManageFileDialogV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="FilledSolidPanel\FilledSolidPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -877,6 +885,15 @@
|
||||
<Resource Include="Resources\EgtMessageBox\Question.png" />
|
||||
<Resource Include="Resources\EgtMessageBox\Warning.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\EgtDialog\Restore.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\EgtDialog\New.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\EgtDialog\Folder.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
Imports System.IO
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Public Class ProjManagerVM
|
||||
Inherits VMBase
|
||||
@@ -151,6 +150,27 @@ Public Class ProjManagerVM
|
||||
''' </summary>
|
||||
Public Sub NewProjectCmd()
|
||||
NewProject(True)
|
||||
'Dim x As New OpenFileDialog()
|
||||
'x.ShowDialog()
|
||||
|
||||
Dim sDir As String = "C:\EgtData\Test3dPrinting"
|
||||
Dim od As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
|
||||
.Title = "Open",
|
||||
.Filter = "Icarus project(*.icrs)|*.icrs" &
|
||||
"|New geometry EgalTech(*.nge)|*.nge",
|
||||
.FileName = "New.icrs",
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir}
|
||||
od.ShowDialog()
|
||||
Dim sFilePath As String = od.FileName
|
||||
|
||||
'Dim save As New EgtSaveDialogV(Application.Current.MainWindow, New EgtSaveDialogVM()) With {
|
||||
' .Title = "Save",
|
||||
' .Filter = "Icarus project(*.icrs)|*.icrs",
|
||||
' .FileName = "New.icrs",
|
||||
' .InitialDirectory = sDir}
|
||||
'save.ShowDialog()
|
||||
'Dim sFilePath As String = save.FileName
|
||||
End Sub
|
||||
|
||||
Friend Sub NewProject(bDialog As Boolean)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 374 B |
Binary file not shown.
|
After Width: | Height: | Size: 254 B |
@@ -263,7 +263,14 @@ Public Class MySceneHostVM
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
Dim OpenFileDialog As New Windows.Forms.OpenFileDialog With {
|
||||
'Dim OpenFileDialog As New Windows.Forms.OpenFileDialog With {
|
||||
' .Title = "Open",
|
||||
' .Filter = "Icarus project(*.icrs)|*.icrs" &
|
||||
' "|New geometry EgalTech(*.nge)|*.nge",
|
||||
' .FilterIndex = 1,
|
||||
' .InitialDirectory = sDir
|
||||
'}
|
||||
Dim OpenFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
|
||||
.Title = "Open",
|
||||
.Filter = "Icarus project(*.icrs)|*.icrs" &
|
||||
"|New geometry EgalTech(*.nge)|*.nge",
|
||||
@@ -313,12 +320,25 @@ Public Class MySceneHostVM
|
||||
If String.IsNullOrWhiteSpace(sFile) Then sFile = "New.icrs"
|
||||
' Eventuale sistemazione estensione
|
||||
sFile = IO.Path.ChangeExtension(sFile, "icrs")
|
||||
Dim sDir As String = MainController.GetCurrFile()
|
||||
If String.IsNullOrWhiteSpace(sDir) Then
|
||||
GetMainPrivateProfileString(S_MRUFILES, K_FILE & 1, "", sDir)
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
' Assegnazione nome file con dialogo
|
||||
Dim SaveFileDialog As New Windows.Forms.SaveFileDialog With {
|
||||
'Dim SaveFileDialog As New Windows.Forms.SaveFileDialog With {
|
||||
' .Title = "Save",
|
||||
' .Filter = "Icarus Project(*.icrs)|*.icrs",
|
||||
' .FileName = sFile,
|
||||
' .InitialDirectory = IO.Path.GetDirectoryName(sFile)
|
||||
'}
|
||||
Dim SaveFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
|
||||
.Title = "Save",
|
||||
.Filter = "Icarus Project(*.icrs)|*.icrs",
|
||||
.Filter = "Icarus project(*.icrs)|*.icrs",
|
||||
.FileName = sFile,
|
||||
.InitialDirectory = IO.Path.GetDirectoryName(sFile)
|
||||
.InitialDirectory = sDir
|
||||
}
|
||||
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
Dim sFileName As String = SaveFileDialog.FileName
|
||||
|
||||
Reference in New Issue
Block a user