35 lines
1.4 KiB
VB.net
35 lines
1.4 KiB
VB.net
Public Class ManagePartPanelV
|
|
|
|
Protected Sub Item_ContextMenuOpening(sender As Object, e As ContextMenuEventArgs)
|
|
Dim PartItem As ManagePart_Part
|
|
Dim LayerItem As ManagePart_Layer
|
|
Dim EntityItem As PartManager_GeomEntity
|
|
Select Case e.OriginalSource.DataContext.GetType()
|
|
Case GetType(ManagePart_Part)
|
|
PartItem = DirectCast(e.OriginalSource.DataContext, ManagePart_Part)
|
|
If PartItem.MenuList.Count = 0 Then
|
|
e.Handled = True
|
|
End If
|
|
Case GetType(ManagePart_Layer)
|
|
LayerItem = DirectCast(e.OriginalSource.DataContext, ManagePart_Layer)
|
|
If LayerItem.Type <> ManagePart_Layer.LayerType.PRINT_SOLID OrElse LayerItem.MenuList.Count = 0 Then
|
|
e.Handled = True
|
|
End If
|
|
Case GetType(PartManager_GeomEntity)
|
|
EntityItem = DirectCast(e.OriginalSource.DataContext, PartManager_GeomEntity)
|
|
If EntityItem.MenuList.Count = 0 Then
|
|
e.Handled = True
|
|
End If
|
|
End Select
|
|
End Sub
|
|
|
|
Private Sub TextBox_PreviewKeyDown(sender As Object, e As KeyEventArgs)
|
|
' per evitare che il click del tasto Enter a fine edit faccia scattare anche la chiusura
|
|
' di tutto il pannello a causa del IsDefault sul tasto di chiusura, termino la gestione del click
|
|
If e.Key = Key.Enter Then
|
|
e.Handled = True
|
|
End If
|
|
End Sub
|
|
|
|
End Class
|