ad38e4d3e1
This reverts commit 00a338c202.
87 lines
4.2 KiB
VB.net
87 lines
4.2 KiB
VB.net
'----------------------------------------------------------------------------
|
|
' EgalTech 2017-2017
|
|
'----------------------------------------------------------------------------
|
|
' File : IniFile.vb Data : 08.04.17 Versione : 1.8d1
|
|
' Contenuto : Modulo IniFile per gestione lettura/scrittura da file INI.
|
|
'
|
|
'
|
|
'
|
|
' Modifiche : 08.04.17 ES Creazione modulo.
|
|
'
|
|
'
|
|
'----------------------------------------------------------------------------
|
|
|
|
Imports EgtUILib
|
|
|
|
Public Module IniFile
|
|
|
|
Public m_sIniFile As String
|
|
|
|
Public Function GetMainPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
|
|
Return EgtUILib.GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sIniFile)
|
|
End Function
|
|
|
|
Public Function GetMainPrivateProfileDouble(IpAppName As String, IpKeyName As String, dDefault As Double) As Double
|
|
Return EgtUILib.GetPrivateProfileDouble(IpAppName, IpKeyName, dDefault, m_sIniFile)
|
|
End Function
|
|
|
|
Public Function GetMainPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
|
|
Return EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sIniFile)
|
|
End Function
|
|
|
|
Public Function GetMainPrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Col As EgtUILib.EgtInterface.Color3d) As Boolean
|
|
Return EgtUILib.GetPrivateProfileColor(IpAppName, IpKeyName, Col, m_sIniFile)
|
|
End Function
|
|
|
|
Public Function GetMainPrivateProfileWinPos(IpAppName As String, IpKeyName As String, ByRef nFlag As Integer, ByRef nLeft As Integer, ByRef nTop As Integer, ByRef nWidth As Integer, ByRef nHeight As Integer) As Boolean
|
|
Return EgtUILib.GetPrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
|
|
End Function
|
|
|
|
Public Function GetMainPrivateProfileZoomWin(IpAppName As String, IpKeyName As String, ByRef bOutline As Boolean, ByRef Col As EgtUILib.EgtInterface.Color3d) As Boolean
|
|
Return EgtUILib.GetPrivateProfileZoomWin(IpAppName, IpKeyName, bOutline, Col, m_sIniFile)
|
|
End Function
|
|
|
|
Public Function GetMainPrivateProfileFloatingWinPos(lpAppName As String, lpKeyName As String, ByRef nState As String, ByRef nIndex As Integer, ByRef nLeft As Integer, ByRef nTop As Integer) As Boolean
|
|
Dim sVal As String = String.Empty
|
|
GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
|
|
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
|
If sItems.Count() >= 4 Then
|
|
nState = sItems(0)
|
|
nIndex = CInt(sItems(1))
|
|
nLeft = CInt(sItems(2))
|
|
nTop = CInt(sItems(3))
|
|
Return True
|
|
End If
|
|
Return False
|
|
End Function
|
|
|
|
Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
|
|
Dim sVal As String = String.Empty
|
|
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
|
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
|
If sItems.Count() = 2 Then
|
|
Return New Language(sItems(0), sItems(1))
|
|
End If
|
|
Return Nothing
|
|
End Function
|
|
|
|
Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
|
|
Dim sVal As String = String.Empty
|
|
GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
|
|
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
|
If sItems.Count() = 2 Then
|
|
Return New Language(sItems(0), sItems(1))
|
|
End If
|
|
Return Nothing
|
|
End Function
|
|
|
|
Public Function WriteMainPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
|
|
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sIniFile)
|
|
End Function
|
|
|
|
Public Function WriteMainPrivateProfileWinPos(IpAppName As String, IpKeyName As String, ByRef nFlag As Integer, ByRef nLeft As Integer, ByRef nTop As Integer, ByRef nWidth As Integer, ByRef nHeight As Integer) As Boolean
|
|
Return EgtUILib.WritePrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
|
|
End Function
|
|
|
|
End Module
|