bca8754b82
- Migliorie varie.
174 lines
7.9 KiB
VB.net
174 lines
7.9 KiB
VB.net
Imports EgtCAM5.EgtCAM5
|
|
Class Application
|
|
|
|
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
|
|
' can be handled in this file.
|
|
Protected Overrides Sub OnStartUp(e As System.Windows.StartupEventArgs)
|
|
MyBase.OnStartup(e)
|
|
' Creo la View principale
|
|
Dim MainWndView As New MainWindow
|
|
' Creo il ViewModel principale
|
|
Dim MainWndViewModel As New MainWindowViewModel
|
|
' Assegno il ViewModel alla View
|
|
MainWndView.DataContext = MainWndViewModel
|
|
' Mostro la View principale
|
|
MainWndView.Show()
|
|
End Sub
|
|
|
|
#Region "Messages"
|
|
|
|
' Generic messages
|
|
Friend Const MAINWINDOW_CONTENTRENDERED As String = "MainWindow_ContentRendered"
|
|
Friend Const MAINWINDOW_ACTIVATED As String = "MainWindow_Activated"
|
|
Friend Const MAINWINDOW_DEACTIVATED As String = "MainWindow_Deactivated"
|
|
Friend Const CLOSEAPPLICATIONCOMMAND As String = "CloseApplicationCommand"
|
|
Friend Const CLOSEAPPLICATION As String = "CloseApplication"
|
|
Friend Const PROJECTPAGE_SELECTED As String = "ProjectPage_Selected"
|
|
Friend Const PROJECTPAGE_DESELECTED As String = "ProjectPage_Deselected"
|
|
|
|
' ProjectPage messages
|
|
Friend Const NOTIFYCURRPOS As String = "NotifyCurrPos"
|
|
Friend Const NOTIFYINPUTTEXT As String = "NotifyInputText"
|
|
Friend Const NOTIFYSTATUSOUTPUT As String = "NotifyStatusOutput"
|
|
Friend Const NOTIFYSTATUSPROGRESS As String = "NotifyStatusProgress"
|
|
Friend Const NOTIFYSTATUSSTOP As String = "NotifyStatusStop"
|
|
Friend Const UPDATESTATUSGRID As String = "UpdateStatusGrid"
|
|
Friend Const LOADGRIDDATA As String = "LoadGridData"
|
|
Friend Const MMUNITSCHANGED As String = "MmUnitsChanged"
|
|
|
|
' GridViewPanel messages
|
|
Friend Const WIREFRAME As String = "Wireframe"
|
|
Friend Const HIDDENLINE As String = "HiddenLine"
|
|
Friend Const SHADING As String = "Shading"
|
|
Friend Const ZOOMALL As String = "ZoomAll"
|
|
Friend Const ZOOMIN As String = "ZoomIn"
|
|
Friend Const ZOOMOUT As String = "ZoomOut"
|
|
Friend Const TOPVIEW As String = "TopView"
|
|
Friend Const FRONTVIEW As String = "FrontView"
|
|
Friend Const LEFTVIEW As String = "LeftView"
|
|
Friend Const BACKVIEW As String = "BackView"
|
|
Friend Const RIGHTVIEW As String = "RightView"
|
|
Friend Const ISOVIEWSW As String = "IsoViewSW"
|
|
Friend Const ISOVIEWSE As String = "IsoViewSE"
|
|
Friend Const ISOVIEWNE As String = "IsoViewNE"
|
|
Friend Const ISOVIEWNW As String = "IsoViewNW"
|
|
Friend Const CURVEDIR As String = "CurveDir"
|
|
Friend Const ANALYZE As String = "Analyze"
|
|
Friend Const GETDIST As String = "GetDist"
|
|
Friend Const CPLANETOP As String = "CPlaneTop"
|
|
Friend Const CPLANEFRONT As String = "CPlaneFront"
|
|
Friend Const CPLANERIGHT As String = "CPlaneRight"
|
|
Friend Const CPLANEBACK As String = "CPlaneBack"
|
|
Friend Const CPLANELEFT As String = "CPlaneLeft"
|
|
Friend Const CPLANEBOTTOM As String = "CPlaneBottom"
|
|
Friend Const CPLANEVIEW As String = "CPlaneView"
|
|
Friend Const CPLANEELEVATION As String = "CPlaneElevation"
|
|
Friend Const CPLANEORIGIN As String = "CPlaneOrigin"
|
|
Friend Const CPLANEROTATE As String = "CPlaneRotate"
|
|
Friend Const CPLANE3P As String = "CPlane3P"
|
|
Friend Const CPLANEPERPOBJ As String = "CPlanePerpObj"
|
|
Friend Const CPLANEOBJ As String = "CPlaneObj"
|
|
|
|
' DrawPanel messages
|
|
Friend Const POINT As String = "Point"
|
|
Friend Const LINE2P As String = "Line2P"
|
|
Friend Const LINEPDL As String = "LinePDL"
|
|
Friend Const CIRCLE As String = "Circle"
|
|
Friend Const ARCCSE As String = "ArcCSE"
|
|
Friend Const ARC3P As String = "Arc3P"
|
|
Friend Const ARCPDP As String = "ArcPDP"
|
|
Friend Const FILLET As String = "Fillet"
|
|
Friend Const RECTANGLE2P As String = "Rectangle2P"
|
|
Friend Const POLYGON As String = "Polygon"
|
|
Friend Const TEXT As String = "Text"
|
|
Friend Const PLANE As String = "Plane"
|
|
Friend Const EXTRUDE As String = "Extrude"
|
|
Friend Const REVOLVE As String = "Revolve"
|
|
Friend Const SCREW As String = "Screw"
|
|
Friend Const RULED As String = "Ruled"
|
|
Friend Const MERGESURF As String = "MergeSurf"
|
|
Friend Const EXPLODESURF As String = "ExplodeSurf"
|
|
Friend Const INVERTSURF As String = "InvertSurf"
|
|
Friend Const DELETE As String = "Delete"
|
|
Friend Const CHANGELAYER As String = "ChangeLayer"
|
|
Friend Const CHANGECOLOR As String = "ChangeColor"
|
|
Friend Const INVERTCURVE As String = "InvertCurve"
|
|
Friend Const CHANGESTARTCURVE As String = "ChangeStartCurve"
|
|
Friend Const EXTENDCURVE As String = "ExtendCurve"
|
|
Friend Const BREAKCURVE As String = "BreakCurve"
|
|
Friend Const JOINCURVE As String = "JoinCurve"
|
|
Friend Const EXPLODECURVE As String = "ExplodeCurve"
|
|
Friend Const SETCURVETH As String = "SetCurveTh"
|
|
Friend Const MOVE As String = "Move"
|
|
Friend Const ROTATE As String = "Rotate"
|
|
Friend Const MIRROR As String = "Mirror"
|
|
Friend Const SCALE As String = "Scale"
|
|
Friend Const OFFSET As String = "Offset"
|
|
|
|
' Controller messages
|
|
Friend Const SETLASTBOOLEAN As String = "SetLastBoolean"
|
|
Friend Const SETLASTINTEGER As String = "SetLastInteger"
|
|
Friend Const SHOW As String = "Show"
|
|
Friend Const DONE As String = "Done"
|
|
Friend Const EXECUTECOMMAND As String = "ExecuteCommand"
|
|
|
|
' DrawOptionPanel messages
|
|
Friend Const PREPAREINPUTBOX As String = "PrepareInputBox"
|
|
Friend Const SETINPUTBOXTEXT As String = "SetInputBoxText"
|
|
Friend Const SETINPUTBOXCHECK As String = "SetInputBoxCheck"
|
|
Friend Const CHANGEINPUTBOXCHECK As String = "ChangeInputBoxCheck"
|
|
Friend Const ADDINPUTBOXCOMBO As String = "AddInputBoxCombo"
|
|
Friend Const RESETINPUTBOX As String = "ResetInputBox"
|
|
Friend Const LOADOBJTREE As String = "LoadObjTree"
|
|
Friend Const UPDATEOBJINOBJTREE As String = "UpdateObjInObjTree"
|
|
Friend Const SELECTIDINOBJTREE As String = "SelectIdInObjTree"
|
|
Friend Const CLEAROBJTREE As String = "ClearObjTree"
|
|
Friend Const UPDATEOBJTREE As String = "UpdateObjTree"
|
|
Friend Const UPDATEHEADERNAME As String = "UpdateHeaderName"
|
|
Friend Const UPDATEHEADERCOLOR As String = "UpdateHeaderColor"
|
|
Friend Const UPDATEOBJTREEOLDID As String = "UpdateObjTreeOldId"
|
|
|
|
' StatusBar messages
|
|
Friend Const STATUSGRIDCOMMAND As String = "StatusGridCommand"
|
|
Friend Const STATUSCURRPOSTYPECOMMAND As String = "StatusCurrPosTypeCommand"
|
|
Friend Const STATUSCURRPOSTYPETEXT As String = "StatusCurrPosTypeText"
|
|
Friend Const STATUSUNITSCOMMAND As String = "StatusUnitsCommand"
|
|
Friend Const UPDATESTATUSUNITS As String = "UpdateStatusUnits"
|
|
Friend Const STATUSSTOPCOMMAND As String = "StatusStopCommand"
|
|
Friend Const STATUSSNAPPOINTTYPETEXT As String = "StatusSnapPointTypeText"
|
|
Friend Const STATUSSNAPPOINTTYPEBACKGROUND As String = "StatusSnapPointTypeBackground"
|
|
|
|
' ToolsDbPage messages
|
|
Friend Const REMOVETOOL As String = "RemoveTool"
|
|
Friend Const ERRORONTOOL As String = "ErrorOnTool"
|
|
|
|
' MachiningsDbPage messages
|
|
Friend Const REMOVEMACHINING As String = "RemoveMachining"
|
|
Friend Const ERRORONMACHINING As String = "ErrorOnMachining"
|
|
|
|
' TopCommandBar
|
|
Friend Const NEWPROJECT As String = "NewProject"
|
|
Friend Const OPENPROJECT As String = "OpenProject"
|
|
Friend Const SAVEPROJECT As String = "SaveProject"
|
|
Friend Const SAVEASPROJECT As String = "SaveAsProject"
|
|
Friend Const INSERTPROJECT As String = "InsertProject"
|
|
Friend Const IMPORTPROJECT As String = "ImportProject"
|
|
Friend Const EXPORTPROJECT As String = "ExportProject"
|
|
Friend Const EXECPROJECT As String = "ExecProject"
|
|
|
|
Shared ReadOnly _messenger As New Messenger()
|
|
|
|
Friend Shared ReadOnly Property Msn As Messenger
|
|
Get
|
|
Return _messenger
|
|
End Get
|
|
End Property
|
|
|
|
Private Sub Application_DispatcherUnhandledException(ByVal sender As System.Object, ByVal e As System.Windows.Threading.DispatcherUnhandledExceptionEventArgs)
|
|
MessageBox.Show(e.Exception.Message)
|
|
e.Handled = True
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
End Class |