diff --git a/Icarus/EgtColorPicker/EgtColorPickerV.xaml.vb b/Icarus/EgtColorPicker/EgtColorPickerV.xaml.vb
index 1a71587..899a397 100644
--- a/Icarus/EgtColorPicker/EgtColorPickerV.xaml.vb
+++ b/Icarus/EgtColorPicker/EgtColorPickerV.xaml.vb
@@ -225,54 +225,54 @@ Public Class EgtColorPickerV
- '''
- ''' Converte il colore selezionato da HLS ( tonalità, luminosità, saturazione) in RGB
- '''
- ''' Tonalità del colore selezionato espressa in double
- ''' Luminosità del colore selezionato espressa in double
- ''' Saturazione del colore selezionato espressa in double
- ''' Colore Rosso restituito dalla funzione espresso in intero
- ''' Colore Verde restituito dalla funzione espresso in intero
- ''' Colore Blu restituito dalla funzione espresso in intero
- Private Shared Sub HlsToRgb(ByVal h As Double, ByVal l As Double, ByVal s As Double, ByRef r As Integer, ByRef g As Integer, ByRef b As Integer)
- Dim p2 As Double
+ ''''
+ '''' Converte il colore selezionato da HLS ( tonalità, luminosità, saturazione) in RGB
+ ''''
+ '''' Tonalità del colore selezionato espressa in double
+ '''' Luminosità del colore selezionato espressa in double
+ '''' Saturazione del colore selezionato espressa in double
+ '''' Colore Rosso restituito dalla funzione espresso in intero
+ '''' Colore Verde restituito dalla funzione espresso in intero
+ '''' Colore Blu restituito dalla funzione espresso in intero
+ 'Private Shared Sub HlsToRgb(ByVal h As Double, ByVal l As Double, ByVal s As Double, ByRef r As Integer, ByRef g As Integer, 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
'''
''' Apre una finestra EgtColorPicker
diff --git a/Icarus/EgtColorPicker/EgtColorPickerVM.vb b/Icarus/EgtColorPicker/EgtColorPickerVM.vb
index 1c113fb..988a53b 100644
--- a/Icarus/EgtColorPicker/EgtColorPickerVM.vb
+++ b/Icarus/EgtColorPicker/EgtColorPickerVM.vb
@@ -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
diff --git a/Icarus/EgtManageFileDialog/EgtManageFileDialogV.xaml b/Icarus/EgtManageFileDialog/EgtManageFileDialogV.xaml
new file mode 100644
index 0000000..080e0ae
--- /dev/null
+++ b/Icarus/EgtManageFileDialog/EgtManageFileDialogV.xaml
@@ -0,0 +1,450 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Icarus/EgtManageFileDialog/EgtManageFileDialogV.xaml.vb b/Icarus/EgtManageFileDialog/EgtManageFileDialogV.xaml.vb
new file mode 100644
index 0000000..8502ef1
--- /dev/null
+++ b/Icarus/EgtManageFileDialog/EgtManageFileDialogV.xaml.vb
@@ -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
diff --git a/Icarus/EgtManageFileDialog/EgtManageFileDialogVM.vb b/Icarus/EgtManageFileDialog/EgtManageFileDialogVM.vb
new file mode 100644
index 0000000..e9c8eb9
--- /dev/null
+++ b/Icarus/EgtManageFileDialog/EgtManageFileDialogVM.vb
@@ -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"
+
+ '''
+ ''' Inizializza la ComboBox per la scelta dei template
+ '''
+ 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
+
diff --git a/Icarus/Icarus.vbproj b/Icarus/Icarus.vbproj
index 1965808..42cd70e 100644
--- a/Icarus/Icarus.vbproj
+++ b/Icarus/Icarus.vbproj
@@ -158,6 +158,10 @@
EgtColorPickerV.xaml
+
+ EgtManageFileDialogV.xaml
+
+ FilledSolidPanelV.xaml
@@ -378,6 +382,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -877,6 +885,15 @@
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
diff --git a/Icarus/ProjManager/ProjManagerVM.vb b/Icarus/ProjManager/ProjManagerVM.vb
index 7abb9da..bcd91a8 100644
--- a/Icarus/ProjManager/ProjManagerVM.vb
+++ b/Icarus/ProjManager/ProjManagerVM.vb
@@ -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
'''
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)
diff --git a/Icarus/Resources/EgtDialog/Folder.png b/Icarus/Resources/EgtDialog/Folder.png
new file mode 100644
index 0000000..2c1339d
Binary files /dev/null and b/Icarus/Resources/EgtDialog/Folder.png differ
diff --git a/Icarus/Resources/EgtDialog/New.png b/Icarus/Resources/EgtDialog/New.png
new file mode 100644
index 0000000..b618597
Binary files /dev/null and b/Icarus/Resources/EgtDialog/New.png differ
diff --git a/Icarus/Resources/EgtDialog/Restore.png b/Icarus/Resources/EgtDialog/Restore.png
new file mode 100644
index 0000000..dd24cf1
Binary files /dev/null and b/Icarus/Resources/EgtDialog/Restore.png differ
diff --git a/Icarus/SceneHost/MySceneHostVM.vb b/Icarus/SceneHost/MySceneHostVM.vb
index a09dfcf..6cc15ff 100644
--- a/Icarus/SceneHost/MySceneHostVM.vb
+++ b/Icarus/SceneHost/MySceneHostVM.vb
@@ -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