EgtCAM5 :
- Migliorie varie.
This commit is contained in:
+271
-1
@@ -39,6 +39,14 @@ Namespace EgtCAM5
|
||||
Private m_cmdTreeViewDoubleClick As ICommand
|
||||
Private m_cmdTreeViewMouseUp As ICommand
|
||||
Private m_cmdTreeViewMouseRightButton As ICommand
|
||||
Private m_cmdSelect As ICommand
|
||||
Private m_cmdDeselect As ICommand
|
||||
Private m_cmdName As ICommand
|
||||
Private m_cmdInfo As ICommand
|
||||
Private m_cmdRelocate As ICommand
|
||||
Private m_cmdCopy As ICommand
|
||||
Private m_cmdDelete As ICommand
|
||||
Private m_cmdSave As ICommand
|
||||
|
||||
' Lista dei layer
|
||||
Private m_LayerList As New ObservableCollection(Of LayerTreeViewItem)
|
||||
@@ -51,13 +59,21 @@ Namespace EgtCAM5
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'
|
||||
Private m_RightClickedTreeItemId As Integer
|
||||
Public ReadOnly Property RightClickedTreeItemId As Integer
|
||||
Get
|
||||
Return m_RightClickedTreeItemId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
'Imposto tempo di evidenziazione delle entità clickate
|
||||
ObjTreeTimer.Interval = New TimeSpan(0, 0, 1)
|
||||
ObjTreeTimer.Interval = TimeSpan.FromMilliseconds(200)
|
||||
Application.Msn.Register(Application.LOADOBJTREE, Sub()
|
||||
LoadObjTree()
|
||||
End Sub)
|
||||
@@ -82,6 +98,10 @@ Namespace EgtCAM5
|
||||
Application.Msn.Register(Application.UPDATEOBJTREEOLDID, Sub(ObjTreeOldId As Integer)
|
||||
Me.m_nObjTreeOldId = ObjTreeOldId
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.RIGHTCLICKEDLAYERTREEITEM, Sub(Id As Integer)
|
||||
m_RightClickedTreeItemId = Id
|
||||
End Sub)
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -302,6 +322,256 @@ Namespace EgtCAM5
|
||||
|
||||
#End Region ' TreeViewMouseUpCommand
|
||||
|
||||
#Region "SelectCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Point.
|
||||
''' </summary>
|
||||
Public ReadOnly Property SelectCommand As ICommand
|
||||
Get
|
||||
If m_cmdSelect Is Nothing Then
|
||||
m_cmdSelect = New RelayCommand(AddressOf SelectCmd, AddressOf CanSelect)
|
||||
End If
|
||||
Return m_cmdSelect
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub SelectCmd(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, RightClickedTreeItemId)
|
||||
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SELECTPARTLAYEROBJ)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanSelect(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' SelectCommand
|
||||
|
||||
#Region "DeselectCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Point.
|
||||
''' </summary>
|
||||
Public ReadOnly Property DeselectCommand As ICommand
|
||||
Get
|
||||
If m_cmdDeselect Is Nothing Then
|
||||
m_cmdDeselect = New RelayCommand(AddressOf Deselect, AddressOf CanDeselect)
|
||||
End If
|
||||
Return m_cmdDeselect
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub Deselect(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, RightClickedTreeItemId)
|
||||
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.DESELECTPARTLAYEROBJ)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanDeselect(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' DeselectCommand
|
||||
|
||||
#Region "NameCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Point.
|
||||
''' </summary>
|
||||
Public ReadOnly Property NameCommand As ICommand
|
||||
Get
|
||||
If m_cmdName Is Nothing Then
|
||||
m_cmdName = New RelayCommand(AddressOf Name, AddressOf CanName)
|
||||
End If
|
||||
Return m_cmdName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub Name(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, RightClickedTreeItemId)
|
||||
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETNAME)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanName(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' NameCommand
|
||||
|
||||
#Region "InfoCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Point.
|
||||
''' </summary>
|
||||
Public ReadOnly Property InfoCommand As ICommand
|
||||
Get
|
||||
If m_cmdInfo Is Nothing Then
|
||||
m_cmdInfo = New RelayCommand(AddressOf Info, AddressOf CanInfo)
|
||||
End If
|
||||
Return m_cmdInfo
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub Info(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, RightClickedTreeItemId)
|
||||
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETINFO)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanInfo(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' InfoCommand
|
||||
|
||||
#Region "RelocateCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Point.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RelocateCommand As ICommand
|
||||
Get
|
||||
If m_cmdRelocate Is Nothing Then
|
||||
m_cmdRelocate = New RelayCommand(AddressOf Relocate, AddressOf CanRelocate)
|
||||
End If
|
||||
Return m_cmdRelocate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub Relocate(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, RightClickedTreeItemId)
|
||||
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.RELOCATEPARTLAYEROBJ)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanRelocate(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' RelocateCommand
|
||||
|
||||
#Region "CopyCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Point.
|
||||
''' </summary>
|
||||
Public ReadOnly Property CopyCommand As ICommand
|
||||
Get
|
||||
If m_cmdCopy Is Nothing Then
|
||||
m_cmdCopy = New RelayCommand(AddressOf Copy, AddressOf CanCopy)
|
||||
End If
|
||||
Return m_cmdCopy
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub Copy(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, RightClickedTreeItemId)
|
||||
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.COPYPARTLAYEROBJ)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanCopy(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' CopyCommand
|
||||
|
||||
#Region "DeleteCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Point.
|
||||
''' </summary>
|
||||
Public ReadOnly Property DeleteCommand As ICommand
|
||||
Get
|
||||
If m_cmdDelete Is Nothing Then
|
||||
m_cmdDelete = New RelayCommand(AddressOf Delete, AddressOf CanDelete)
|
||||
End If
|
||||
Return m_cmdDelete
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub Delete(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, RightClickedTreeItemId)
|
||||
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.DELETE)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanDelete(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' DeleteCommand
|
||||
|
||||
#Region "SaveCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Point.
|
||||
''' </summary>
|
||||
Public ReadOnly Property SaveCommand As ICommand
|
||||
Get
|
||||
If m_cmdSave Is Nothing Then
|
||||
m_cmdSave = New RelayCommand(AddressOf Save, AddressOf CanSave)
|
||||
End If
|
||||
Return m_cmdSave
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub Save(ByVal param As Object)
|
||||
Dim sDir As String = String.Empty
|
||||
GetPrivateProfileString(S_GENERAL, K_LASTNGEOBJDIR, "", sDir)
|
||||
Dim nType As NGE = DirectCast(GetPrivateProfileInt(S_GEOMDB, K_SAVETYPE, NGE.CMPTEXT), NGE)
|
||||
Application.Msn.NotifyColleagues(Application.SAVEOBJECT, New SaveObjectParam(m_RightClickedTreeItemId, sDir, nType))
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanSave(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' SaveCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Reference in New Issue
Block a user