Imports EgtUILib Namespace EgtCAM5 Public Class GridPanelVM Inherits ViewModelBase #Region "FIELDS & PROPERTIES" ' Definizione comandi Private m_cmdCPlaneTop As ICommand Private m_cmdCPlaneFront As ICommand Private m_cmdCPlaneRight As ICommand Private m_cmdCPlaneBack As ICommand Private m_cmdCPlaneLeft As ICommand Private m_cmdCPlaneBottom As ICommand Private m_cmdCPlaneView As ICommand Private m_cmdCPlaneElevation As ICommand Private m_cmdCPlaneOrigin As ICommand Private m_cmdCPlaneRotate As ICommand Private m_cmdCPlane3P As ICommand Private m_cmdCPlanePerpObj As ICommand Private m_cmdCPlaneObj As ICommand #Region "ToolTip" Public ReadOnly Property CPlaneTopToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 19) End Get End Property Public ReadOnly Property CPlaneFrontToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 20) End Get End Property Public ReadOnly Property CPlaneRightToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 21) End Get End Property Public ReadOnly Property CPlaneBackToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 22) End Get End Property Public ReadOnly Property CPlaneLeftToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 23) End Get End Property Public ReadOnly Property CPlaneBottomToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 24) End Get End Property Public ReadOnly Property CPlaneElevationToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 26) End Get End Property Public ReadOnly Property CPlaneOriginToolTip As String Get Return EgtMsg(MSG_GRIDVIEWPANEL + 27) End Get End Property #End Region ' Tooltip #End Region #Region "COMMANDS" #Region "CPlaneTopCommand" ''' ''' Returns a command that do CPlaneTop. ''' Public ReadOnly Property CPlaneTopCommand As ICommand Get If m_cmdCPlaneTop Is Nothing Then m_cmdCPlaneTop = New RelayCommand(AddressOf CPlaneTop) End If Return m_cmdCPlaneTop End Get End Property ''' ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand. ''' Public Sub CPlaneTop(ByVal param As Object) Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.TOP) Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID) End Sub #End Region ' CPlaneTopCommand #Region "CPlaneFrontCommand" ''' ''' Returns a command that do CPlaneFront. ''' Public ReadOnly Property CPlaneFrontCommand As ICommand Get If m_cmdCPlaneFront Is Nothing Then m_cmdCPlaneFront = New RelayCommand(AddressOf CPlaneFront) End If Return m_cmdCPlaneFront End Get End Property ''' ''' Execute the CPlaneFront. This method is invoked by the CPlaneFrontCommand. ''' Public Sub CPlaneFront(ByVal param As Object) Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.FRONT) Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID) End Sub #End Region ' CPlaneFrontCommand #Region "CPlaneRightCommand" ''' ''' Returns a command that do CPlaneRight. ''' Public ReadOnly Property CPlaneRightCommand As ICommand Get If m_cmdCPlaneRight Is Nothing Then m_cmdCPlaneRight = New RelayCommand(AddressOf CPlaneRight) End If Return m_cmdCPlaneRight End Get End Property ''' ''' Execute the CPlaneRight. This method is invoked by the CPlaneRightCommand. ''' Public Sub CPlaneRight(ByVal param As Object) Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.RIGHT) Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID) End Sub #End Region ' CPlaneRightCommand #Region "CPlaneBackCommand" ''' ''' Returns a command that do CPlaneBack. ''' Public ReadOnly Property CPlaneBackCommand As ICommand Get If m_cmdCPlaneBack Is Nothing Then m_cmdCPlaneBack = New RelayCommand(AddressOf CPlaneBack) End If Return m_cmdCPlaneBack End Get End Property ''' ''' Execute the CPlaneBack. This method is invoked by the CPlaneBackCommand. ''' Public Sub CPlaneBack(ByVal param As Object) Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.BACK) Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID) End Sub #End Region ' CPlaneBackCommand #Region "CPlaneLeftCommand" ''' ''' Returns a command that do CPlaneLeft. ''' Public ReadOnly Property CPlaneLeftCommand As ICommand Get If m_cmdCPlaneLeft Is Nothing Then m_cmdCPlaneLeft = New RelayCommand(AddressOf CPlaneLeft) End If Return m_cmdCPlaneLeft End Get End Property ''' ''' Execute the CPlaneLeft. This method is invoked by the CPlaneLeftCommand. ''' Public Sub CPlaneLeft(ByVal param As Object) Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.LEFT) Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID) End Sub #End Region ' CPlaneLeftCommand #Region "CPlaneBottomCommand" ''' ''' Returns a command that do CPlaneBottom. ''' Public ReadOnly Property CPlaneBottomCommand As ICommand Get If m_cmdCPlaneBottom Is Nothing Then m_cmdCPlaneBottom = New RelayCommand(AddressOf CPlaneBottom) End If Return m_cmdCPlaneBottom End Get End Property ''' ''' Execute the CPlaneBottom. This method is invoked by the CPlaneBottomCommand. ''' Public Sub CPlaneBottom(ByVal param As Object) Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.BOTTOM) Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID) End Sub #End Region ' CPlaneBottomCommand #Region "CPlaneElevationCommand" ''' ''' Returns a command that do CPlaneElevation. ''' Public ReadOnly Property CPlaneElevationCommand As ICommand Get If m_cmdCPlaneElevation Is Nothing Then m_cmdCPlaneElevation = New RelayCommand(AddressOf CPlaneElevation) End If Return m_cmdCPlaneElevation End Get End Property ''' ''' Execute the CPlaneElevation. This method is invoked by the CPlaneElevationCommand. ''' Public Sub CPlaneElevation(ByVal param As Object) Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_ELEVATION) End Sub #End Region ' CPlaneElevationCommand #Region "CPlaneOriginCommand" ''' ''' Returns a command that do CPlaneOrigin. ''' Public ReadOnly Property CPlaneOriginCommand As ICommand Get If m_cmdCPlaneOrigin Is Nothing Then m_cmdCPlaneOrigin = New RelayCommand(AddressOf CPlaneOrigin) End If Return m_cmdCPlaneOrigin End Get End Property ''' ''' Execute the CPlaneOrigin. This method is invoked by the CPlaneOriginCommand. ''' Public Sub CPlaneOrigin(ByVal param As Object) Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_ORIGIN) End Sub #End Region ' CPlaneOriginCommand #End Region ' COMMANDS End Class End Namespace