Files
omagoffice/OptionPanel/OptionPanelV.xaml.vb

62 lines
2.0 KiB
VB.net

Imports System.IO
Imports EgtUILib
Public Class OptionPanelV
Private m_OptionPanelVM As OptionPanelVM
#Region "CONSTRUCTOR"
Sub New()
' Funzione che interpreta l'xaml
InitializeComponent()
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_OptionPanelVM = DirectCast(Me.DataContext, OptionPanelVM)
End Sub
#End Region ' CONSTRUCTOR
#Region "EVENTS"
Public Sub NestingTab_Click(sender As Object, e As MouseButtonEventArgs)
' Se non sono in RawPartTab proseguo
If Tabs.SelectedIndex <> 0 Then Return
' Tolgo il fuoco dalle textbox per averne i valori aggiornati e per costringere ad eseguire UpdateTabState
Keyboard.Focus(Tabs)
' Se non consentito passaggio ad altro tab interrompo l'evento
If Not OmagOFFICEMap.refOptionPanelVM.NestTabIsEnabled Then e.Handled = True
End Sub
Private Sub Label_MouseLeftButtonDown(sender As Object, e As MouseButtonEventArgs)
If Not (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then Return
Dim sTmpDir As String = String.Empty
If Not EgtInterface.EgtGetTempDir(sTmpDir) Then Return
' Genero file CNC (lancio anche se errore in precedenza)
Dim sLog1 As String = sTmpDir & "\OmagOFFICELog1.txt"
Dim sLog2 As String = sTmpDir & "\OmagOFFICELog2.txt"
Dim sLog As String = ""
If File.Exists(sLog1) AndAlso File.Exists(sLog2) Then
If File.GetLastAccessTimeUtc(sLog1) > File.GetLastAccessTimeUtc(sLog2) Then
sLog = sLog1
Else
sLog = sLog2
End If
ElseIf File.Exists(sLog1) AndAlso Not File.Exists(sLog2) Then
sLog = sLog1
ElseIf File.Exists(sLog2) AndAlso Not File.Exists(sLog1) Then
sLog = sLog2
End If
Try
Process.Start("Notepad.exe", sLog)
Catch ex As Exception
ex.ToString()
End Try
'End If
End Sub
#End Region ' EVENTS
End Class