Files
egtstone3d/ProjManager/ProjManagerVM.vb
T

117 lines
2.7 KiB
VB.net

Imports EgtWPFLib5
Imports EgtUILib
Imports System.Windows.Forms
Public Class ProjManagerVM
#Region "FIELDS & PROPERTIES"
' Definizione Comandi
Private m_NewFileCmd As ICommand
Private m_SaveFileCmd As ICommand
Private m_OpenFileCmd As ICommand
Private m_cmdOptions As ICommand
#End Region ' Fields & Properties
#Region "COMMANDS"
#Region "NewFileCmd"
Public ReadOnly Property NewFileCmd As ICommand
Get
If IsNothing(m_NewFileCmd) Then
m_NewFileCmd = New Command(AddressOf NewFile)
End If
Return m_NewFileCmd
End Get
End Property
Private Sub NewFile()
End Sub
#End Region ' NewFileCmd
#Region "OpenFileCmd"
Public ReadOnly Property OpenFileCmd As ICommand
Get
If IsNothing(m_OpenFileCmd) Then
m_OpenFileCmd = New Command(AddressOf OpenFile)
End If
Return m_OpenFileCmd
End Get
End Property
Private Sub OpenFile()
Dim OpenFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
.Title = "Open",
.Filter = "nge files (*.nge)|*.nge" &
"|vme files (*.vme)|*.vme",
.FilterIndex = 2,
.InitialDirectory = "C:\EgtData\EgtStone3D\Temp",
.Mode = 1
}
If Not OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Return
If String.IsNullOrEmpty(OpenFileDialog.FileName) Then Return
Dim sFilePath As String = OpenFileDialog.FileName
EgtOpenFile(sFilePath)
SolidManagerM.CreatePartSolid()
EgtDraw()
End Sub
#End Region ' OpenFileCmd
#Region "SaveFileCmd"
Public ReadOnly Property SaveFileCmd As ICommand
Get
If IsNothing(m_SaveFileCmd) Then
m_SaveFileCmd = New Command(AddressOf SaveFile)
End If
Return m_SaveFileCmd
End Get
End Property
Private Sub SaveFile()
End Sub
#End Region ' SaveFileCmd
#Region "OptionsCmd"
''' <summary>
''' Returns a command that do Export.
''' </summary>
Public ReadOnly Property OptionsCommand As ICommand
Get
If m_cmdOptions Is Nothing Then
m_cmdOptions = New Command(AddressOf Options)
End If
Return m_cmdOptions
End Get
End Property
''' <summary>
''' Execute the Export. This method is invoked by the ExportCommand.
''' </summary>
Public Sub Options(ByVal param As Object)
Dim OptionsWindow As New OptionWindowV With {
.DataContext = New OptionWindowVM,
.Owner = Application.Current.MainWindow
}
OptionsWindow.ShowDialog()
End Sub
#End Region ' OptionsCmd
#End Region ' Commands
End Class