Aggiunta migliorie finestra di dialogo
This commit is contained in:
@@ -97,11 +97,11 @@ Public Class EgtColorPickerV
|
||||
|
||||
'HlsToRgb(sat, lum, 1 - ton, r, g, b)
|
||||
|
||||
Dim colargb As System.Drawing.Color = ColorFromHSV(sat, ton, lum)
|
||||
'Dim colargb As System.Drawing.Color = ColorFromHSV(sat, ton, lum)
|
||||
|
||||
Dim col As Color = Media.Color.FromRgb(colargb.R, colargb.G, colargb.B)
|
||||
'Dim col As Color = Media.Color.FromRgb(colargb.R, colargb.G, colargb.B)
|
||||
'Dim col As Color = Media.Color.FromRgb(r, g, b)
|
||||
m_EgtColorPickerVM.SetCurrColorFill(col)
|
||||
'm_EgtColorPickerVM.SetCurrColorFill(col)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1"
|
||||
Margin="5"
|
||||
Text="{Binding sUrl_Msg, Mode=TwoWay}"
|
||||
Text="{Binding sUrl_Msg}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<ComboBox Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
@@ -36,6 +36,7 @@
|
||||
ItemsSource="{Binding VisualizationList}"
|
||||
SelectedItem="{Binding SelVisualization}"
|
||||
Width="200"
|
||||
Height="30"
|
||||
Margin="2.5,0,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}">
|
||||
</ComboBox>
|
||||
@@ -51,17 +52,29 @@
|
||||
Height="300"
|
||||
Width="200"
|
||||
Margin="10"
|
||||
FontSize="15"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center">
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{StaticResource Icarus_Gray}">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:EgtFolder}"
|
||||
ItemsSource="{Binding FolderList}">
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="15"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<DataTemplate DataType="{x:Type local:EgtItem}">
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="15"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemContainerStyle>
|
||||
@@ -93,7 +106,7 @@
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<ListBox x:Name="FileList"
|
||||
Grid.Row="1"
|
||||
Width="350"
|
||||
Width="300"
|
||||
Height="250"
|
||||
Margin="5,5,5,5"
|
||||
BorderBrush="White"
|
||||
@@ -200,71 +213,6 @@
|
||||
</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"
|
||||
@@ -316,6 +264,15 @@
|
||||
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelTreeItem.ItemSelected}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="SizeToCells">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="15"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Binding="{Binding sName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
@@ -397,27 +354,20 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding FileName_Msg}"
|
||||
HorizontalAlignment="Right"
|
||||
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"
|
||||
Width="400"
|
||||
Height="30"
|
||||
TextAlignment="Left"
|
||||
HorizontalAlignment="Right"
|
||||
Text="{Binding sSaveFileName}"
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<ComboBox Grid.Column="2"
|
||||
@@ -427,7 +377,8 @@
|
||||
DisplayMemberPath="sNameExstension"
|
||||
HorizontalAlignment="Right"
|
||||
Width="200"
|
||||
Margin="2.5,0,2.5,5"
|
||||
Height="30"
|
||||
Margin="10,0,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}">
|
||||
</ComboBox>
|
||||
<UniformGrid Grid.Row="1"
|
||||
|
||||
@@ -4,7 +4,6 @@ Imports System.IO
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
|
||||
|
||||
Public Class EgtManageFileDialogVM
|
||||
Inherits VMBase
|
||||
@@ -46,6 +45,8 @@ Public Class EgtManageFileDialogVM
|
||||
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)
|
||||
m_SelExstension.sNameExstension = m_ListFilter(0).sNameExstension
|
||||
m_SelExstension.sExstension = m_ListFilter(0).sExstension
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
@@ -99,26 +100,17 @@ Public Class EgtManageFileDialogVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared m_sUrl_Msg As String
|
||||
Public Property sUrl_Msg As String
|
||||
Public m_sUrl_Msg As String
|
||||
Public Overloads Property sUrl_Msg As String
|
||||
Get
|
||||
Return m_sUrl_Msg
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sUrl_Msg = value
|
||||
NotifyPropertyChanged(NameOf(sUrl_Msg))
|
||||
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
|
||||
@@ -126,6 +118,7 @@ Public Class EgtManageFileDialogVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSaveFileName = value
|
||||
NotifyPropertyChanged(NameOf(sSaveFileName))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -170,16 +163,6 @@ Public Class EgtManageFileDialogVM
|
||||
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
|
||||
@@ -269,7 +252,7 @@ Public Class EgtManageFileDialogVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared m_SelExstension As EgtExstension
|
||||
Public m_SelExstension As EgtExstension
|
||||
Public Property SelExstension As EgtExstension
|
||||
Get
|
||||
Return m_SelExstension
|
||||
@@ -283,7 +266,7 @@ Public Class EgtManageFileDialogVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared m_SelTreeItem As EgtDirectory
|
||||
Public m_SelTreeItem As EgtDirectory
|
||||
Public Property SelTreeItem As EgtDirectory
|
||||
Get
|
||||
Return m_SelTreeItem
|
||||
@@ -317,11 +300,12 @@ Public Class EgtManageFileDialogVM
|
||||
m_ListFilter = New ObservableCollection(Of EgtExstension)
|
||||
|
||||
For i As Integer = 0 To drives.Count() - 1
|
||||
Dim directory As New EgtFolder(drives(i).RootDirectory, Nothing)
|
||||
Dim directory As New EgtFolder(drives(i).RootDirectory, Nothing, Me)
|
||||
'AddHandler directory.PropertyChanged, AddressOf Directory_PropertyChanged
|
||||
m_RootList.Add(directory)
|
||||
Next
|
||||
|
||||
m_SelExstension = New EgtExstension()
|
||||
SetVisualizzationList()
|
||||
|
||||
m_SelVisualization.Id = VisualizationType.SCHEDULETEMPLATE
|
||||
@@ -363,43 +347,43 @@ Public Class EgtManageFileDialogVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Folder_Msg As String
|
||||
Public ReadOnly Property Folder_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15064)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property FileName_Msg As String
|
||||
Public ReadOnly Property FileName_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15065)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Schedule_Msg As String
|
||||
Public ReadOnly Property Schedule_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15067)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Details_Msg As String
|
||||
Public ReadOnly Property Details_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15068)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Boxing_Msg As String
|
||||
Public ReadOnly Property Boxing_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15069)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property Content_Msg As String
|
||||
Public ReadOnly Property Content_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15070)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property DataFolder_Msg As String
|
||||
Public ReadOnly Property DataFolder_Msg As String
|
||||
Get
|
||||
Return EgtMsg(15071)
|
||||
End Get
|
||||
@@ -451,7 +435,7 @@ Public Class EgtManageFileDialogVM
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
Dim CurrItem As EgtItem = TryCast(EgtFolder.m_ItemSelected, EgtItem)
|
||||
Dim CurrItem As EgtItem = TryCast(m_SelTreeItem.m_ItemSelected, EgtItem)
|
||||
If Not IsNothing(CurrItem) Then
|
||||
m_sFileName = m_SelTreeItem.InfoDir.FullName & "\" & CurrItem.sName
|
||||
Else
|
||||
@@ -472,12 +456,13 @@ Public Class EgtManageFileDialogVM
|
||||
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))
|
||||
If Not IsNothing(m_SelTreeItem.m_ParentFolder) Then
|
||||
m_SelTreeItem = m_SelTreeItem.m_ParentFolder
|
||||
m_SelTreeItem.IsSelected = True
|
||||
m_sUrl_Msg = ""
|
||||
m_sUrl_Msg = m_SelTreeItem.InfoDir.FullName
|
||||
NotifyPropertyChanged(NameOf(sUrl_Msg))
|
||||
End If
|
||||
End Sub
|
||||
#End Region 'Command GoBack
|
||||
|
||||
@@ -534,6 +519,8 @@ Public Class EgtDirectory
|
||||
|
||||
Friend Shared refUpdateSelRoot As Action(Of EgtDirectory)
|
||||
|
||||
Friend Shared m_refEgtManageFileDialogVM As EgtManageFileDialogVM
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Overridable Property IsSelected As Boolean
|
||||
Get
|
||||
@@ -575,7 +562,7 @@ Public Class EgtDirectory
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared m_sIconSource As String
|
||||
Public m_sIconSource As String
|
||||
Public Property sIconSource As String
|
||||
Get
|
||||
Return m_sIconSource
|
||||
@@ -615,6 +602,39 @@ Public Class EgtDirectory
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public 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
|
||||
|
||||
Public m_ItemSelected As EgtDirectory
|
||||
Public Property ItemSelected As EgtDirectory
|
||||
Get
|
||||
Return m_ItemSelected
|
||||
End Get
|
||||
Set(value As EgtDirectory)
|
||||
m_ItemSelected = value
|
||||
|
||||
Dim Item As EgtItem = TryCast(m_ItemSelected, EgtItem)
|
||||
If Not IsNothing(Item) Then
|
||||
m_refEgtManageFileDialogVM.sSaveFileName = Item.sName
|
||||
Else
|
||||
m_refEgtManageFileDialogVM.sSaveFileName = "New.icrs"
|
||||
End If
|
||||
|
||||
Dim Folder As EgtFolder = TryCast(m_ItemSelected, EgtFolder)
|
||||
If Not IsNothing(Folder) Then
|
||||
Folder.IsExpanded = True
|
||||
Folder.IsSelected = True
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
End Class
|
||||
@@ -624,7 +644,11 @@ Public Class EgtFolder
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public Shared m_ItemList_View As CollectionView = Nothing
|
||||
Public m_ItemList_View As CollectionView = Nothing
|
||||
|
||||
Friend Sub SetEgtManageFileDialogVM(EgtManageFileDialogVM As EgtManageFileDialogVM)
|
||||
m_refEgtManageFileDialogVM = EgtManageFileDialogVM
|
||||
End Sub
|
||||
|
||||
Private m_FolderList As New ObservableCollection(Of EgtDirectory)
|
||||
Public Property FolderList As ObservableCollection(Of EgtDirectory)
|
||||
@@ -636,16 +660,6 @@ Public Class EgtFolder
|
||||
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
|
||||
@@ -676,16 +690,6 @@ Public Class EgtFolder
|
||||
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
|
||||
@@ -697,7 +701,7 @@ Public Class EgtFolder
|
||||
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()
|
||||
DirectoryList = m_InfoDir.GetDirectories().Where(Function(file) (file.Attributes And FileAttributes.Hidden And file.Name <> m_refEgtManageFileDialogVM.DataFolder_Msg) = 0).ToArray()
|
||||
FileList = m_InfoDir.GetFiles().Where(Function(file) (file.Attributes And FileAttributes.Hidden) = 0).ToArray()
|
||||
Catch ex As Exception
|
||||
DirectoryList = Nothing
|
||||
@@ -706,7 +710,7 @@ Public Class EgtFolder
|
||||
m_FolderList.Clear()
|
||||
If Not IsNothing(DirectoryList) Then
|
||||
For Each subDir As DirectoryInfo In DirectoryList
|
||||
Dim directory As New EgtFolder(subDir, Me)
|
||||
Dim directory As New EgtFolder(subDir, Me, m_refEgtManageFileDialogVM)
|
||||
m_FolderList.Add(directory)
|
||||
Next
|
||||
End If
|
||||
@@ -727,10 +731,11 @@ Public Class EgtFolder
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
refUpdateSelRoot(Me)
|
||||
m_refEgtManageFileDialogVM.sUrl_Msg = m_InfoDir.FullName
|
||||
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()
|
||||
DirectoryList = m_InfoDir.GetDirectories().Where(Function(file) (file.Attributes And FileAttributes.Hidden And file.Name <> m_refEgtManageFileDialogVM.DataFolder_Msg) = 0).ToArray()
|
||||
FileList = m_InfoDir.GetFiles().Where(Function(file) (file.Attributes And FileAttributes.Hidden) = 0).ToArray()
|
||||
Catch ex As Exception
|
||||
DirectoryList = Nothing
|
||||
@@ -739,14 +744,18 @@ Public Class EgtFolder
|
||||
m_FolderList.Clear()
|
||||
If Not IsNothing(DirectoryList) Then
|
||||
For Each subDir As DirectoryInfo In DirectoryList
|
||||
Dim directory As New EgtFolder(subDir, Me)
|
||||
Dim directory As New EgtFolder(subDir, Me, m_refEgtManageFileDialogVM)
|
||||
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)
|
||||
If file.sTypeItem.Substring(5).ToLower() = m_refEgtManageFileDialogVM.m_SelExstension.sExstension.TrimStart("*") Then
|
||||
m_FolderList.Add(file)
|
||||
Else
|
||||
m_FolderList.Add(file)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Set
|
||||
@@ -756,7 +765,9 @@ Public Class EgtFolder
|
||||
|
||||
#Region "CONTRUCTORS"
|
||||
|
||||
Sub New(InfoDir As DirectoryInfo, Folder As EgtFolder)
|
||||
Sub New(InfoDir As DirectoryInfo, Folder As EgtDirectory, EgtManageFileDialogVM As EgtManageFileDialogVM)
|
||||
|
||||
SetEgtManageFileDialogVM(EgtManageFileDialogVM)
|
||||
|
||||
m_InfoDir = InfoDir
|
||||
m_sName = InfoDir.Name
|
||||
@@ -765,15 +776,13 @@ Public Class EgtFolder
|
||||
m_sTypeItem = "File " & InfoDir.Extension.ToUpper()
|
||||
m_sIconSource = "\Resources\EgtDialog\New.png"
|
||||
Else
|
||||
m_sTypeItem = EgtManageFileDialogVM.Folder_Msg
|
||||
m_sTypeItem = m_refEgtManageFileDialogVM.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
|
||||
|
||||
@@ -782,6 +791,7 @@ Public Class EgtFolder
|
||||
NotifyPropertyChanged(NameOf(sTypeItem))
|
||||
NotifyPropertyChanged(NameOf(sIconSource))
|
||||
NotifyPropertyChanged(NameOf(FolderList))
|
||||
NotifyPropertyChanged(NameOf(ParentFolder))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONTRUCTORS
|
||||
@@ -791,10 +801,8 @@ Public Class EgtFolder
|
||||
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)
|
||||
If Not IsNothing(CurrItem) AndAlso Not IsNothing(m_refEgtManageFileDialogVM.m_SelExstension.m_sExstension) Then
|
||||
If CurrItem.sTypeItem.Substring(5).ToLower() = m_refEgtManageFileDialogVM.m_SelExstension.m_sExstension.TrimStart("*") Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
@@ -853,17 +861,6 @@ Public Class EgtItem
|
||||
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"
|
||||
|
||||
@@ -263,20 +263,20 @@ Public Class MySceneHostVM
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
'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 {
|
||||
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",
|
||||
' .FilterIndex = 1,
|
||||
' .InitialDirectory = sDir
|
||||
'}
|
||||
If Not OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Return False
|
||||
sFilePath = OpenFileDialog.FileName
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user