209cab548b
- spostato processEvent in main che rimanda alle varie parti del programma
92 lines
1.9 KiB
VB.net
92 lines
1.9 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib.EgtInterface
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class ImportLoadingWndVM
|
|
Inherits VMBase
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
' Funzioni di callback per output in interfaccia da LUA
|
|
Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
|
|
|
|
Private m_bStopLoading As Boolean = False
|
|
|
|
Private m_Loading_Value As Double
|
|
Public Property Loading_Value As Double
|
|
Get
|
|
Return m_Loading_Value
|
|
End Get
|
|
Set(value As Double)
|
|
m_Loading_Value = value
|
|
End Set
|
|
End Property
|
|
|
|
' Definizione comandi
|
|
Private m_cmdStop As ICommand
|
|
|
|
#End Region ' FIELDS & PROPERTIES
|
|
|
|
#Region "MESSAGES"
|
|
|
|
Public ReadOnly Property Loading_Msg As String
|
|
Get
|
|
Return "Importing file..."
|
|
End Get
|
|
End Property
|
|
|
|
#End Region ' MESSAGES
|
|
|
|
#Region "CONSTRUCTORS"
|
|
|
|
Sub New()
|
|
' Creo riferimento a questa classe in Map
|
|
Map.SetRefImportLoadingWndVM(Me)
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTORS
|
|
|
|
#Region "METHODS"
|
|
|
|
Friend Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
|
|
m_Loading_Value = nProg
|
|
NotifyPropertyChanged(NameOf(Loading_Value))
|
|
' Costringo ad aggiornare
|
|
UpdateUI()
|
|
' Eventuale attesa
|
|
Threading.Thread.Sleep(nPause)
|
|
' Ritorno eventuale stop
|
|
If m_bStopLoading Then
|
|
m_bStopLoading = False
|
|
Return 1
|
|
Else
|
|
Return 0
|
|
End If
|
|
Return 0
|
|
End Function
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "Stop"
|
|
|
|
Public ReadOnly Property Stop_Command As ICommand
|
|
Get
|
|
If m_cmdStop Is Nothing Then
|
|
m_cmdStop = New Command(AddressOf StopLoading)
|
|
End If
|
|
Return m_cmdStop
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub StopLoading()
|
|
m_bStopLoading = True
|
|
End Sub
|
|
|
|
#End Region ' Stop
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|