From e9477be7b2659fe48b803abacbe3555edcd3b118 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Thu, 4 Oct 2018 13:14:52 +0000 Subject: [PATCH] =?UTF-8?q?EgtDOORCReator=201.9j1:=20-=20=C3=A8=20possibil?= =?UTF-8?q?e=20aprire=20la=20pagina=20Help=20direttamente=20nel=20Browser?= =?UTF-8?q?=20del=20pc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Guide/GuideV.xaml.vb | 29 ++++++++++++++++++++++++++--- My Project/AssemblyInfo.vb | 4 ++-- OptionsWindow/OptionModule.vb | 24 +++++++++++++++++++++--- ProjectManager/ProjectManagerVM.vb | 2 +- 4 files changed, 50 insertions(+), 9 deletions(-) diff --git a/Guide/GuideV.xaml.vb b/Guide/GuideV.xaml.vb index bd5a9bc..b1e840c 100644 --- a/Guide/GuideV.xaml.vb +++ b/Guide/GuideV.xaml.vb @@ -1,4 +1,6 @@ -Public Class GuideV +Imports EgtUILib + +Public Class GuideV Private m_GuideVM As GuideVM Public Shared m_Language As String @@ -16,8 +18,29 @@ ' Prova della lettura di un file chm (Help) 'System.Windows.Forms.Help.ShowHelp(Nothing, "c:\EgtData\EgtDOORCreator\Help\Prova\HelpNDoc tutorial.chm") Dim sHelpDir As String = String.Empty - If OptionModule.m_SmartHelp Then sHelpDir = IniFile.m_sHelpDir Else sHelpDir = IniFile.m_sHelpDir.Replace("C:", "file://127.0.0.1/c$") - DoorBrowser.Navigate(New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html")) + If OptionModule.m_SmartHelp = HelpPage.LocalHost Then + sHelpDir = IniFile.m_sHelpDir.Replace("C:", "file://127.0.0.1/c$") + DoorBrowser.Navigate(New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html")) + ElseIf OptionModule.m_SmartHelp = HelpPage.WebBrowserVB Then + sHelpDir = IniFile.m_sHelpDir + DoorBrowser.Navigate(New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html")) + Else + sHelpDir = IniFile.m_sHelpDir + Try + Process.Start(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html") + Catch ex As Exception + EgtOutLog("Errore nel caricamento pagina Help") + End Try + End If + + 'If OptionModule.m_SmartHelp Then sHelpDir = IniFile.m_sHelpDir Else sHelpDir = IniFile.m_sHelpDir.Replace("C:", "file://127.0.0.1/c$") + '' DoorBrowser.Navigate(New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html")) + 'Try + ' Process.Start(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html") + 'Catch ex As Exception + ' EgtOutLog("Errore nel caricamento pagina Help") + 'End Try + End Sub End Class diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 432f9b8..2020ece 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 432c2f4..dd52e13 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -42,7 +42,14 @@ Friend Module OptionModule Assembly = 1 End Enum - Friend m_SmartHelp As Boolean = False + Friend m_SmartHelp As HelpPage = HelpPage.WebBrowserVB + + Friend Enum HelpPage + LocalHost + WebBrowserVB + WebBrowserPC + End Enum + Friend m_DisableHM As Boolean = False Friend m_DisableDeleteCommandHM As Boolean = False @@ -211,7 +218,18 @@ Friend Module OptionModule EgtOutLog(String.Format(EgtMsg(50180), sMachinDir)) End If - m_SmartHelp = (GetMainPrivateProfileInt(S_GENERAL, K_SMARTHELP, 1) = 0) + Dim nHelpSelct As Integer = 0 + Select Case GetMainPrivateProfileInt(S_GENERAL, K_SMARTHELP, 1) + Case 0 + m_SmartHelp = HelpPage.WebBrowserVB + Case 1 + m_SmartHelp = HelpPage.LocalHost + Case 2 + m_SmartHelp = HelpPage.WebBrowserPC + Case Else + m_SmartHelp = HelpPage.WebBrowserVB + End Select + m_DisableHM = (GetMainPrivateProfileInt(S_GENERAL, K_DISABLEHM, 1) = 0) @@ -632,7 +650,7 @@ Friend Module OptionModule Else SwingDDF = Trim(SwingDDF) SwingDDF = SwingDDF.Substring(0, 2) - End If + End If Exit For End If Next diff --git a/ProjectManager/ProjectManagerVM.vb b/ProjectManager/ProjectManagerVM.vb index 9121c7e..a9fdf38 100644 --- a/ProjectManager/ProjectManagerVM.vb +++ b/ProjectManager/ProjectManagerVM.vb @@ -618,7 +618,7 @@ Public Class ProjectManagerVM Public Sub Guide() Dim GuideWindow As New GuideV(Application.Current.MainWindow, New GuideVM) - GuideWindow.Show() + If Not OptionModule.m_SmartHelp = HelpPage.WebBrowserPC Then GuideWindow.Show() End Sub #End Region ' Guide